Skip to content

Commit

Permalink
issue hashicorp#4531 add pagination when using filters
Browse files Browse the repository at this point in the history
  • Loading branch information
saravanan30erd committed May 14, 2018
1 parent e3b9efc commit c6a416b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions aws/data_source_aws_autoscaling_groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ func dataSourceAwsAutoscalingGroupsRead(d *schema.ResourceData, meta interface{}

tf := d.Get("filter").(*schema.Set)
if tf.Len() > 0 {
out, err := conn.DescribeTags(&autoscaling.DescribeTagsInput{
input := &autoscaling.DescribeTagsInput{
Filters: expandAsgTagFilters(tf.List()),
})
if err != nil {
return err
}

raw = make([]string, len(out.Tags))
for i, v := range out.Tags {
raw[i] = *v.ResourceId
if err := conn.DescribeTagsPages(input, func(resp *autoscaling.DescribeTagsOutput, lastPage bool) bool {
for _, v := range resp.Tags {
raw = append(raw, *v.ResourceId)
}
return true
}); err != nil {
return err
}
} else {
if err := conn.DescribeAutoScalingGroupsPages(&autoscaling.DescribeAutoScalingGroupsInput{}, func(resp *autoscaling.DescribeAutoScalingGroupsOutput, lastPage bool) bool {
Expand Down

0 comments on commit c6a416b

Please sign in to comment.