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

r/aws_eip: use retry logic when creating new resources #32016

Merged
merged 4 commits into from
Jun 16, 2023

Conversation

FabianPonce
Copy link
Contributor

@FabianPonce FabianPonce commented Jun 15, 2023

Description

No retry logic on this resource results in sometimes intermittent errored runs.

Relations

Closes #29604.

References

Output from Acceptance Testing

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccEC2EIP_'  -timeout 180m
=== RUN   TestAccEC2EIP_basic
=== PAUSE TestAccEC2EIP_basic
=== RUN   TestAccEC2EIP_disappears
=== PAUSE TestAccEC2EIP_disappears
=== RUN   TestAccEC2EIP_migrateVPCToDomain
=== PAUSE TestAccEC2EIP_migrateVPCToDomain
=== RUN   TestAccEC2EIP_noVPC
=== PAUSE TestAccEC2EIP_noVPC
=== RUN   TestAccEC2EIP_tags
=== PAUSE TestAccEC2EIP_tags
=== RUN   TestAccEC2EIP_instance
=== PAUSE TestAccEC2EIP_instance
=== RUN   TestAccEC2EIP_Instance_reassociate
=== PAUSE TestAccEC2EIP_Instance_reassociate
=== RUN   TestAccEC2EIP_Instance_associatedUserPrivateIP
=== PAUSE TestAccEC2EIP_Instance_associatedUserPrivateIP
=== RUN   TestAccEC2EIP_Instance_notAssociated
=== PAUSE TestAccEC2EIP_Instance_notAssociated
=== RUN   TestAccEC2EIP_networkInterface
=== PAUSE TestAccEC2EIP_networkInterface
=== RUN   TestAccEC2EIP_NetworkInterface_twoEIPsOneInterface
=== PAUSE TestAccEC2EIP_NetworkInterface_twoEIPsOneInterface
=== RUN   TestAccEC2EIP_association
=== PAUSE TestAccEC2EIP_association
=== RUN   TestAccEC2EIP_PublicIPv4Pool_default
=== PAUSE TestAccEC2EIP_PublicIPv4Pool_default
=== RUN   TestAccEC2EIP_PublicIPv4Pool_custom
    ec2_eip_test.go:470: Environment variable AWS_EC2_EIP_PUBLIC_IPV4_POOL is not set
--- SKIP: TestAccEC2EIP_PublicIPv4Pool_custom (0.00s)
=== RUN   TestAccEC2EIP_customerOwnedIPv4Pool
=== PAUSE TestAccEC2EIP_customerOwnedIPv4Pool
=== RUN   TestAccEC2EIP_networkBorderGroup
=== PAUSE TestAccEC2EIP_networkBorderGroup
=== RUN   TestAccEC2EIP_carrierIP
=== PAUSE TestAccEC2EIP_carrierIP
=== RUN   TestAccEC2EIP_BYOIPAddress_default
=== PAUSE TestAccEC2EIP_BYOIPAddress_default
=== RUN   TestAccEC2EIP_BYOIPAddress_custom
    ec2_eip_test.go:617: Environment variable AWS_EC2_EIP_BYOIP_ADDRESS is not set
--- SKIP: TestAccEC2EIP_BYOIPAddress_custom (0.00s)
=== RUN   TestAccEC2EIP_BYOIPAddress_customWithPublicIPv4Pool
    ec2_eip_test.go:646: Environment variable AWS_EC2_EIP_BYOIP_ADDRESS is not set
--- SKIP: TestAccEC2EIP_BYOIPAddress_customWithPublicIPv4Pool (0.00s)
=== CONT  TestAccEC2EIP_basic
=== CONT  TestAccEC2EIP_networkInterface
=== CONT  TestAccEC2EIP_instance
=== CONT  TestAccEC2EIP_customerOwnedIPv4Pool
=== CONT  TestAccEC2EIP_NetworkInterface_twoEIPsOneInterface
=== CONT  TestAccEC2EIP_noVPC
=== CONT  TestAccEC2EIP_Instance_notAssociated
=== CONT  TestAccEC2EIP_BYOIPAddress_default
=== CONT  TestAccEC2EIP_association
=== CONT  TestAccEC2EIP_PublicIPv4Pool_default
=== CONT  TestAccEC2EIP_Instance_associatedUserPrivateIP
=== CONT  TestAccEC2EIP_Instance_reassociate
=== CONT  TestAccEC2EIP_tags
=== CONT  TestAccEC2EIP_networkBorderGroup
=== CONT  TestAccEC2EIP_migrateVPCToDomain
=== CONT  TestAccEC2EIP_disappears
=== CONT  TestAccEC2EIP_carrierIP
    wavelength_carrier_gateway_test.go:193: skipping since no Wavelength Zones are available
--- SKIP: TestAccEC2EIP_carrierIP (0.30s)
=== NAME  TestAccEC2EIP_customerOwnedIPv4Pool
    acctest.go:1061: skipping since no Outposts found
--- SKIP: TestAccEC2EIP_customerOwnedIPv4Pool (0.39s)
--- PASS: TestAccEC2EIP_disappears (18.87s)
--- PASS: TestAccEC2EIP_BYOIPAddress_default (20.35s)
--- PASS: TestAccEC2EIP_networkBorderGroup (23.00s)
--- PASS: TestAccEC2EIP_PublicIPv4Pool_default (24.00s)
--- PASS: TestAccEC2EIP_noVPC (24.28s)
--- PASS: TestAccEC2EIP_basic (24.29s)
=== NAME  TestAccEC2EIP_Instance_reassociate
    ec2_eip_test.go:219: Step 1/2 error: Check failed: Check 2/2 error: aws_eip.test: Attribute 'instance' expected "i-0eb7bc43fc81d0d83", got ""
--- PASS: TestAccEC2EIP_NetworkInterface_twoEIPsOneInterface (28.19s)
--- PASS: TestAccEC2EIP_migrateVPCToDomain (29.94s)
--- PASS: TestAccEC2EIP_networkInterface (31.86s)
--- PASS: TestAccEC2EIP_tags (43.74s)
--- PASS: TestAccEC2EIP_instance (80.71s)
--- PASS: TestAccEC2EIP_Instance_associatedUserPrivateIP (116.48s)
--- PASS: TestAccEC2EIP_Instance_notAssociated (123.96s)
--- PASS: TestAccEC2EIP_association (127.53s)
=== NAME  TestAccEC2EIP_Instance_reassociate
    testing_new.go:88: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: deleting EC2 Internet Gateway (igw-0e949f2aa8b80f122): detaching EC2 Internet Gateway (igw-0e949f2aa8b80f122) from VPC (vpc-0c0b57b6f7c3b353e): DependencyViolation: Network vpc-0c0b57b6f7c3b353e has some mapped public address(es). Please unmap those public address(es) before detaching the gateway.
        	status code: 400, request id: 1bbdc492-a562-42f2-87c8-eaedd01a507c
        
        
        Error: deleting EC2 EIP (eipalloc-036a42dd1eb120344): InvalidIPAddress.InUse: Address 18.204.85.245 is in use.
        	status code: 400, request id: fb160893-ce69-491c-bb9d-a87572a54340
        
--- FAIL: TestAccEC2EIP_Instance_reassociate (1229.50s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	1229.707s
FAIL
make: *** [testacc] Error 1

@github-actions
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 size/XS Managed by automation to categorize the size of a PR. service/ec2 Issues and PRs that pertain to the ec2 service. needs-triage Waiting for first response or review from a maintainer. labels Jun 15, 2023
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Jun 15, 2023
@ewbankkit ewbankkit added the eventual-consistency Pertains to eventual consistency issues. label Jun 16, 2023
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 🚀.

% make testacc TESTARGS='-run=TestAccEC2EIP_basic\|TestAccEC2EIP_disappears' PKG=ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20  -run=TestAccEC2EIP_basic\|TestAccEC2EIP_disappears -timeout 180m
=== RUN   TestAccEC2EIP_basic
=== PAUSE TestAccEC2EIP_basic
=== RUN   TestAccEC2EIP_disappears
=== PAUSE TestAccEC2EIP_disappears
=== CONT  TestAccEC2EIP_disappears
=== CONT  TestAccEC2EIP_basic
--- PASS: TestAccEC2EIP_disappears (18.99s)
--- PASS: TestAccEC2EIP_basic (24.57s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	30.269s

@ewbankkit
Copy link
Contributor

@FabianPonce Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 975c496 into hashicorp:main Jun 16, 2023
@github-actions github-actions bot added this to the v5.5.0 milestone Jun 16, 2023
@github-actions
Copy link

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

@github-actions
Copy link

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. eventual-consistency Pertains to eventual consistency issues. service/ec2 Issues and PRs that pertain to the ec2 service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] couldn't find EIP resource when create multiple EIPs at the same time with a output variable
3 participants