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 resource: aws_networkmanager_dx_gateway_attachment #40546

Merged

Conversation

ddericco
Copy link
Contributor

@ddericco ddericco commented Dec 12, 2024

Description

  • Adds a new resource aws_networkmanager_dx_gateway_attachment to enable support for Direct Connect gateway attachments to a Cloud WAN core network.
  • Updates the aws_networkmanager_attachment_accepter resource to support Direct Connect gateway attachments.

NOTES:

  • The default account quota for global networks (and Cloud WAN core networks by extension) is 5 - if running the acceptance tests for this resource, consider setting a lower ACCTEST_PARALLELISM or requesting a quota increase.
  • Unlike VPC or other core network attachments, the Direct Connect gateway attachment can only be updated when the state is AVAILABLE - all other states, including Pending Attachment Acceptance, return an InvalidInput error.

Relations

Closes #40310

References

Output from Acceptance Testing

% make testacc TESTS='TestAccNetworkManagerDXGatewayAttachment_*' PKG=networkmanager

make testacc TESTS='TestAccNetworkManagerDXGatewayAttachment_*' PKG=networkmanager ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/networkmanager/... -v -count 1 -parallel 3 -run='TestAccNetworkManagerDXGatewayAttachment_*'  -timeout 360m
2024/12/12 15:58:37 Initializing Terraform AWS Provider...
=== RUN   TestAccNetworkManagerDXGatewayAttachment_basic
=== PAUSE TestAccNetworkManagerDXGatewayAttachment_basic
=== RUN   TestAccNetworkManagerDXGatewayAttachment_disappears
=== PAUSE TestAccNetworkManagerDXGatewayAttachment_disappears
=== RUN   TestAccNetworkManagerDXGatewayAttachment_update
=== PAUSE TestAccNetworkManagerDXGatewayAttachment_update
=== CONT  TestAccNetworkManagerDXGatewayAttachment_basic
=== RUN   TestAccNetworkManagerDXGatewayAttachment_basic/acceptance_required
=== CONT  TestAccNetworkManagerDXGatewayAttachment_update
=== PAUSE TestAccNetworkManagerDXGatewayAttachment_basic/acceptance_required
=== RUN   TestAccNetworkManagerDXGatewayAttachment_basic/acceptance_not_required
=== PAUSE TestAccNetworkManagerDXGatewayAttachment_basic/acceptance_not_required
=== CONT  TestAccNetworkManagerDXGatewayAttachment_disappears
=== CONT  TestAccNetworkManagerDXGatewayAttachment_basic/acceptance_required
=== RUN   TestAccNetworkManagerDXGatewayAttachment_disappears/acceptance_required
=== PAUSE TestAccNetworkManagerDXGatewayAttachment_disappears/acceptance_required
=== RUN   TestAccNetworkManagerDXGatewayAttachment_disappears/acceptance_not_required
=== PAUSE TestAccNetworkManagerDXGatewayAttachment_disappears/acceptance_not_required
=== CONT  TestAccNetworkManagerDXGatewayAttachment_basic/acceptance_not_required
=== CONT  TestAccNetworkManagerDXGatewayAttachment_disappears/acceptance_required
=== CONT  TestAccNetworkManagerDXGatewayAttachment_disappears/acceptance_not_required
--- PASS: TestAccNetworkManagerDXGatewayAttachment_basic (0.00s)
    --- PASS: TestAccNetworkManagerDXGatewayAttachment_basic/acceptance_required (565.63s)
    --- PASS: TestAccNetworkManagerDXGatewayAttachment_basic/acceptance_not_required (1011.83s)
--- PASS: TestAccNetworkManagerDXGatewayAttachment_disappears (0.00s)
    --- PASS: TestAccNetworkManagerDXGatewayAttachment_disappears/acceptance_required (526.46s)
    --- PASS: TestAccNetworkManagerDXGatewayAttachment_disappears/acceptance_not_required (912.59s)
--- PASS: TestAccNetworkManagerDXGatewayAttachment_update (2746.25s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager     2754.021s

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/networkmanager Issues and PRs that pertain to the networkmanager service. generators Relates to code generators. needs-triage Waiting for first response or review from a maintainer. partner Contribution from a partner. labels Dec 12, 2024
@ddericco ddericco marked this pull request as ready for review December 12, 2024 22:09
@ddericco ddericco requested a review from a team as a code owner December 12, 2024 22:09
@ewbankkit ewbankkit self-assigned this Dec 13, 2024
@ewbankkit ewbankkit added enhancement Requests to existing resources that expand the functionality or scope. new-resource Introduces a new resource. and removed needs-triage Waiting for first response or review from a maintainer. labels Dec 13, 2024
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Dec 13, 2024

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank
…achmentARN'.

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank
…in acceptance tests.

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank
… in acceptance tests.

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank
…' is set to null.

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank
…ways set in Update.

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank
…group_name'.
ewbankkit
ewbankkit previously approved these changes Dec 16, 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 🚀.

% ACCTEST_TIMEOUT=720m make testacc TESTARGS='-run=TestAccNetworkManagerDirectConnectGatewayAttachment_\|TestAccNetworkManagerConnectAttachment_basic\|TestAccNetworkManagerSiteToSiteVPNAttachment_basic\|TestAccNetworkManagerTransitGatewayRouteTableAttachment_basic\|TestAccNetworkManagerVPCAttachment_basic' PKG=networkmanager ACCTEST_PARALLELISM=2
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/networkmanager/... -v -count 1 -parallel 2  -run=TestAccNetworkManagerDirectConnectGatewayAttachment_\|TestAccNetworkManagerConnectAttachment_basic\|TestAccNetworkManagerSiteToSiteVPNAttachment_basic\|TestAccNetworkManagerTransitGatewayRouteTableAttachment_basic\|TestAccNetworkManagerVPCAttachment_basic -timeout 720m
2024/12/16 12:13:14 Initializing Terraform AWS Provider...
=== RUN   TestAccNetworkManagerConnectAttachment_basic
=== PAUSE TestAccNetworkManagerConnectAttachment_basic
=== RUN   TestAccNetworkManagerConnectAttachment_basic_NoDependsOn
=== PAUSE TestAccNetworkManagerConnectAttachment_basic_NoDependsOn
=== RUN   TestAccNetworkManagerDirectConnectGatewayAttachment_basic
=== PAUSE TestAccNetworkManagerDirectConnectGatewayAttachment_basic
=== RUN   TestAccNetworkManagerDirectConnectGatewayAttachment_disappears
=== PAUSE TestAccNetworkManagerDirectConnectGatewayAttachment_disappears
=== RUN   TestAccNetworkManagerDirectConnectGatewayAttachment_update
=== PAUSE TestAccNetworkManagerDirectConnectGatewayAttachment_update
=== RUN   TestAccNetworkManagerDirectConnectGatewayAttachment_tags
=== PAUSE TestAccNetworkManagerDirectConnectGatewayAttachment_tags
=== RUN   TestAccNetworkManagerDirectConnectGatewayAttachment_accepted
=== PAUSE TestAccNetworkManagerDirectConnectGatewayAttachment_accepted
=== RUN   TestAccNetworkManagerSiteToSiteVPNAttachment_basic
=== PAUSE TestAccNetworkManagerSiteToSiteVPNAttachment_basic
=== RUN   TestAccNetworkManagerTransitGatewayRouteTableAttachment_basic
=== PAUSE TestAccNetworkManagerTransitGatewayRouteTableAttachment_basic
=== RUN   TestAccNetworkManagerVPCAttachment_basic
=== PAUSE TestAccNetworkManagerVPCAttachment_basic
=== CONT  TestAccNetworkManagerConnectAttachment_basic
=== CONT  TestAccNetworkManagerDirectConnectGatewayAttachment_tags
--- PASS: TestAccNetworkManagerDirectConnectGatewayAttachment_tags (1005.82s)
=== CONT  TestAccNetworkManagerDirectConnectGatewayAttachment_disappears
=== RUN   TestAccNetworkManagerDirectConnectGatewayAttachment_disappears/acceptance_required
=== PAUSE TestAccNetworkManagerDirectConnectGatewayAttachment_disappears/acceptance_required
=== RUN   TestAccNetworkManagerDirectConnectGatewayAttachment_disappears/acceptance_not_required
=== PAUSE TestAccNetworkManagerDirectConnectGatewayAttachment_disappears/acceptance_not_required
=== CONT  TestAccNetworkManagerDirectConnectGatewayAttachment_update
--- PASS: TestAccNetworkManagerConnectAttachment_basic (1109.07s)
=== CONT  TestAccNetworkManagerTransitGatewayRouteTableAttachment_basic
--- PASS: TestAccNetworkManagerDirectConnectGatewayAttachment_update (2238.14s)
=== CONT  TestAccNetworkManagerVPCAttachment_basic
=== RUN   TestAccNetworkManagerVPCAttachment_basic/acceptance_required
=== PAUSE TestAccNetworkManagerVPCAttachment_basic/acceptance_required
=== RUN   TestAccNetworkManagerVPCAttachment_basic/acceptance_not_required
=== PAUSE TestAccNetworkManagerVPCAttachment_basic/acceptance_not_required
=== CONT  TestAccNetworkManagerSiteToSiteVPNAttachment_basic
--- PASS: TestAccNetworkManagerTransitGatewayRouteTableAttachment_basic (1531.48s)
=== CONT  TestAccNetworkManagerDirectConnectGatewayAttachment_accepted
--- PASS: TestAccNetworkManagerDirectConnectGatewayAttachment_accepted (887.94s)
=== CONT  TestAccNetworkManagerDirectConnectGatewayAttachment_basic
=== RUN   TestAccNetworkManagerDirectConnectGatewayAttachment_basic/acceptance_required
=== PAUSE TestAccNetworkManagerDirectConnectGatewayAttachment_basic/acceptance_required
=== RUN   TestAccNetworkManagerDirectConnectGatewayAttachment_basic/acceptance_not_required
=== PAUSE TestAccNetworkManagerDirectConnectGatewayAttachment_basic/acceptance_not_required
=== CONT  TestAccNetworkManagerConnectAttachment_basic_NoDependsOn
--- PASS: TestAccNetworkManagerSiteToSiteVPNAttachment_basic (1079.18s)
=== CONT  TestAccNetworkManagerDirectConnectGatewayAttachment_disappears/acceptance_required
=== CONT  TestAccNetworkManagerDirectConnectGatewayAttachment_disappears/acceptance_not_required
=== NAME  TestAccNetworkManagerConnectAttachment_basic_NoDependsOn
    connect_attachment_test.go:66: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: deleting Network Manager VPC Attachment (attachment-0262efda0afdc290e): operation error NetworkManager: DeleteAttachment, https response error StatusCode: 400, RequestID: 8d6a0109-6960-439a-b1b8-5bc6ae9f131d, ValidationException: VPC attachment (attachment-0262efda0afdc290e) cannot be deleted due to existing Connect attachment (attachment-0e9d2f9034e1685b5).
        
--- FAIL: TestAccNetworkManagerConnectAttachment_basic_NoDependsOn (833.94s)
=== CONT  TestAccNetworkManagerVPCAttachment_basic/acceptance_required
=== CONT  TestAccNetworkManagerVPCAttachment_basic/acceptance_not_required
--- PASS: TestAccNetworkManagerDirectConnectGatewayAttachment_disappears (0.00s)
    --- PASS: TestAccNetworkManagerDirectConnectGatewayAttachment_disappears/acceptance_required (564.14s)
    --- PASS: TestAccNetworkManagerDirectConnectGatewayAttachment_disappears/acceptance_not_required (1004.15s)
=== CONT  TestAccNetworkManagerDirectConnectGatewayAttachment_basic/acceptance_required
=== CONT  TestAccNetworkManagerDirectConnectGatewayAttachment_basic/acceptance_not_required
--- PASS: TestAccNetworkManagerVPCAttachment_basic (0.00s)
    --- PASS: TestAccNetworkManagerVPCAttachment_basic/acceptance_required (589.31s)
    --- PASS: TestAccNetworkManagerVPCAttachment_basic/acceptance_not_required (898.66s)
--- PASS: TestAccNetworkManagerDirectConnectGatewayAttachment_basic (0.00s)
    --- PASS: TestAccNetworkManagerDirectConnectGatewayAttachment_basic/acceptance_required (540.92s)
    --- PASS: TestAccNetworkManagerDirectConnectGatewayAttachment_basic/acceptance_not_required (921.80s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager	6678.836s
FAIL
make: *** [testacc] Error 1

Failure is unrelated to this change and is occurring in CI (e.g. https://hashicorp.teamcity.com/buildConfiguration/TerraformProviders_Aws_Main_ServiceTest_networkmanager/244942):

=== RUN   TestAccNetworkManagerConnectAttachment_basic_NoDependsOn
=== PAUSE TestAccNetworkManagerConnectAttachment_basic_NoDependsOn
=== CONT  TestAccNetworkManagerConnectAttachment_basic_NoDependsOn
    connect_attachment_test.go:66: Error running post-test destroy, there may be dangling resources: exit status 1
        Error: deleting Network Manager VPC Attachment (attachment-065991be773c7877e): operation error NetworkManager: DeleteAttachment, https response error StatusCode: 400, RequestID: 5888622e-4be8-496b-82c1-5075a0b76887, ValidationException: VPC attachment (attachment-065991be773c7877e) cannot be deleted due to existing Connect attachment (attachment-0d7b6f1cef89825bd).
--- FAIL: TestAccNetworkManagerConnectAttachment_basic_NoDependsOn (895.11s)

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank
@ewbankkit
Copy link
Contributor

% SWEEP=us-west-2 SWEEPERS=aws_networkmanager_dx_gateway_attachment make sweep
# make sweep SWEEPARGS=-sweep-run=aws_example_thing
# set SWEEPARGS=-sweep-allow-failures to continue after first failure
WARNING: This will destroy infrastructure. Use only in development accounts.
go1.23.3 test ./internal/sweep -v -sweep=us-west-2 -sweep-run='aws_networkmanager_dx_gateway_attachment' -timeout 360m
2024/12/16 17:50:21 [DEBUG] Running Sweepers for region (us-west-2):
2024/12/16 17:50:21 [DEBUG] Running Sweeper (aws_networkmanager_dx_gateway_attachment) in region (us-west-2)
2024/12/16 17:50:21 [DEBUG] sweeper: Configuring Terraform AWS Provider: sweeper_region=us-west-2
2024-12-16T17:50:21.992-0500 [DEBUG] sweeper.aws-base: Resolving credentials provider: sweeper_region=us-west-2
2024-12-16T17:50:21.992-0500 [DEBUG] sweeper.aws-base: Loading configuration: sweeper_region=us-west-2
2024-12-16T17:50:21.992-0500 [DEBUG] sweeper.aws-base: Retrieving credentials: sweeper_region=us-west-2
2024-12-16T17:50:21.992-0500 [INFO]  sweeper.aws-base: Retrieved credentials: sweeper_region=us-west-2 tf_aws.credentials_source=EnvConfigCredentials
2024-12-16T17:50:21.992-0500 [DEBUG] sweeper.aws-base: Loading configuration: sweeper_region=us-west-2
2024/12/16 17:50:21 [DEBUG] sweeper: Creating AWS SDK v1 session: sweeper_region=us-west-2
2024/12/16 17:50:21 [DEBUG] sweeper: Retrieving AWS account details: sweeper_region=us-west-2
2024-12-16T17:50:21.992-0500 [DEBUG] sweeper.aws-base: Retrieving caller identity from STS: sweeper_region=us-west-2
2024-12-16T17:50:22.354-0500 [INFO]  sweeper.aws-base: Retrieved caller identity from STS: sweeper_region=us-west-2
2024/12/16 17:50:22 [INFO]  sweeper: No resources to sweep: sweeper_region=us-west-2
2024/12/16 17:50:22 [DEBUG] Completed Sweeper (aws_networkmanager_dx_gateway_attachment) in region (us-west-2) in 934.937458ms
2024/12/16 17:50:22 Completed Sweepers for region (us-west-2) in 935.145042ms
2024/12/16 17:50:22 Sweeper Tests for region (us-west-2) ran successfully:
2024/12/16 17:50:22 	- aws_networkmanager_dx_gateway_attachment
ok  	github.com/hashicorp/terraform-provider-aws/internal/sweep	6.469s

Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

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

A couple doc nits, otherwise LGTM

ewbankkit and others added 5 commits December 17, 2024 10:02

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Co-authored-by: Jared Baker <jar-b@users.noreply.github.com>

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Co-authored-by: Jared Baker <jar-b@users.noreply.github.com>

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank
…ed by blank lines'.
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@ewbankkit
Copy link
Contributor

@ddericco Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit f8f1e03 into hashicorp:main Dec 17, 2024
41 checks passed
@github-actions github-actions bot added this to the v5.82.0 milestone Dec 17, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Dec 19, 2024
Copy link

This functionality has been released in v5.82.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. generators Relates to code generators. new-resource Introduces a new resource. partner Contribution from a partner. service/networkmanager Issues and PRs that pertain to the networkmanager service. 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.

Cloud WAN integration with Direct Connect
3 participants