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

Add secondary IPs to AWS NAT Gateway #31778

Merged
merged 51 commits into from
Jul 24, 2023

Conversation

bschaatsbergen
Copy link
Member

@bschaatsbergen bschaatsbergen commented Jun 5, 2023

Description

Note: the secondary IP related properties are not returned by the API, resulting in being unable to import these specific arguments.

Relations

Closes #31229.
Closes #29471.

References

Output from Acceptance Testing

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

@github-actions
Copy link

github-actions bot commented Jun 5, 2023

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/vpc Issues and PRs that pertain to the vpc 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. needs-triage Waiting for first response or review from a maintainer. labels Jun 5, 2023
@github-actions github-actions bot added size/L Managed by automation to categorize the size of a PR. and removed size/M Managed by automation to categorize the size of a PR. labels Jun 5, 2023
@github-actions github-actions bot added the documentation Introduces or discusses updates to documentation. label Jun 6, 2023
@bschaatsbergen bschaatsbergen changed the title Add multiple Elastic IPs to AWS NAT Gateway Add secondary IPs to AWS NAT Gateway Jun 6, 2023
@bschaatsbergen bschaatsbergen marked this pull request as ready for review June 7, 2023 09:09
@justinretzolk justinretzolk added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Jun 7, 2023
% make testacc TESTARGS='-run=TestAccVPCNATGateway_' PKG=ec2 ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 2  -run=TestAccVPCNATGateway_ -timeout 180m
=== RUN   TestAccVPCNATGateway_basic
=== PAUSE TestAccVPCNATGateway_basic
=== RUN   TestAccVPCNATGateway_disappears
=== PAUSE TestAccVPCNATGateway_disappears
=== RUN   TestAccVPCNATGateway_ConnectivityType_private
=== PAUSE TestAccVPCNATGateway_ConnectivityType_private
=== RUN   TestAccVPCNATGateway_privateIP
=== PAUSE TestAccVPCNATGateway_privateIP
=== RUN   TestAccVPCNATGateway_tags
=== PAUSE TestAccVPCNATGateway_tags
=== RUN   TestAccVPCNATGateway_secondaryAllocationIDs
=== PAUSE TestAccVPCNATGateway_secondaryAllocationIDs
=== RUN   TestAccVPCNATGateway_secondaryPrivateIPAddressCount
=== PAUSE TestAccVPCNATGateway_secondaryPrivateIPAddressCount
=== RUN   TestAccVPCNATGateway_secondaryPrivateIPAddresses
=== PAUSE TestAccVPCNATGateway_secondaryPrivateIPAddresses
=== RUN   TestAccVPCNATGateway_secondaryPrivateIPAddresses_private
=== PAUSE TestAccVPCNATGateway_secondaryPrivateIPAddresses_private
=== CONT  TestAccVPCNATGateway_basic
=== CONT  TestAccVPCNATGateway_secondaryAllocationIDs
--- PASS: TestAccVPCNATGateway_secondaryAllocationIDs (187.97s)
=== CONT  TestAccVPCNATGateway_privateIP
--- PASS: TestAccVPCNATGateway_basic (208.10s)
=== CONT  TestAccVPCNATGateway_tags
--- PASS: TestAccVPCNATGateway_privateIP (184.94s)
=== CONT  TestAccVPCNATGateway_secondaryPrivateIPAddresses
--- PASS: TestAccVPCNATGateway_tags (251.45s)
=== CONT  TestAccVPCNATGateway_secondaryPrivateIPAddresses_private
--- PASS: TestAccVPCNATGateway_secondaryPrivateIPAddresses (214.11s)
=== CONT  TestAccVPCNATGateway_ConnectivityType_private
--- PASS: TestAccVPCNATGateway_secondaryPrivateIPAddresses_private (184.36s)
=== CONT  TestAccVPCNATGateway_secondaryPrivateIPAddressCount
--- PASS: TestAccVPCNATGateway_ConnectivityType_private (195.39s)
=== CONT  TestAccVPCNATGateway_disappears
--- PASS: TestAccVPCNATGateway_secondaryPrivateIPAddressCount (184.20s)
--- PASS: TestAccVPCNATGateway_disappears (202.03s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	989.785s
…s_count' and 'secondary_private_ip_addresses'.
% make testacc TESTARGS='-run=TestAccVPCNATGateway_' PKG=ec2 ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 2  -run=TestAccVPCNATGateway_ -timeout 180m
=== RUN   TestAccVPCNATGateway_basic
=== PAUSE TestAccVPCNATGateway_basic
=== RUN   TestAccVPCNATGateway_disappears
=== PAUSE TestAccVPCNATGateway_disappears
=== RUN   TestAccVPCNATGateway_ConnectivityType_private
=== PAUSE TestAccVPCNATGateway_ConnectivityType_private
=== RUN   TestAccVPCNATGateway_privateIP
=== PAUSE TestAccVPCNATGateway_privateIP
=== RUN   TestAccVPCNATGateway_tags
=== PAUSE TestAccVPCNATGateway_tags
=== RUN   TestAccVPCNATGateway_secondaryAllocationIDs
=== PAUSE TestAccVPCNATGateway_secondaryAllocationIDs
=== RUN   TestAccVPCNATGateway_secondaryPrivateIPAddressCount
=== PAUSE TestAccVPCNATGateway_secondaryPrivateIPAddressCount
=== RUN   TestAccVPCNATGateway_secondaryPrivateIPAddresses
=== PAUSE TestAccVPCNATGateway_secondaryPrivateIPAddresses
=== RUN   TestAccVPCNATGateway_secondaryPrivateIPAddresses_private
=== PAUSE TestAccVPCNATGateway_secondaryPrivateIPAddresses_private
=== CONT  TestAccVPCNATGateway_basic
=== CONT  TestAccVPCNATGateway_secondaryAllocationIDs
=== CONT  TestAccVPCNATGateway_privateIP
--- PASS: TestAccVPCNATGateway_secondaryAllocationIDs (180.27s)
--- PASS: TestAccVPCNATGateway_basic (222.46s)
=== CONT  TestAccVPCNATGateway_tags
--- PASS: TestAccVPCNATGateway_privateIP (186.85s)
=== CONT  TestAccVPCNATGateway_secondaryPrivateIPAddresses
--- PASS: TestAccVPCNATGateway_tags (245.10s)
=== CONT  TestAccVPCNATGateway_secondaryPrivateIPAddresses_private
--- PASS: TestAccVPCNATGateway_secondaryPrivateIPAddresses (176.31s)
=== CONT  TestAccVPCNATGateway_secondaryPrivateIPAddressCount
--- PASS: TestAccVPCNATGateway_secondaryPrivateIPAddresses_private (185.50s)
=== CONT  TestAccVPCNATGateway_ConnectivityType_private
--- PASS: TestAccVPCNATGateway_secondaryPrivateIPAddressCount (194.98s)
=== CONT  TestAccVPCNATGateway_disappears
--- PASS: TestAccVPCNATGateway_ConnectivityType_private (166.34s)
--- PASS: TestAccVPCNATGateway_disappears (191.68s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	935.476s
…_ip_address_count' and 'secondary_private_ip_addresses' in Read.

Acceptance test output:

% make testacc TESTARGS='-run=TestAccVPCNATGateway_' PKG=ec2 ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 2  -run=TestAccVPCNATGateway_ -timeout 180m
=== RUN   TestAccVPCNATGateway_basic
=== PAUSE TestAccVPCNATGateway_basic
=== RUN   TestAccVPCNATGateway_disappears
=== PAUSE TestAccVPCNATGateway_disappears
=== RUN   TestAccVPCNATGateway_ConnectivityType_private
=== PAUSE TestAccVPCNATGateway_ConnectivityType_private
=== RUN   TestAccVPCNATGateway_privateIP
=== PAUSE TestAccVPCNATGateway_privateIP
=== RUN   TestAccVPCNATGateway_tags
=== PAUSE TestAccVPCNATGateway_tags
=== RUN   TestAccVPCNATGateway_secondaryAllocationIDs
=== PAUSE TestAccVPCNATGateway_secondaryAllocationIDs
=== RUN   TestAccVPCNATGateway_secondaryPrivateIPAddressCount
=== PAUSE TestAccVPCNATGateway_secondaryPrivateIPAddressCount
=== RUN   TestAccVPCNATGateway_secondaryPrivateIPAddresses
=== PAUSE TestAccVPCNATGateway_secondaryPrivateIPAddresses
=== RUN   TestAccVPCNATGateway_SecondaryPrivateIPAddresses_private
=== PAUSE TestAccVPCNATGateway_SecondaryPrivateIPAddresses_private
=== CONT  TestAccVPCNATGateway_basic
=== CONT  TestAccVPCNATGateway_secondaryAllocationIDs
--- PASS: TestAccVPCNATGateway_basic (185.18s)
=== CONT  TestAccVPCNATGateway_privateIP
--- PASS: TestAccVPCNATGateway_secondaryAllocationIDs (226.54s)
=== CONT  TestAccVPCNATGateway_tags
--- PASS: TestAccVPCNATGateway_privateIP (185.82s)
=== CONT  TestAccVPCNATGateway_ConnectivityType_private
--- PASS: TestAccVPCNATGateway_tags (222.04s)
=== CONT  TestAccVPCNATGateway_secondaryPrivateIPAddresses
--- PASS: TestAccVPCNATGateway_ConnectivityType_private (205.70s)
=== CONT  TestAccVPCNATGateway_SecondaryPrivateIPAddresses_private
--- PASS: TestAccVPCNATGateway_secondaryPrivateIPAddresses (193.93s)
=== CONT  TestAccVPCNATGateway_secondaryPrivateIPAddressCount
=== CONT  TestAccVPCNATGateway_disappears
--- PASS: TestAccVPCNATGateway_SecondaryPrivateIPAddresses_private (183.43s)
--- PASS: TestAccVPCNATGateway_secondaryPrivateIPAddressCount (205.40s)
--- PASS: TestAccVPCNATGateway_disappears (211.69s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	976.318s
% make testacc TESTARGS='-run=TestAccVPCNATGateway_SecondaryPrivateIPAddresses_private' PKG=ec2 ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 2  -run=TestAccVPCNATGateway_SecondaryPrivateIPAddresses_private -timeout 180m
=== RUN   TestAccVPCNATGateway_SecondaryPrivateIPAddresses_private
=== PAUSE TestAccVPCNATGateway_SecondaryPrivateIPAddresses_private
=== CONT  TestAccVPCNATGateway_SecondaryPrivateIPAddresses_private
--- PASS: TestAccVPCNATGateway_SecondaryPrivateIPAddresses_private (589.69s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	594.841s
@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. and removed size/L Managed by automation to categorize the size of a PR. labels Jul 21, 2023
…ewayIDAndAllocationID' and 'FindNATGatewayAddressByNATGatewayIDAndPrivateIP'.
… NAT Gateways.

Acceptance test output:

 make testacc TESTARGS='-run=TestAccVPCNATGateway_secondaryAllocationIDs' PKG=ec2 ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 2  -run=TestAccVPCNATGateway_secondaryAllocationIDs -timeout 180m
=== RUN   TestAccVPCNATGateway_secondaryAllocationIDs
=== PAUSE TestAccVPCNATGateway_secondaryAllocationIDs
=== CONT  TestAccVPCNATGateway_secondaryAllocationIDs
--- PASS: TestAccVPCNATGateway_secondaryAllocationIDs (546.68s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	551.395s
…public NAT Gateways.

Acceptance test output:

% make testacc TESTARGS='-run=TestAccVPCNATGateway_secondaryPrivateIPAddresses' PKG=ec2 ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 2  -run=TestAccVPCNATGateway_secondaryPrivateIPAddresses -timeout 180m
=== RUN   TestAccVPCNATGateway_secondaryPrivateIPAddresses
=== PAUSE TestAccVPCNATGateway_secondaryPrivateIPAddresses
=== CONT  TestAccVPCNATGateway_secondaryPrivateIPAddresses
--- PASS: TestAccVPCNATGateway_secondaryPrivateIPAddresses (609.02s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	614.207s
…_ip_addresses' and 'secondary_private_ip_address_count' attributes.

Acceptance test output:

% make testacc TESTARGS='-run=TestAccVPCNATGatewayDataSource_' PKG=ec2 ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 2  -run=TestAccVPCNATGatewayDataSource_ -timeout 180m
=== RUN   TestAccVPCNATGatewayDataSource_basic
=== PAUSE TestAccVPCNATGatewayDataSource_basic
=== CONT  TestAccVPCNATGatewayDataSource_basic
--- PASS: TestAccVPCNATGatewayDataSource_basic (213.95s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	218.773s
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=TestAccVPCNATGatewayDataSource_' PKG=ec2 ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 2  -run=TestAccVPCNATGatewayDataSource_ -timeout 180m
=== RUN   TestAccVPCNATGatewayDataSource_basic
=== PAUSE TestAccVPCNATGatewayDataSource_basic
=== CONT  TestAccVPCNATGatewayDataSource_basic
--- PASS: TestAccVPCNATGatewayDataSource_basic (213.95s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	218.773s
% make testacc TESTARGS='-run=TestAccVPCNATGateway_' PKG=ec2 ACCTEST_PARALLELISM=2 
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 2  -run=TestAccVPCNATGateway_ -timeout 180m
=== RUN   TestAccVPCNATGateway_basic
=== PAUSE TestAccVPCNATGateway_basic
=== RUN   TestAccVPCNATGateway_disappears
=== PAUSE TestAccVPCNATGateway_disappears
=== RUN   TestAccVPCNATGateway_ConnectivityType_private
=== PAUSE TestAccVPCNATGateway_ConnectivityType_private
=== RUN   TestAccVPCNATGateway_privateIP
=== PAUSE TestAccVPCNATGateway_privateIP
=== RUN   TestAccVPCNATGateway_tags
=== PAUSE TestAccVPCNATGateway_tags
=== RUN   TestAccVPCNATGateway_secondaryAllocationIDs
=== PAUSE TestAccVPCNATGateway_secondaryAllocationIDs
=== RUN   TestAccVPCNATGateway_secondaryPrivateIPAddressCount
=== PAUSE TestAccVPCNATGateway_secondaryPrivateIPAddressCount
=== RUN   TestAccVPCNATGateway_secondaryPrivateIPAddresses
=== PAUSE TestAccVPCNATGateway_secondaryPrivateIPAddresses
=== RUN   TestAccVPCNATGateway_SecondaryPrivateIPAddresses_private
=== PAUSE TestAccVPCNATGateway_SecondaryPrivateIPAddresses_private
=== CONT  TestAccVPCNATGateway_basic
=== CONT  TestAccVPCNATGateway_secondaryAllocationIDs
--- PASS: TestAccVPCNATGateway_basic (229.49s)
=== CONT  TestAccVPCNATGateway_privateIP
--- PASS: TestAccVPCNATGateway_privateIP (205.65s)
=== CONT  TestAccVPCNATGateway_tags
--- PASS: TestAccVPCNATGateway_secondaryAllocationIDs (544.29s)
=== CONT  TestAccVPCNATGateway_secondaryPrivateIPAddresses
--- PASS: TestAccVPCNATGateway_tags (241.03s)
=== CONT  TestAccVPCNATGateway_SecondaryPrivateIPAddresses_private
--- PASS: TestAccVPCNATGateway_secondaryPrivateIPAddresses (535.22s)
=== CONT  TestAccVPCNATGateway_ConnectivityType_private
--- PASS: TestAccVPCNATGateway_ConnectivityType_private (216.14s)
=== CONT  TestAccVPCNATGateway_disappears
--- PASS: TestAccVPCNATGateway_SecondaryPrivateIPAddresses_private (629.49s)
=== CONT  TestAccVPCNATGateway_secondaryPrivateIPAddressCount
--- PASS: TestAccVPCNATGateway_disappears (180.62s)
--- PASS: TestAccVPCNATGateway_secondaryPrivateIPAddressCount (183.41s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	1494.269s

@ewbankkit
Copy link
Contributor

@bschaatsbergen @FabianPonce Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 9bfe243 into hashicorp:main Jul 24, 2023
@github-actions github-actions bot added this to the v5.10.0 milestone Jul 24, 2023
@bschaatsbergen bschaatsbergen deleted the add-secondary-eips-to-nat branch July 25, 2023 07:30
@AladinZaier
Copy link

Thank you for your contributions @bschaatsbergen @FabianPonce 🎉 👏 Keep being awesome

@bschaatsbergen
Copy link
Member Author

Thank you for your contributions @bschaatsbergen @FabianPonce 🎉 👏 Keep being awesome

With pleasure @AladinZaier !

@github-actions
Copy link

This functionality has been released in v5.10.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 Aug 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/vpc Issues and PRs that pertain to the vpc service. size/XL 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
7 participants