-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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_internet_gateway: continue to deletion when attachment not found #41346
Conversation
Community NoteVoting for Prioritization
For Submitters
|
This fixes a regression introduced in `v5.83.0` which caused destruction of the `aws_internet_gateway` resource to exit early if an attempt to detach the internet gateway returned a not found error. Rather than exit early, the operation should just proceed after `NotFound` errors to allow the internet gateway to be deleted. ```console % make testacc PKG=ec2 TESTS=TestAccVPCInternetGateway_ make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... TF_ACC=1 go1.23.5 test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccVPCInternetGateway_' -timeout 360m -vet=off 2025/02/11 16:45:34 Initializing Terraform AWS Provider... --- PASS: TestAccVPCInternetGateway_disappears (13.68s) --- PASS: TestAccVPCInternetGateway_basic (15.96s) --- PASS: TestAccVPCInternetGateway_Disappears_attachment (18.03s) --- PASS: TestAccVPCInternetGateway_attachment (30.32s) --- PASS: TestAccVPCInternetGateway_tags (32.52s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 39.413s ```
Previously this test was deleting the internet gateway out-of-band, rather than just the attachment. The configuration has been updated to use a standalone `aws_internet_gateway_attachment` resource which, is deleted out-of-band. ```console % make testacc PKG=ec2 TESTS=TestAccVPCInternetGateway_Disappears_attachment make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... TF_ACC=1 go1.23.5 test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccVPCInternetGateway_Disappears_attachment' -timeout 360m -vet=off 2025/02/11 16:56:26 Initializing Terraform AWS Provider... --- PASS: TestAccVPCInternetGateway_Disappears_attachment (16.45s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 23.302s ```
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 🚀
% make testacc PKG=ec2 TESTS=TestAccVPCInternetGateway_
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.5 test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccVPCInternetGateway_' -timeout 360m -vet=off
2025/02/12 10:26:54 Initializing Terraform AWS Provider...
--- PASS: TestAccVPCInternetGateway_disappears (14.04s)
--- PASS: TestAccVPCInternetGateway_basic (16.03s)
--- PASS: TestAccVPCInternetGateway_Disappears_attachment (17.23s)
--- PASS: TestAccVPCInternetGateway_attachment (29.32s)
--- PASS: TestAccVPCInternetGateway_tags (31.85s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 38.745s
This functionality has been released in v5.87.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! |
Description
This fixes a regression introduced in
v5.83.0
which caused destruction of theaws_internet_gateway
resource to exit early if an attempt to detach the internet gateway returned a not found error. Rather than exit early, the operation should just proceed afterNotFound
errors to allow the internet gateway to be deleted.Also updates the
_Disappears_attachment
acceptance test to delete a standalone attachment out-of-band, rather than the entire internet gateway.Relations
Closes #41327
Relates #40790
References
Output from Acceptance Testing