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

IPAM Pool CIDR Allocation Eventual Consistency #29022

Merged

Conversation

AdamTylerLynch
Copy link
Collaborator

@AdamTylerLynch AdamTylerLynch commented Jan 20, 2023

Description

IPAM's AllocateIpamPoolCidr is strongly consistent with respect to other calls to AllocateIpamPoolCidr. That means that IPAM will never hand out overlapping space, even IPAM recieves multiple calls to AllocateIpamPoolCidr simultaneously.

IPAM's GetIpamPoolAllocations os eventually consistent (read operastion), and results from GetIpamPoolAllocations might not always reflect the results of a recently completed operation.

  • Added waiters/status to accommodate for eventual consistency.
  • Added cross region AccTests
  • Merged in upstream Context changes

Relations

Closes #28913
Closes #25300
Closes #29045
Related #28955

Output from Acceptance Testing

$ ake testacc TESTS='TestAccIPAMPoolCIDRAllocation_' PKG=ec2 ACCTEST_PARALLELISM=1
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 1 -run='TestAccIPAMPoolCIDRAllocation_'  -timeout 180m
=== RUN   TestAccIPAMPoolCIDRAllocation_ipv4Basic
=== PAUSE TestAccIPAMPoolCIDRAllocation_ipv4Basic
=== RUN   TestAccIPAMPoolCIDRAllocation_disappears
=== PAUSE TestAccIPAMPoolCIDRAllocation_disappears
=== RUN   TestAccIPAMPoolCIDRAllocation_ipv4BasicNetmask
=== PAUSE TestAccIPAMPoolCIDRAllocation_ipv4BasicNetmask
=== RUN   TestAccIPAMPoolCIDRAllocation_ipv4DisallowedCIDR
=== PAUSE TestAccIPAMPoolCIDRAllocation_ipv4DisallowedCIDR
=== RUN   TestAccIPAMPoolCIDRAllocation_multiple
=== PAUSE TestAccIPAMPoolCIDRAllocation_multiple
=== RUN   TestAccIPAMPoolCIDRAllocation_differentRegion
=== PAUSE TestAccIPAMPoolCIDRAllocation_differentRegion
=== CONT  TestAccIPAMPoolCIDRAllocation_ipv4Basic
--- PASS: TestAccIPAMPoolCIDRAllocation_ipv4Basic (84.71s)
=== CONT  TestAccIPAMPoolCIDRAllocation_ipv4DisallowedCIDR
--- PASS: TestAccIPAMPoolCIDRAllocation_ipv4DisallowedCIDR (63.69s)
=== CONT  TestAccIPAMPoolCIDRAllocation_differentRegion
--- PASS: TestAccIPAMPoolCIDRAllocation_differentRegion (86.81s)
=== CONT  TestAccIPAMPoolCIDRAllocation_multiple
--- PASS: TestAccIPAMPoolCIDRAllocation_multiple (95.82s)
=== CONT  TestAccIPAMPoolCIDRAllocation_ipv4BasicNetmask
--- PASS: TestAccIPAMPoolCIDRAllocation_ipv4BasicNetmask (93.51s)
=== CONT  TestAccIPAMPoolCIDRAllocation_disappears
--- PASS: TestAccIPAMPoolCIDRAllocation_disappears (85.44s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	515.684s

@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 needs-triage Waiting for first response or review from a maintainer. service/ipam Issues and PRs that pertain to the ipam service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/M Managed by automation to categorize the size of a PR. and removed tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/ipam Issues and PRs that pertain to the ipam service. labels Jan 20, 2023
@github-actions github-actions bot added size/L Managed by automation to categorize the size of a PR. service/ipam Issues and PRs that pertain to the ipam service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. and removed size/M Managed by automation to categorize the size of a PR. labels Jan 20, 2023
@AdamTylerLynch
Copy link
Collaborator Author

Regarding failing Semgrep Checks, the constant I added aligns to the existing constants in the AWS Go SDK. I chose SDK alignment over preference.

@jar-b jar-b removed the needs-triage Waiting for first response or review from a maintainer. label Jan 23, 2023
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=TestAccIPAMPoolCIDRAllocation_ ACCTEST_PARALLELISM=1
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 1 -run='TestAccIPAMPoolCIDRAllocation_'  -timeout 180m
=== RUN   TestAccIPAMPoolCIDRAllocation_ipv4Basic
=== PAUSE TestAccIPAMPoolCIDRAllocation_ipv4Basic
=== RUN   TestAccIPAMPoolCIDRAllocation_disappears
=== PAUSE TestAccIPAMPoolCIDRAllocation_disappears
=== RUN   TestAccIPAMPoolCIDRAllocation_ipv4BasicNetmask
=== PAUSE TestAccIPAMPoolCIDRAllocation_ipv4BasicNetmask
=== RUN   TestAccIPAMPoolCIDRAllocation_ipv4DisallowedCIDR
=== PAUSE TestAccIPAMPoolCIDRAllocation_ipv4DisallowedCIDR
=== RUN   TestAccIPAMPoolCIDRAllocation_multiple
=== PAUSE TestAccIPAMPoolCIDRAllocation_multiple
=== RUN   TestAccIPAMPoolCIDRAllocation_differentRegion
=== PAUSE TestAccIPAMPoolCIDRAllocation_differentRegion
=== CONT  TestAccIPAMPoolCIDRAllocation_ipv4Basic
--- PASS: TestAccIPAMPoolCIDRAllocation_ipv4Basic (70.33s)
=== CONT  TestAccIPAMPoolCIDRAllocation_ipv4DisallowedCIDR
--- PASS: TestAccIPAMPoolCIDRAllocation_ipv4DisallowedCIDR (60.26s)
=== CONT  TestAccIPAMPoolCIDRAllocation_differentRegion
--- PASS: TestAccIPAMPoolCIDRAllocation_differentRegion (79.94s)
=== CONT  TestAccIPAMPoolCIDRAllocation_multiple
--- PASS: TestAccIPAMPoolCIDRAllocation_multiple (71.03s)
=== CONT  TestAccIPAMPoolCIDRAllocation_ipv4BasicNetmask
--- PASS: TestAccIPAMPoolCIDRAllocation_ipv4BasicNetmask (59.71s)
=== CONT  TestAccIPAMPoolCIDRAllocation_disappears
--- PASS: TestAccIPAMPoolCIDRAllocation_disappears (88.24s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ec2        432.489s

@github-actions
Copy link

This functionality has been released in v4.52.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 Feb 27, 2023
@justinretzolk justinretzolk added the partner Contribution from a partner. label May 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
partner Contribution from a partner. service/ipam Issues and PRs that pertain to the ipam service. size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
3 participants