-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
Add a subnet CIDR reservation resource #22051
Conversation
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.
Welcome @georgebuckerfield 👋
It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.
Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.
Thanks again, and welcome to the community! 😃
This adds a resource - aws_subnet_cidr_reservation - which manages CIDR reservations in subnets.
70f6d4d
to
0378bf0
Compare
@georgebuckerfield Thanks for the contribution. |
Is this PR still in draft or is it ready to be reviewed and merged? |
… to match naming guidelines
1a9f8ec
to
f99a19d
Compare
I think it's ready for a review now. I haven't added a docs page for it yet - but I should be able to get to that today. |
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
Adding documentation will fix the Tests are passing: % make testacc TESTS=TestAccEC2SubnetCidrReservation_ PKG=ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccEC2SubnetCidrReservation_' -timeout 180m
=== RUN TestAccEC2SubnetCidrReservation_basic
=== PAUSE TestAccEC2SubnetCidrReservation_basic
=== RUN TestAccEC2SubnetCidrReservation_Ipv6
=== PAUSE TestAccEC2SubnetCidrReservation_Ipv6
=== RUN TestAccEC2SubnetCidrReservation_disappears
=== PAUSE TestAccEC2SubnetCidrReservation_disappears
=== CONT TestAccEC2SubnetCidrReservation_basic
=== CONT TestAccEC2SubnetCidrReservation_disappears
=== CONT TestAccEC2SubnetCidrReservation_Ipv6
--- PASS: TestAccEC2SubnetCidrReservation_disappears (27.47s)
--- PASS: TestAccEC2SubnetCidrReservation_basic (29.55s)
--- PASS: TestAccEC2SubnetCidrReservation_Ipv6 (29.71s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 33.743s @georgebuckerfield If you can add a documentation page then I can complete the review. |
Thanks for the review @ewbankkit - I've just added a doc page, and am working on addressing your other comments. |
Acceptance test output: % make testacc TESTS=TestAccEC2SubnetCidrReservation_ PKG=ec2 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccEC2SubnetCidrReservation_' -timeout 180m === RUN TestAccEC2SubnetCidrReservation_basic === PAUSE TestAccEC2SubnetCidrReservation_basic === RUN TestAccEC2SubnetCidrReservation_ipv6 === PAUSE TestAccEC2SubnetCidrReservation_ipv6 === RUN TestAccEC2SubnetCidrReservation_disappears === PAUSE TestAccEC2SubnetCidrReservation_disappears === CONT TestAccEC2SubnetCidrReservation_basic === CONT TestAccEC2SubnetCidrReservation_disappears === CONT TestAccEC2SubnetCidrReservation_ipv6 --- PASS: TestAccEC2SubnetCidrReservation_disappears (23.80s) --- PASS: TestAccEC2SubnetCidrReservation_basic (26.04s) --- PASS: TestAccEC2SubnetCidrReservation_ipv6 (27.04s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 30.710s
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 🚀.
Commercial
% make testacc TESTS=TestAccEC2SubnetCidrReservation_ PKG=ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccEC2SubnetCidrReservation_' -timeout 180m
=== RUN TestAccEC2SubnetCidrReservation_basic
=== PAUSE TestAccEC2SubnetCidrReservation_basic
=== RUN TestAccEC2SubnetCidrReservation_ipv6
=== PAUSE TestAccEC2SubnetCidrReservation_ipv6
=== RUN TestAccEC2SubnetCidrReservation_disappears
=== PAUSE TestAccEC2SubnetCidrReservation_disappears
=== CONT TestAccEC2SubnetCidrReservation_basic
=== CONT TestAccEC2SubnetCidrReservation_disappears
=== CONT TestAccEC2SubnetCidrReservation_ipv6
--- PASS: TestAccEC2SubnetCidrReservation_disappears (23.80s)
--- PASS: TestAccEC2SubnetCidrReservation_basic (26.04s)
--- PASS: TestAccEC2SubnetCidrReservation_ipv6 (27.04s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 30.710s
GovCloud
% make testacc TESTS=TestAccEC2SubnetCidrReservation_ PKG=ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccEC2SubnetCidrReservation_' -timeout 180m
=== RUN TestAccEC2SubnetCidrReservation_basic
=== PAUSE TestAccEC2SubnetCidrReservation_basic
=== RUN TestAccEC2SubnetCidrReservation_ipv6
=== PAUSE TestAccEC2SubnetCidrReservation_ipv6
=== RUN TestAccEC2SubnetCidrReservation_disappears
=== PAUSE TestAccEC2SubnetCidrReservation_disappears
=== CONT TestAccEC2SubnetCidrReservation_basic
=== CONT TestAccEC2SubnetCidrReservation_disappears
=== CONT TestAccEC2SubnetCidrReservation_ipv6
--- PASS: TestAccEC2SubnetCidrReservation_disappears (29.95s)
--- PASS: TestAccEC2SubnetCidrReservation_basic (32.99s)
--- PASS: TestAccEC2SubnetCidrReservation_ipv6 (33.52s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 36.952s
This functionality has been released in v3.69.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! |
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. |
This adds a resource -
aws_subnet_cidr_reservation
- which manages CIDR reservations in subnets.Unfortunately there is no way to retrieve information about a reservation using it's ID - I can't find any other way to do it than retrieve all reservations for a subnet and then loop through them (the filters suggested in the API docs don't work at all either from what I can tell). I have also not implemented tags - again the API docs seem to be wrong here.
Community Note
Closes #21897
Output from acceptance testing: