hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.84k stars 9.19k forks source link

r/aws_globalaccelerator_endpoint_group: add `attachment_arn` to `endpoint_configuration` #39507

Closed tcarreira closed 1 month ago

tcarreira commented 1 month ago

(continuing #37269)

Description

In https://github.com/hashicorp/terraform-provider-aws/pull/35991 we added support for making cross account attachments (docs). There was one part missing, using them in the endpoint group for the Global Accelerator (AGA).

This add support for setting this field AttachmentArn: https://docs.aws.amazon.com/global-accelerator/latest/api/API_EndpointConfiguration.html

Relations

Closes #37631 Closes #37269

References

Completing the work started on #37269 Following feature from #35991

Output from Acceptance Testing

new test:

❯ make testacc TESTS=TestAccGlobalAcceleratorEndpointGroup_crossAccountAttachment PKG=globalaccelerator
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.7 test ./internal/service/globalaccelerator/... -v -count 1 -parallel 10 -run='TestAccGlobalAcceleratorEndpointGroup_crossAccountAttachment'  -timeout 360m
=== RUN   TestAccGlobalAcceleratorEndpointGroup_crossAccountAttachment
=== PAUSE TestAccGlobalAcceleratorEndpointGroup_crossAccountAttachment
=== CONT  TestAccGlobalAcceleratorEndpointGroup_crossAccountAttachment
--- PASS: TestAccGlobalAcceleratorEndpointGroup_crossAccountAttachment (410.65s)
PASS

note: I had to run this test without the PreCheck acctest.PreCheckOrganizationsAccount(ctx, t) bc I don't have multiple AWS accounts on different Orgs. I should not affect the result.

All tests for this resource:

❯ ACCTEST_PARALLELISM=10 make testacc TESTS=TestAccGlobalAcceleratorEndpointGroup PKG=globalaccelerator
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.7 test ./internal/service/globalaccelerator/... -v -count 1 -parallel 10 -run='TestAccGlobalAcceleratorEndpointGroup'  -timeout 360m
 === RUN   TestAccGlobalAcceleratorEndpointGroup_basic
=== PAUSE TestAccGlobalAcceleratorEndpointGroup_basic
=== RUN   TestAccGlobalAcceleratorEndpointGroup_disappears
=== PAUSE TestAccGlobalAcceleratorEndpointGroup_disappears
=== RUN   TestAccGlobalAcceleratorEndpointGroup_ALBEndpoint_clientIP
=== PAUSE TestAccGlobalAcceleratorEndpointGroup_ALBEndpoint_clientIP
=== RUN   TestAccGlobalAcceleratorEndpointGroup_multiRegion
=== PAUSE TestAccGlobalAcceleratorEndpointGroup_multiRegion
=== RUN   TestAccGlobalAcceleratorEndpointGroup_portOverrides
=== PAUSE TestAccGlobalAcceleratorEndpointGroup_portOverrides
=== RUN   TestAccGlobalAcceleratorEndpointGroup_tcpHealthCheckProtocol
=== PAUSE TestAccGlobalAcceleratorEndpointGroup_tcpHealthCheckProtocol
=== RUN   TestAccGlobalAcceleratorEndpointGroup_update
=== PAUSE TestAccGlobalAcceleratorEndpointGroup_update
=== RUN   TestAccGlobalAcceleratorEndpointGroup_crossAccountAttachment
=== PAUSE TestAccGlobalAcceleratorEndpointGroup_crossAccountAttachment
=== CONT  TestAccGlobalAcceleratorEndpointGroup_basic
=== CONT  TestAccGlobalAcceleratorEndpointGroup_portOverrides
=== CONT  TestAccGlobalAcceleratorEndpointGroup_update
=== CONT  TestAccGlobalAcceleratorEndpointGroup_crossAccountAttachment
=== CONT  TestAccGlobalAcceleratorEndpointGroup_tcpHealthCheckProtocol
=== CONT  TestAccGlobalAcceleratorEndpointGroup_ALBEndpoint_clientIP
=== CONT  TestAccGlobalAcceleratorEndpointGroup_disappears
=== CONT  TestAccGlobalAcceleratorEndpointGroup_multiRegion
--- PASS: TestAccGlobalAcceleratorEndpointGroup_basic (207.84s)
--- PASS: TestAccGlobalAcceleratorEndpointGroup_tcpHealthCheckProtocol (208.01s)
--- PASS: TestAccGlobalAcceleratorEndpointGroup_disappears (209.61s)
--- PASS: TestAccGlobalAcceleratorEndpointGroup_multiRegion (218.10s)
--- PASS: TestAccGlobalAcceleratorEndpointGroup_portOverrides (257.11s)
--- PASS: TestAccGlobalAcceleratorEndpointGroup_update (258.26s)
--- PASS: TestAccGlobalAcceleratorEndpointGroup_crossAccountAttachment (367.99s)
--- PASS: TestAccGlobalAcceleratorEndpointGroup_ALBEndpoint_clientIP (959.40s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/globalaccelerator  959.546s

(I did not run TestAccGlobalAcceleratorEndpointGroup_instanceEndpoint)

github-actions[bot] commented 1 month ago

Community Note

Voting for Prioritization

For Submitters

ewbankkit commented 1 month ago

@tcarreira Thanks for the contribution :tada: :clap:.

tcarreira commented 1 month ago

Thanks for the quick review/approve

github-actions[bot] commented 1 month ago

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

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

github-actions[bot] commented 1 week ago

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.