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

Fixes aws_subnet on creation improperly handling IPv6 CIDR pending association state #24685

Merged
merged 5 commits into from
May 6, 2022

Conversation

moses-aronov
Copy link

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #24681

Output from acceptance testing:

$ TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 2 -run=TestAccVPCSubnet -timeout 180m                                                                                                                                                                                                                   
=== RUN   TestAccVPCSubnetCIDRReservation_basic
=== PAUSE TestAccVPCSubnetCIDRReservation_basic
=== RUN   TestAccVPCSubnetCIDRReservation_ipv6
=== PAUSE TestAccVPCSubnetCIDRReservation_ipv6
=== RUN   TestAccVPCSubnetCIDRReservation_disappears
=== PAUSE TestAccVPCSubnetCIDRReservation_disappears
=== RUN   TestAccVPCSubnetDataSource_basic
=== PAUSE TestAccVPCSubnetDataSource_basic
=== RUN   TestAccVPCSubnetDataSource_ipv6ByIPv6Filter
=== PAUSE TestAccVPCSubnetDataSource_ipv6ByIPv6Filter
=== RUN   TestAccVPCSubnetDataSource_ipv6ByIPv6CIDRBlock
=== PAUSE TestAccVPCSubnetDataSource_ipv6ByIPv6CIDRBlock
=== RUN   TestAccVPCSubnetIDsDataSource_basic
=== PAUSE TestAccVPCSubnetIDsDataSource_basic
=== RUN   TestAccVPCSubnetIDsDataSource_filter
=== PAUSE TestAccVPCSubnetIDsDataSource_filter
=== RUN   TestAccVPCSubnet_basic
=== PAUSE TestAccVPCSubnet_basic
=== RUN   TestAccVPCSubnet_tags
=== PAUSE TestAccVPCSubnet_tags
=== RUN   TestAccVPCSubnet_DefaultTags_providerOnly
=== PAUSE TestAccVPCSubnet_DefaultTags_providerOnly
=== RUN   TestAccVPCSubnet_DefaultTags_updateToProviderOnly
=== PAUSE TestAccVPCSubnet_DefaultTags_updateToProviderOnly
=== RUN   TestAccVPCSubnet_DefaultTags_updateToResourceOnly
=== PAUSE TestAccVPCSubnet_DefaultTags_updateToResourceOnly
=== RUN   TestAccVPCSubnet_DefaultTagsProviderAndResource_nonOverlappingTag
=== PAUSE TestAccVPCSubnet_DefaultTagsProviderAndResource_nonOverlappingTag
=== RUN   TestAccVPCSubnet_DefaultTagsProviderAndResource_overlappingTag
=== PAUSE TestAccVPCSubnet_DefaultTagsProviderAndResource_overlappingTag
=== RUN   TestAccVPCSubnet_DefaultTagsProviderAndResource_duplicateTag
=== PAUSE TestAccVPCSubnet_DefaultTagsProviderAndResource_duplicateTag
=== RUN   TestAccVPCSubnet_defaultAndIgnoreTags
=== PAUSE TestAccVPCSubnet_defaultAndIgnoreTags
=== RUN   TestAccVPCSubnet_updateTagsKnownAtApply
=== PAUSE TestAccVPCSubnet_updateTagsKnownAtApply
=== RUN   TestAccVPCSubnet_ignoreTags
=== PAUSE TestAccVPCSubnet_ignoreTags
=== RUN   TestAccVPCSubnet_ipv6
=== PAUSE TestAccVPCSubnet_ipv6
=== RUN   TestAccVPCSubnet_enableIPv6
=== PAUSE TestAccVPCSubnet_enableIPv6
=== RUN   TestAccVPCSubnet_availabilityZoneID
=== PAUSE TestAccVPCSubnet_availabilityZoneID
=== RUN   TestAccVPCSubnet_disappears
=== PAUSE TestAccVPCSubnet_disappears
=== RUN   TestAccVPCSubnet_customerOwnedIPv4Pool
=== PAUSE TestAccVPCSubnet_customerOwnedIPv4Pool
=== RUN   TestAccVPCSubnet_mapCustomerOwnedIPOnLaunch
=== PAUSE TestAccVPCSubnet_mapCustomerOwnedIPOnLaunch
=== RUN   TestAccVPCSubnet_mapPublicIPOnLaunch
=== PAUSE TestAccVPCSubnet_mapPublicIPOnLaunch
=== RUN   TestAccVPCSubnet_outpost
=== PAUSE TestAccVPCSubnet_outpost
=== RUN   TestAccVPCSubnet_enableDNS64
=== PAUSE TestAccVPCSubnet_enableDNS64
=== RUN   TestAccVPCSubnet_privateDnsNameOptionsOnLaunch
=== PAUSE TestAccVPCSubnet_privateDnsNameOptionsOnLaunch
=== RUN   TestAccVPCSubnet_ipv6Native
=== PAUSE TestAccVPCSubnet_ipv6Native
=== RUN   TestAccVPCSubnetsDataSource_basic
=== PAUSE TestAccVPCSubnetsDataSource_basic
=== RUN   TestAccVPCSubnetsDataSource_filter
=== PAUSE TestAccVPCSubnetsDataSource_filter
=== CONT  TestAccVPCSubnetCIDRReservation_basic
=== CONT  TestAccVPCSubnet_defaultAndIgnoreTags
--- PASS: TestAccVPCSubnetCIDRReservation_basic (21.81s)
=== CONT  TestAccVPCSubnet_basic
--- PASS: TestAccVPCSubnet_defaultAndIgnoreTags (40.66s)
=== CONT  TestAccVPCSubnet_DefaultTagsProviderAndResource_duplicateTag
--- PASS: TestAccVPCSubnet_basic (19.91s)
=== CONT  TestAccVPCSubnet_DefaultTagsProviderAndResource_overlappingTag
--- PASS: TestAccVPCSubnet_DefaultTagsProviderAndResource_duplicateTag (1.78s)
=== CONT  TestAccVPCSubnet_DefaultTagsProviderAndResource_nonOverlappingTag
--- PASS: TestAccVPCSubnet_DefaultTagsProviderAndResource_overlappingTag (47.77s)
=== CONT  TestAccVPCSubnet_DefaultTags_updateToResourceOnly
--- PASS: TestAccVPCSubnet_DefaultTagsProviderAndResource_nonOverlappingTag (47.18s)
=== CONT  TestAccVPCSubnet_DefaultTags_updateToProviderOnly
--- PASS: TestAccVPCSubnet_DefaultTags_updateToProviderOnly (31.59s)
=== CONT  TestAccVPCSubnet_DefaultTags_providerOnly
--- PASS: TestAccVPCSubnet_DefaultTags_updateToResourceOnly (32.71s)
=== CONT  TestAccVPCSubnet_tags
--- PASS: TestAccVPCSubnet_DefaultTags_providerOnly (39.08s)
=== CONT  TestAccVPCSubnetDataSource_ipv6ByIPv6Filter
--- PASS: TestAccVPCSubnet_tags (47.11s)
=== CONT  TestAccVPCSubnetIDsDataSource_filter
--- PASS: TestAccVPCSubnetIDsDataSource_filter (24.22s)
=== CONT  TestAccVPCSubnetIDsDataSource_basic
--- PASS: TestAccVPCSubnetDataSource_ipv6ByIPv6Filter (51.96s)
=== CONT  TestAccVPCSubnetDataSource_ipv6ByIPv6CIDRBlock
--- PASS: TestAccVPCSubnetIDsDataSource_basic (38.67s)
=== CONT  TestAccVPCSubnetCIDRReservation_disappears
--- PASS: TestAccVPCSubnetCIDRReservation_disappears (18.14s)
=== CONT  TestAccVPCSubnetDataSource_basic
--- PASS: TestAccVPCSubnetDataSource_ipv6ByIPv6CIDRBlock (41.87s)
=== CONT  TestAccVPCSubnetCIDRReservation_ipv6
--- PASS: TestAccVPCSubnetDataSource_basic (19.47s)
=== CONT  TestAccVPCSubnet_mapCustomerOwnedIPOnLaunch
    acctest.go:1308: skipping since no Outposts found
--- SKIP: TestAccVPCSubnet_mapCustomerOwnedIPOnLaunch (0.39s)
=== CONT  TestAccVPCSubnetsDataSource_filter
--- PASS: TestAccVPCSubnetCIDRReservation_ipv6 (32.06s)
=== CONT  TestAccVPCSubnetsDataSource_basic
--- PASS: TestAccVPCSubnetsDataSource_filter (20.67s)
=== CONT  TestAccVPCSubnet_ipv6Native
--- PASS: TestAccVPCSubnetsDataSource_basic (35.72s)
=== CONT  TestAccVPCSubnet_privateDnsNameOptionsOnLaunch
--- PASS: TestAccVPCSubnet_ipv6Native (32.42s)
=== CONT  TestAccVPCSubnet_enableDNS64
--- PASS: TestAccVPCSubnet_enableDNS64 (101.69s)
=== CONT  TestAccVPCSubnet_outpost
    acctest.go:1308: skipping since no Outposts found
--- SKIP: TestAccVPCSubnet_outpost (0.36s)
=== CONT  TestAccVPCSubnet_mapPublicIPOnLaunch
--- PASS: TestAccVPCSubnet_privateDnsNameOptionsOnLaunch (154.24s)
=== CONT  TestAccVPCSubnet_enableIPv6
--- PASS: TestAccVPCSubnet_mapPublicIPOnLaunch (80.72s)
=== CONT  TestAccVPCSubnet_customerOwnedIPv4Pool
    acctest.go:1308: skipping since no Outposts found
--- SKIP: TestAccVPCSubnet_customerOwnedIPv4Pool (0.42s)
=== CONT  TestAccVPCSubnet_disappears
--- PASS: TestAccVPCSubnet_disappears (18.49s)
=== CONT  TestAccVPCSubnet_availabilityZoneID
--- PASS: TestAccVPCSubnet_availabilityZoneID (21.09s)
=== CONT  TestAccVPCSubnet_ignoreTags
--- PASS: TestAccVPCSubnet_enableIPv6 (83.05s)
=== CONT  TestAccVPCSubnet_ipv6
--- PASS: TestAccVPCSubnet_ignoreTags (40.29s)
=== CONT  TestAccVPCSubnet_updateTagsKnownAtApply
--- PASS: TestAccVPCSubnet_updateTagsKnownAtApply (41.18s)
--- PASS: TestAccVPCSubnet_ipv6 (80.92s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ec2        640.409s
$ make testacc TESTS=TestAccVPCSubnet PKG=ec2

...

@github-actions github-actions bot added service/vpc Issues and PRs that pertain to the vpc service. size/XS Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. labels May 6, 2022
@moses-aronov moses-aronov changed the title [WIP]: add state refresh to block association [WIP]: fixes aws_subnet on creation improperly handling IPv6 CIDR pending association state May 6, 2022
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome @moses-aronov 👋

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! 😃

@moses-aronov moses-aronov changed the title [WIP]: fixes aws_subnet on creation improperly handling IPv6 CIDR pending association state Fixes aws_subnet on creation improperly handling IPv6 CIDR pending association state May 6, 2022
@moses-aronov
Copy link
Author

Ready for review.

@ewbankkit ewbankkit added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels May 6, 2022
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=TestAccVPCSubnet_ipv6\|TestAccVPCDefaultVPCAndSubnet_serial/Subnet/existing.ipv6' PKG=ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20  -run=TestAccVPCSubnet_ipv6\|TestAccVPCDefaultVPCAndSubnet_serial/Subnet/existing.ipv6 -timeout 180m
=== RUN   TestAccVPCDefaultVPCAndSubnet_serial
=== RUN   TestAccVPCDefaultVPCAndSubnet_serial/Subnet
=== RUN   TestAccVPCDefaultVPCAndSubnet_serial/Subnet/existing.ipv6
    acctest.go:665: skipping tests; AWS_DEFAULT_REGION (us-west-2) not supported
--- PASS: TestAccVPCDefaultVPCAndSubnet_serial (1.00s)
    --- PASS: TestAccVPCDefaultVPCAndSubnet_serial/Subnet (1.00s)
        --- SKIP: TestAccVPCDefaultVPCAndSubnet_serial/Subnet/existing.ipv6 (1.00s)
=== RUN   TestAccVPCSubnet_ipv6
=== PAUSE TestAccVPCSubnet_ipv6
=== RUN   TestAccVPCSubnet_ipv6Native
=== PAUSE TestAccVPCSubnet_ipv6Native
=== CONT  TestAccVPCSubnet_ipv6
=== CONT  TestAccVPCSubnet_ipv6Native
--- PASS: TestAccVPCSubnet_ipv6Native (30.59s)
--- PASS: TestAccVPCSubnet_ipv6 (76.06s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	81.039s
% AWS_DEFAULT_REGION=us-east-2 make testacc TESTARGS='-run=TestAccVPCSubnet_ipv6\|TestAccVPCDefaultVPCAndSubnet_serial/Subnet/existing.ipv6' PKG=ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20  -run=TestAccVPCSubnet_ipv6\|TestAccVPCDefaultVPCAndSubnet_serial/Subnet/existing.ipv6 -timeout 180m
=== RUN   TestAccVPCDefaultVPCAndSubnet_serial
=== RUN   TestAccVPCDefaultVPCAndSubnet_serial/Subnet
=== RUN   TestAccVPCDefaultVPCAndSubnet_serial/Subnet/existing.ipv6
--- PASS: TestAccVPCDefaultVPCAndSubnet_serial (50.48s)
    --- PASS: TestAccVPCDefaultVPCAndSubnet_serial/Subnet (50.48s)
        --- PASS: TestAccVPCDefaultVPCAndSubnet_serial/Subnet/existing.ipv6 (50.48s)
=== RUN   TestAccVPCSubnet_ipv6
=== PAUSE TestAccVPCSubnet_ipv6
=== RUN   TestAccVPCSubnet_ipv6Native
=== PAUSE TestAccVPCSubnet_ipv6Native
=== CONT  TestAccVPCSubnet_ipv6
=== CONT  TestAccVPCSubnet_ipv6Native
--- PASS: TestAccVPCSubnet_ipv6Native (23.19s)
--- PASS: TestAccVPCSubnet_ipv6 (62.41s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	116.722s

@ewbankkit
Copy link
Contributor

@moses-aronov Thanks for the contribution 🎉 👏.
I made the same change for the aws_default_subnet resource.

@ewbankkit ewbankkit merged commit 0384cb0 into hashicorp:main May 6, 2022
@github-actions github-actions bot added this to the v4.14.0 milestone May 6, 2022
@github-actions
Copy link

This functionality has been released in v4.14.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 Jun 14, 2022
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. service/vpc Issues and PRs that pertain to the vpc 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.

aws_subnet on creation improperly handles IPv6 CIDR pending association state
2 participants