Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "arns" as an output to "data aws_autoscaling_groups" #5766

Merged
merged 4 commits into from
Sep 20, 2018

Conversation

Guimove
Copy link
Contributor

@Guimove Guimove commented Sep 4, 2018

Fixes #1909

Changes proposed in this pull request:

Output from acceptance testing:

$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSAutoscalingGroups_basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSAutoscalingGroups_basic -timeout 120m
=== RUN   TestAccAWSAutoscalingGroups_basic
--- PASS: TestAccAWSAutoscalingGroups_basic (114.28s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	114.304s


...

State File:

{
    "version": 3,
    "terraform_version": "0.11.4",
    "serial": 7,
    "lineage": "236fra8a-d142-d494-72bd-61d4c3a0c925",
    "modules": [
        {
            "path": [
                "root"
            ],
            "outputs": {},
            "resources": {
                "data.aws_autoscaling_groups.groups": {
                    "type": "aws_autoscaling_groups",
                    "depends_on": [],
                    "primary": {
                        "id": "2018-09-04 13:43:21.821942773 +0000 UTC",
                        "attributes": {
                            "arns.#": "5",
                            "arns.0": "arn:aws:autoscaling:eu-west-1:XXXXXXXXXXXXXXXXXXXXXXXXXXX:autoScalingGroup:XXXXXXXXXXXXXXXXXX:autoScalingGroupName/webfront - webfront_20180820097504342100000001",
                            "arns.1": "arn:aws:autoscaling:eu-west-1:XXXXXXXXXXXXXXXXXXXXXXXXXXX:autoScalingGroup:XXXXXXXXXXXXXXXXXX:autoScalingGroupName/webfront - webfront_20180830152943996400000001",
                            "arns.2": "arn:aws:autoscaling:eu-west-1:XXXXXXXXXXXXXXXXXXXXXXXXXXX:autoScalingGroup:XXXXXXXXXXXXXXXXXX:autoScalingGroupName/webfront - webfront_20180821062349319100000001",
                            "arns.3": "arn:aws:autoscaling:eu-west-1:XXXXXXXXXXXXXXXXXXXXXXXXXXX:autoScalingGroup:XXXXXXXXXXXXXXXXXX:autoScalingGroupName/webfront - webfront_20180828083217913900000001",
                            "arns.4": "arn:aws:autoscaling:eu-west-1:XXXXXXXXXXXXXXXXXXXXXXXXXXX:autoScalingGroup:XXXXXXXXXXXXXXXXXX:autoScalingGroupName/webfront - webfront_20180822345987913900000001",
                            "id": "2018-09-04 13:43:21.821942773 +0000 UTC",
                            "names.#": "5",
                            "names.0": "webfront - webfront_20180820097504342100000001",
                            "names.1": "webfront - webfront_20180830152943996400000001",
                            "names.2": "webfront - webfront_20180821062349319100000001",
                            "names.3": "webfront - webfront_20180828083217913900000001",
                            "names.4": "webfront - webfront_20180822345987913900000001"
                        },
                        "meta": {},
                        "tainted": false
                    },
                    "deposed": [],
                    "provider": "provider.aws"
                }
            },
            "depends_on": []
        }
    ]
}

@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service. labels Sep 4, 2018

for _, v := range rawName {
input := &autoscaling.DescribeAutoScalingGroupsInput{
AutoScalingGroupNames: []*string{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears this parameter can accept up to 1600 names: https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DescribeAutoScalingGroups.html

Seems like we should remove the for loop that makes an DescribeAutoScalingGroups API call for every result and instead call it once (or preferably batched every 1600 names) with all the rawName.

@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Sep 4, 2018
@ghost ghost added the size/M Managed by automation to categorize the size of a PR. label Sep 14, 2018
@ghost ghost added documentation Introduces or discusses updates to documentation. service/autoscaling Issues and PRs that pertain to the autoscaling service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Sep 18, 2018
@bflad bflad removed the waiting-response Maintainers are waiting on response from community or contributor. label Sep 18, 2018
@ghost ghost added size/S Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. service/autoscaling Issues and PRs that pertain to the autoscaling service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. and removed size/M Managed by automation to categorize the size of a PR. labels Sep 20, 2018
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @Guimove! 🚀

1 test passed (all tests)
--- PASS: TestAccAWSAutoscalingGroups_basic (89.30s)

@bflad bflad added this to the v1.38.0 milestone Sep 20, 2018
@bflad bflad merged commit 8fae25b into hashicorp:master Sep 20, 2018
bflad added a commit that referenced this pull request Sep 20, 2018
@Guimove
Copy link
Contributor Author

Guimove commented Sep 20, 2018

🍾 Thanks you :)

@Guimove Guimove deleted the 1909_aws_autoscaling_groups branch September 20, 2018 13:39
@bflad
Copy link
Contributor

bflad commented Sep 26, 2018

This has been released in version 1.38.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 3, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/autoscaling Issues and PRs that pertain to the autoscaling service. service/ec2 Issues and PRs that pertain to the ec2 service. size/S Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "arns" as an output to "data aws_autoscaling_groups"
2 participants