-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
resource/aws_networkmanager_vpc_attachment: Allow deleting when not attached #34547
Conversation
Community NoteVoting for Prioritization
For Submitters
|
Thank you for your contribution! 🚀 A new usage of AWS SDK for Go V1 was detected. Please prefer AWS SDK for Go V2 for all net-new services. If this is an enhancement or bug fix to an existing AWS SDK Go V1 based resource, this comment can be safely ignored. For additional information refer to the AWS SDK for Go Versions page in the contributor guide. |
% ACCTEST_TIMEOUT=720m make testacc TESTARGS='-run=TestAccNetworkManagerVPCAttachment_' PKG=networkmanager ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/networkmanager/... -v -count 1 -parallel 2 -run=TestAccNetworkManagerVPCAttachment_ -timeout 720m
=== RUN TestAccNetworkManagerVPCAttachment_basic
=== PAUSE TestAccNetworkManagerVPCAttachment_basic
=== RUN TestAccNetworkManagerVPCAttachment_Attached_basic
=== PAUSE TestAccNetworkManagerVPCAttachment_Attached_basic
=== RUN TestAccNetworkManagerVPCAttachment_disappears
=== PAUSE TestAccNetworkManagerVPCAttachment_disappears
=== RUN TestAccNetworkManagerVPCAttachment_Attached_disappears
=== PAUSE TestAccNetworkManagerVPCAttachment_Attached_disappears
=== RUN TestAccNetworkManagerVPCAttachment_Attached_disappearsAccepter
=== PAUSE TestAccNetworkManagerVPCAttachment_Attached_disappearsAccepter
=== RUN TestAccNetworkManagerVPCAttachment_tags
=== PAUSE TestAccNetworkManagerVPCAttachment_tags
=== RUN TestAccNetworkManagerVPCAttachment_update
=== PAUSE TestAccNetworkManagerVPCAttachment_update
=== RUN TestAccNetworkManagerVPCAttachment_Attached_update
=== PAUSE TestAccNetworkManagerVPCAttachment_Attached_update
=== CONT TestAccNetworkManagerVPCAttachment_basic
=== RUN TestAccNetworkManagerVPCAttachment_basic/acceptance_required
=== CONT TestAccNetworkManagerVPCAttachment_Attached_update
=== PAUSE TestAccNetworkManagerVPCAttachment_basic/acceptance_required
=== RUN TestAccNetworkManagerVPCAttachment_Attached_update/acceptance_not_required
=== RUN TestAccNetworkManagerVPCAttachment_basic/acceptance_not_required
=== PAUSE TestAccNetworkManagerVPCAttachment_basic/acceptance_not_required
=== PAUSE TestAccNetworkManagerVPCAttachment_Attached_update/acceptance_not_required
=== RUN TestAccNetworkManagerVPCAttachment_Attached_update/acceptance_required
=== PAUSE TestAccNetworkManagerVPCAttachment_Attached_update/acceptance_required
=== CONT TestAccNetworkManagerVPCAttachment_update
=== RUN TestAccNetworkManagerVPCAttachment_update/acceptance_required
=== PAUSE TestAccNetworkManagerVPCAttachment_update/acceptance_required
=== RUN TestAccNetworkManagerVPCAttachment_update/acceptance_not_required
=== PAUSE TestAccNetworkManagerVPCAttachment_update/acceptance_not_required
=== CONT TestAccNetworkManagerVPCAttachment_tags
=== CONT TestAccNetworkManagerVPCAttachment_Attached_disappearsAccepter
--- PASS: TestAccNetworkManagerVPCAttachment_tags (977.58s)
=== CONT TestAccNetworkManagerVPCAttachment_Attached_disappears
=== RUN TestAccNetworkManagerVPCAttachment_Attached_disappears/acceptance_not_required
=== PAUSE TestAccNetworkManagerVPCAttachment_Attached_disappears/acceptance_not_required
=== RUN TestAccNetworkManagerVPCAttachment_Attached_disappears/acceptance_required
=== PAUSE TestAccNetworkManagerVPCAttachment_Attached_disappears/acceptance_required
=== CONT TestAccNetworkManagerVPCAttachment_disappears
=== RUN TestAccNetworkManagerVPCAttachment_disappears/acceptance_required
=== PAUSE TestAccNetworkManagerVPCAttachment_disappears/acceptance_required
=== RUN TestAccNetworkManagerVPCAttachment_disappears/acceptance_not_required
=== PAUSE TestAccNetworkManagerVPCAttachment_disappears/acceptance_not_required
=== CONT TestAccNetworkManagerVPCAttachment_Attached_basic
=== RUN TestAccNetworkManagerVPCAttachment_Attached_basic/acceptance_not_required
=== PAUSE TestAccNetworkManagerVPCAttachment_Attached_basic/acceptance_not_required
=== RUN TestAccNetworkManagerVPCAttachment_Attached_basic/acceptance_required
=== PAUSE TestAccNetworkManagerVPCAttachment_Attached_basic/acceptance_required
=== CONT TestAccNetworkManagerVPCAttachment_basic/acceptance_required
--- PASS: TestAccNetworkManagerVPCAttachment_Attached_disappearsAccepter (1001.23s)
=== CONT TestAccNetworkManagerVPCAttachment_basic/acceptance_not_required
=== CONT TestAccNetworkManagerVPCAttachment_Attached_update/acceptance_not_required
--- PASS: TestAccNetworkManagerVPCAttachment_basic (0.00s)
--- PASS: TestAccNetworkManagerVPCAttachment_basic/acceptance_required (557.94s)
--- PASS: TestAccNetworkManagerVPCAttachment_basic/acceptance_not_required (946.77s)
=== CONT TestAccNetworkManagerVPCAttachment_update/acceptance_required
=== CONT TestAccNetworkManagerVPCAttachment_Attached_update/acceptance_required
=== CONT TestAccNetworkManagerVPCAttachment_update/acceptance_not_required
=== NAME TestAccNetworkManagerVPCAttachment_Attached_update/acceptance_required
vpc_attachment_test.go:474: Step 2/5 error: Check failed: Check 2/5 error: Attachment not recreated: v1.CreatedAt="2023-11-28 16:14:07 +0000 UTC", v2.CreatedAt="2023-11-28 16:14:07 +0000 UTC"
--- FAIL: TestAccNetworkManagerVPCAttachment_Attached_update (0.00s)
--- PASS: TestAccNetworkManagerVPCAttachment_Attached_update/acceptance_not_required (1417.29s)
--- FAIL: TestAccNetworkManagerVPCAttachment_Attached_update/acceptance_required (1192.91s)
=== CONT TestAccNetworkManagerVPCAttachment_Attached_disappears/acceptance_not_required
--- PASS: TestAccNetworkManagerVPCAttachment_update (0.00s)
--- PASS: TestAccNetworkManagerVPCAttachment_update/acceptance_required (604.55s)
--- PASS: TestAccNetworkManagerVPCAttachment_update/acceptance_not_required (1331.29s)
=== CONT TestAccNetworkManagerVPCAttachment_Attached_disappears/acceptance_required
=== CONT TestAccNetworkManagerVPCAttachment_disappears/acceptance_required
=== CONT TestAccNetworkManagerVPCAttachment_disappears/acceptance_not_required
--- PASS: TestAccNetworkManagerVPCAttachment_Attached_disappears (0.00s)
--- PASS: TestAccNetworkManagerVPCAttachment_Attached_disappears/acceptance_not_required (930.57s)
--- PASS: TestAccNetworkManagerVPCAttachment_Attached_disappears/acceptance_required (949.82s)
=== CONT TestAccNetworkManagerVPCAttachment_Attached_basic/acceptance_not_required
=== CONT TestAccNetworkManagerVPCAttachment_Attached_basic/acceptance_required
--- PASS: TestAccNetworkManagerVPCAttachment_disappears (0.00s)
--- PASS: TestAccNetworkManagerVPCAttachment_disappears/acceptance_required (566.03s)
--- PASS: TestAccNetworkManagerVPCAttachment_disappears/acceptance_not_required (1037.53s)
--- PASS: TestAccNetworkManagerVPCAttachment_Attached_basic (0.00s)
--- PASS: TestAccNetworkManagerVPCAttachment_Attached_basic/acceptance_not_required (1020.32s)
--- PASS: TestAccNetworkManagerVPCAttachment_Attached_basic/acceptance_required (1021.78s)
FAIL
FAIL github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager 7290.332s
FAIL
make: *** [testacc] Error 1 % ACCTEST_TIMEOUT=720m make testacc TESTARGS='-run=TestAccNetworkManagerVPCAttachment_Attached_update/acceptance_required' PKG=networkmanager
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/networkmanager/... -v -count 1 -parallel 20 -run=TestAccNetworkManagerVPCAttachment_Attached_update/acceptance_required -timeout 720m
=== RUN TestAccNetworkManagerVPCAttachment_Attached_update
=== PAUSE TestAccNetworkManagerVPCAttachment_Attached_update
=== CONT TestAccNetworkManagerVPCAttachment_Attached_update
=== RUN TestAccNetworkManagerVPCAttachment_Attached_update/acceptance_required
=== PAUSE TestAccNetworkManagerVPCAttachment_Attached_update/acceptance_required
=== CONT TestAccNetworkManagerVPCAttachment_Attached_update/acceptance_required
vpc_attachment_test.go:474: Step 2/5 error: Check failed: Check 2/5 error: Attachment not recreated: v1.CreatedAt="2023-11-28 17:55:41 +0000 UTC", v2.CreatedAt="2023-11-28 17:55:41 +0000 UTC"
--- FAIL: TestAccNetworkManagerVPCAttachment_Attached_update (0.00s)
--- FAIL: TestAccNetworkManagerVPCAttachment_Attached_update/acceptance_required (1113.09s)
FAIL
FAIL github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager 1125.369s
FAIL
make: *** [testacc] Error 1 |
There was a problem hiding this 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=TestAccNetworkManagerVPCAttachment_Attached_update' PKG=networkmanager
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/networkmanager/... -v -count 1 -parallel 20 -run=TestAccNetworkManagerVPCAttachment_Attached_update -timeout 720m
=== RUN TestAccNetworkManagerVPCAttachment_Attached_update
=== PAUSE TestAccNetworkManagerVPCAttachment_Attached_update
=== CONT TestAccNetworkManagerVPCAttachment_Attached_update
=== RUN TestAccNetworkManagerVPCAttachment_Attached_update/acceptance_required
=== PAUSE TestAccNetworkManagerVPCAttachment_Attached_update/acceptance_required
=== RUN TestAccNetworkManagerVPCAttachment_Attached_update/acceptance_not_required
=== PAUSE TestAccNetworkManagerVPCAttachment_Attached_update/acceptance_not_required
=== CONT TestAccNetworkManagerVPCAttachment_Attached_update/acceptance_required
=== CONT TestAccNetworkManagerVPCAttachment_Attached_update/acceptance_not_required
--- PASS: TestAccNetworkManagerVPCAttachment_Attached_update (0.00s)
--- PASS: TestAccNetworkManagerVPCAttachment_Attached_update/acceptance_not_required (1431.89s)
--- PASS: TestAccNetworkManagerVPCAttachment_Attached_update/acceptance_required (1463.39s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager 1469.100s
This functionality has been released in v5.29.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! |
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. |
Description
When waiting for acceptance, the resource
aws_networkmanager_vpc_attachment
previously incorrectly returned an error stating that it could not be deleted.This PR now rejects the VPC attachment and deletes it.
Previously, the Delete operation of the resource
aws_networkmanager_attachment_accepter
was a no-op, leaving any attachments in place.For VPC attachments, deleting a corresponding
aws_networkmanager_attachment_accepter
now removes the attachment.Previously, modifying the fields of the
options
parameter ofaws_networkmanager_vpc_attachment
would cause a run-time error.Modifying these fields now causes re-creation of the
aws_networkmanager_vpc_attachment
.Relations
Closes #34501
Relates #34502
References
Output from Acceptance Testing