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

b/aws_eip on delete error with ipam_pool_id stuck in IPAM eventual consistency loop #40082

Closed alexbacchin closed 4 days ago

alexbacchin commented 4 days ago

Description

This PR fixes the aws_eip issue when action ReleaseAddress raises an error and ipam_pool_id is set. The error is not handled because the code enters IPAM eventual consistency check and never exists (until timeout).

This simply moves the error handling before the IPAM eventual consistency check

Relations

References

Output from Acceptance Testing

make testacc TESTS=TestAccEC2EIP_PublicIPv4Pool_IPAMPoolId PKG=ec2
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.2 test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccEC2EIP_PublicIPv4Pool_IPAMPoolId'  -timeout 360m
2024/11/11 21:59:11 Initializing Terraform AWS Provider...
=== RUN   TestAccEC2EIP_PublicIPv4Pool_IPAMPoolId
=== PAUSE TestAccEC2EIP_PublicIPv4Pool_IPAMPoolId
=== CONT  TestAccEC2EIP_PublicIPv4Pool_IPAMPoolId
--- PASS: TestAccEC2EIP_PublicIPv4Pool_IPAMPoolId (81.56s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ec2        81.626s
...
github-actions[bot] commented 4 days ago

Community Note

Voting for Prioritization

For Submitters

jar-b commented 4 days ago

Thanks for the fix, @alexbacchin! πŸ‘

github-actions[bot] commented 1 day ago

This functionality has been released in v5.76.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!