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

r/aws_globalaccelerator_endpoint_group: add attachment_arn to endpoint_configuration #39507

Conversation

tcarreira
Copy link
Contributor

@tcarreira tcarreira commented Sep 26, 2024

(continuing #37269)

Description

In #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)

@tcarreira tcarreira requested a review from a team as a code owner September 26, 2024 18:44
Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/globalaccelerator Issues and PRs that pertain to the globalaccelerator service. needs-triage Waiting for first response or review from a maintainer. labels Sep 26, 2024
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @tcarreira 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@ewbankkit ewbankkit added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Oct 1, 2024
@ewbankkit ewbankkit self-assigned this Oct 1, 2024
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

% make testacc TESTARGS='-run=TestAccGlobalAcceleratorEndpointGroup_' PKG=globalaccelerator ACCTEST_PARALLELISM=2
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.1 test ./internal/service/globalaccelerator/... -v -count 1 -parallel 2  -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_instanceEndpoint
=== PAUSE TestAccGlobalAcceleratorEndpointGroup_instanceEndpoint
=== 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
--- PASS: TestAccGlobalAcceleratorEndpointGroup_basic (165.66s)
=== CONT  TestAccGlobalAcceleratorEndpointGroup_update
--- PASS: TestAccGlobalAcceleratorEndpointGroup_portOverrides (208.23s)
=== CONT  TestAccGlobalAcceleratorEndpointGroup_crossAccountAttachment
    endpoint_group_test.go:444: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
--- SKIP: TestAccGlobalAcceleratorEndpointGroup_crossAccountAttachment (0.13s)
=== CONT  TestAccGlobalAcceleratorEndpointGroup_tcpHealthCheckProtocol
--- PASS: TestAccGlobalAcceleratorEndpointGroup_update (228.84s)
=== CONT  TestAccGlobalAcceleratorEndpointGroup_instanceEndpoint
--- PASS: TestAccGlobalAcceleratorEndpointGroup_tcpHealthCheckProtocol (205.29s)
=== CONT  TestAccGlobalAcceleratorEndpointGroup_multiRegion
--- PASS: TestAccGlobalAcceleratorEndpointGroup_multiRegion (171.94s)
=== CONT  TestAccGlobalAcceleratorEndpointGroup_ALBEndpoint_clientIP
--- PASS: TestAccGlobalAcceleratorEndpointGroup_instanceEndpoint (715.26s)
=== CONT  TestAccGlobalAcceleratorEndpointGroup_disappears
--- PASS: TestAccGlobalAcceleratorEndpointGroup_disappears (173.05s)
--- PASS: TestAccGlobalAcceleratorEndpointGroup_ALBEndpoint_clientIP (809.58s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/globalaccelerator	1400.632s
% make testacc TESTARGS='-run=TestAccGlobalAcceleratorEndpointGroup_crossAccountAttachment' PKG=globalaccelerator
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.1 test ./internal/service/globalaccelerator/... -v -count 1 -parallel 20  -run=TestAccGlobalAcceleratorEndpointGroup_crossAccountAttachment -timeout 360m
=== RUN   TestAccGlobalAcceleratorEndpointGroup_crossAccountAttachment
=== PAUSE TestAccGlobalAcceleratorEndpointGroup_crossAccountAttachment
=== CONT  TestAccGlobalAcceleratorEndpointGroup_crossAccountAttachment
--- PASS: TestAccGlobalAcceleratorEndpointGroup_crossAccountAttachment (346.59s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/globalaccelerator	351.766s

@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Oct 1, 2024
@ewbankkit
Copy link
Contributor

@tcarreira Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit c20eb9b into hashicorp:main Oct 1, 2024
40 checks passed
@github-actions github-actions bot added this to the v5.70.0 milestone Oct 1, 2024
@tcarreira tcarreira deleted the f-aws_globalaccelerator_endpoint_group-add-attachment_arn branch October 1, 2024 19:53
@tcarreira
Copy link
Contributor Author

Thanks for the quick review/approve

@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Oct 4, 2024
Copy link

github-actions bot commented Oct 4, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/globalaccelerator Issues and PRs that pertain to the globalaccelerator service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
3 participants