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

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

Merged
merged 6 commits into from
Nov 11, 2024

Conversation

alexbacchin
Copy link
Contributor

@alexbacchin alexbacchin commented Nov 11, 2024

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
...

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 service/ec2 Issues and PRs that pertain to the ec2 service. needs-triage Waiting for first response or review from a maintainer. labels Nov 11, 2024
@alexbacchin alexbacchin marked this pull request as ready for review November 11, 2024 11:16
@alexbacchin alexbacchin requested a review from a team as a code owner November 11, 2024 11:16
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Nov 11, 2024
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 🎉

% make testacc PKG=ec2 TESTS=TestAccEC2EIP_
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_'  -timeout 360m
2024/11/11 11:31:00 Initializing Terraform AWS Provider...

=== NAME  TestAccEC2EIP_carrierIP
    wavelength_carrier_gateway_test.go:198: skipping since no Wavelength Zones are available
--- SKIP: TestAccEC2EIP_carrierIP (0.78s)
=== NAME  TestAccEC2EIP_customerOwnedIPv4Pool
    ec2_eip_test.go:538: skipping since no Outposts found
--- SKIP: TestAccEC2EIP_customerOwnedIPv4Pool (0.82s)
--- PASS: TestAccEC2EIP_BYOIPAddress_default (23.11s)
--- PASS: TestAccEC2EIP_disappears (23.64s)
--- PASS: TestAccEC2EIP_networkBorderGroup (25.05s)
--- PASS: TestAccEC2EIP_PublicIPv4Pool_default (25.77s)
--- PASS: TestAccEC2EIP_noVPC (26.43s)
--- PASS: TestAccEC2EIP_basic (26.55s)
--- PASS: TestAccEC2EIP_NetworkInterface_twoEIPsOneInterface (32.10s)
--- PASS: TestAccEC2EIP_migrateVPCToDomain (33.64s)
--- PASS: TestAccEC2EIP_networkInterface (35.61s)
--- PASS: TestAccEC2EIP_tags (45.86s)
--- PASS: TestAccEC2EIP_PublicIPv4Pool_IPAMPoolId (82.51s)
--- PASS: TestAccEC2EIP_Instance_reassociate (125.31s)
--- PASS: TestAccEC2EIP_Instance_notAssociated (132.89s)
--- PASS: TestAccEC2EIP_association (167.12s)
--- PASS: TestAccEC2EIP_Instance_associatedUserPrivateIP (167.48s)
--- PASS: TestAccEC2EIP_instance (332.63s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ec2        338.207s

@jar-b
Copy link
Member

jar-b commented Nov 11, 2024

Thanks for the fix, @alexbacchin! 👍

@jar-b jar-b merged commit d82ef74 into hashicorp:main Nov 11, 2024
31 checks passed
@github-actions github-actions bot added this to the v5.76.0 milestone Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants