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 support for private_ip_list, private_ip_list_enabled, and ipv6 args #17846

Merged

Conversation

rick-masters
Copy link
Contributor

@rick-masters rick-masters commented Feb 26, 2021

Add support for private_ip_list, private_ip_list_enabled, ipv6_addresss_list, and ipv6_address_list_enabled.

NOTE: This PR cannot be merged until hashicorp/terraform-plugin-sdk#715 is resolved, possibly with PR hashicorp/terraform-plugin-sdk#715, along with updating the provider to use a fixed SDK version.

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: #169
Closes: #836
Closes: #1672
Closes: #9277
Closes: #10506
Closes: #10674
Closes: #14366
Relates #1490

Dev and Test Plan

Dev: Schema and mutual exclusion with old settings ✅
Dev: Change to order of list triggers reassigning IPs ✅
Dev: Change to first address of private_ip_list triggers new resource ✅
Dev: private_ips and private_ip_list updates after change of private_ips_count
Dev: private_ip_list and private_ips_count updates after change of private_ips
Dev: private_ips and private_ips_cpunt update after change of private_ip_list
Dev: Changing both private_ips and private_ips_count produces a sensible result ✅
Dev: IPv6 ✅
Dev: New interface with both private_ips and private_ips_count produces a sensible result ✅
Dev: Documentation ✅
Dev: New Acceptance tests ✅

Ran Existing Acceptance Tests:
TestAccENI* ✅
TestAccInstance* ✅
New Acceptance Tests:
TestAccAWSENI_PrivateIpsList ✅
TestAccAWSENI_PrivateIpsSet ✅

New test TestAccAWSENI_PrivateIpsList

Steps:

  • Build set incrementally in order (4 steps)
  • Change from set to list using same order
  • Change order of private_ip_list
  • Remove secondaries from end
  • Add secondaries to end
  • Add secondaries to middle
  • Remove secondaries from middle
  • Use count to add IPs
  • Change to specific list - forces new
  • Change first of private_ip_list - forces new
  • Change from list to set using same set

New test TestAccAWSENI_PrivateIpsSet

Steps:

  • Configuration with three private_ips
  • Change order of private_ips
  • Add secondaries to private_ips
  • Remove secondaries from private_ips
  • Remove primary
  • Use count to add IPs
  • Change list, retain primary
  • Add to secondaries
  • New list
  • Add secondaries

Output from Acceptance Testing

--- PASS: TestAccAWSInstanceDataSource_blockDeviceTags (67.87s)
--- PASS: TestAccAWSInstanceDataSource_basic (79.00s)
--- PASS: TestAccAWSInstance_rootInstanceStore (86.52s)
--- PASS: TestAccAWSInstanceDataSource_tags (87.59s)
--- PASS: TestAccAWSInstanceDataSource_keyPair (89.81s)
--- PASS: TestAccAWSInstanceDataSource_SecurityGroups (90.46s)
--- PASS: TestAccAWSInstanceDataSource_VPC (91.36s)
--- PASS: TestAccAWSInstanceDataSource_AzUserData (93.54s)
--- PASS: TestAccAWSInstanceDataSource_VPCSecurityGroups (94.15s)
--- PASS: TestAccAWSInstanceDataSource_gp2IopsDevice (99.92s)
--- PASS: TestAccAWSInstanceDataSource_metadataOptions (113.87s)
--- PASS: TestAccAWSInstanceDataSource_enclaveOptions (114.29s)
--- PASS: TestAccAWSInstanceDataSource_EbsBlockDevice_KmsKeyId (117.93s)
--- PASS: TestAccAWSInstanceDataSource_RootBlockDevice_KmsKeyId (122.05s)
--- PASS: TestAccAWSInstanceDataSource_blockDevices (123.26s)
--- PASS: TestAccAWSInstanceDataSource_gp3ThroughputDevice (124.08s)
--- PASS: TestAccAWSInstanceDataSource_getPasswordData_falseToTrue (147.24s)
--- PASS: TestAccAWSInstanceDataSource_getPasswordData_trueToFalse (180.91s)
--- PASS: TestAccAWSInstanceDataSource_rootInstanceStore (343.56s)
--- PASS: TestAccAWSInstanceDataSource_GetUserData_NoUserData (103.82s)
--- PASS: TestAccAWSInstanceDataSource_GetUserData (104.19s)
--- PASS: TestAccAWSInstanceDataSource_privateIP (184.24s)
--- PASS: TestAccAWSInstanceDataSource_VPCSecurityGroups (82.49s)
--- PASS: TestAccAWSInstanceDataSource_creditSpecification (195.14s)
--- PASS: TestAccAWSInstance_CreditSpecification_Empty_NonBurstable (113.66s)
--- PASS: TestAccAWSInstanceDataSource_secondaryPrivateIPs (175.67s)
--- PASS: TestAccAWSInstance_rootBlockDeviceMismatch (186.10s)
--- PASS: TestAccAWSInstance_CreditSpecification_UnspecifiedToEmpty_NonBurstable (317.66s)
--- PASS: TestAccAWSInstance_GP2WithIopsValue (12.27s)
--- PASS: TestAccAWSInstance_EbsBlockDevice_InvalidThroughputForVolumeType (14.27s)
--- PASS: TestAccAWSInstance_EbsBlockDevice_InvalidIopsForVolumeType (14.69s)
--- PASS: TestAccAWSInstance_disappears (65.89s)
--- PASS: TestAccAWSInstance_basic (82.82s)
--- PASS: TestAccAWSInstance_blockDevices (89.61s)
--- PASS: TestAccAWSInstance_EbsBlockDevice_KmsKeyArn (89.93s)
--- PASS: TestAccAWSInstance_GP2IopsDevice (94.58s)
--- PASS: TestAccAWSInstance_EbsRootDevice_ModifyDeleteOnTermination (95.32s)
--- PASS: TestAccAWSInstance_GP3RootBlockDevice (107.90s)
--- PASS: TestAccAWSInstance_EbsRootDevice_ModifyType (109.16s)
--- PASS: TestAccAWSInstance_EbsRootDevice_MultipleBlockDevices_ModifyDeleteOnTermination (109.53s)
--- PASS: TestAccAWSInstance_inDefaultVpcBySgId (110.38s)
--- PASS: TestAccAWSInstance_ipv6_supportAddressCountWithIpv4 (113.54s)
--- PASS: TestAccAWSInstance_ipv6_supportAddressCount (113.63s)
--- PASS: TestAccAWSInstance_Empty_PrivateIP (117.16s)
--- PASS: TestAccAWSInstance_EbsRootDevice_ModifyIOPS_Io2 (117.34s)
--- PASS: TestAccAWSInstance_EbsRootDevice_ModifyThroughput_Gp3 (121.45s)
--- PASS: TestAccAWSInstance_EbsRootDevice_ModifySize (125.35s)
--- PASS: TestAccAWSInstance_EbsRootDevice_ModifyIOPS_Io1 (129.76s)
--- PASS: TestAccAWSInstance_blockDeviceTags_ebsAndRoot (135.89s)
--- PASS: TestAccAWSInstance_EbsRootDevice_MultipleBlockDevices_ModifySize (136.10s)
--- PASS: TestAccAWSInstance_EbsRootDevice_ModifyAll (136.85s)
--- PASS: TestAccAWSInstance_getPasswordData_falseToTrue (152.31s)
--- PASS: TestAccAWSInstance_blockDeviceTags_volumeTags (161.06s)
--- PASS: TestAccAWSInstance_blockDeviceTags_withAttachedVolume (168.79s)
--- PASS: TestAccAWSInstance_getPasswordData_trueToFalse (189.29s)
--- PASS: TestAccAWSInstance_EbsRootDevice_basic (191.27s)
--- PASS: TestAccAWSInstance_EbsRootDevice_MultipleDynamicEBSBlockDevices (224.42s)
--- PASS: TestAccAWSInstance_hibernation (225.92s)
--- PASS: TestAccAWSInstance_RootBlockDevice_KmsKeyArn (70.92s)
--- PASS: TestAccAWSInstance_UserData_UnspecifiedToEmptyString (97.81s)
--- PASS: TestAccAWSInstance_UserData_EmptyStringToUnspecified (98.13s)
--- PASS: TestAccAWSInstance_NewNetworkInterface_PrivateIPAndSecondaryPrivateIPsUpdate (122.30s)
--- PASS: TestAccAWSInstance_NewNetworkInterface_EmptyPrivateIPAndSecondaryPrivateIPsUpdate (112.14s)
--- PASS: TestAccAWSInstance_NewNetworkInterface_EmptyPrivateIPAndSecondaryPrivateIPs (311.54s)
--- PASS: TestAccAWSInstance_addSecondaryInterface (160.88s)
--- PASS: TestAccAWSInstance_NewNetworkInterface_PrivateIPAndSecondaryPrivateIPs (323.41s)
--- PASS: TestAccAWSInstance_addSecurityGroupNetworkInterface (161.94s)
--- PASS: TestAccAWSInstance_NetworkInstanceRemovingAllSecurityGroups (120.85s)
--- PASS: TestAccAWSInstance_NetworkInstanceVPCSecurityGroupIDs (102.35s)
--- PASS: TestAccAWSInstance_NewNetworkInterface_PublicIPAndSecondaryPrivateIPs (359.28s)
--- PASS: TestAccAWSInstance_NetworkInstanceSecurityGroups (112.64s)
--- PASS: TestAccAWSInstance_associatePublic_defaultPrivate (113.49s)
--- PASS: TestAccAWSInstance_creditSpecificationT3_standardCpuCredits (133.47s)
--- PASS: TestAccAWSInstance_atLeastOneOtherEbsVolume (185.91s)
--- PASS: TestAccAWSInstance_creditSpecificationT3_updateCpuCredits (136.33s)
--- PASS: TestAccAWSInstance_creditSpecification_isNotAppliedToNonBurstable (133.47s)
--- PASS: TestAccAWSInstance_creditSpecificationT3_unlimitedCpuCredits (111.53s)
--- PASS: TestAccAWSInstance_creditSpecificationT3_unspecifiedDefaultsToUnlimited (309.37s)
--- PASS: TestAccAWSInstance_enclaveOptions (422.90s)
--- PASS: TestAccAWSInstance_associatePublic_overridePrivate (110.48s)
--- PASS: TestAccAWSInstance_associatePublic_overridePublic (102.40s)
--- PASS: TestAccAWSInstance_associatePublic_explicitPrivate (111.85s)
--- PASS: TestAccAWSInstance_associatePublic_defaultPublic (121.58s)
--- PASS: TestAccAWSInstance_associatePublic_explicitPublic (132.68s)
--- PASS: TestAccAWSInstance_ipv6_supportAddressCountWithIpv4 (112.95s)
--- PASS: TestAccAWSInstance_dedicatedInstance (124.43s)
--- PASS: TestAccAWSInstance_ipv6_supportAddressCount (111.70s)
--- PASS: TestAccAWSInstance_forceNewAndTagsDrift (175.10s)
--- PASS: TestAccAWSInstance_changeInstanceType (193.06s)
--- PASS: TestAccAWSInstance_associatePublicIPAndPrivateIP (118.39s)
--- PASS: TestAccAWSInstance_disableApiTermination (147.80s)
--- PASS: TestAccAWSInstance_ipv6AddressCountAndSingleAddressCausesError (19.62s)
--- PASS: TestAccAWSInstance_keyPairCheck (83.33s)
--- PASS: TestAccAWSInstance_inDefaultVpcBySgName (84.48s)
--- PASS: TestAccAWSInstance_withIamInstanceProfilePath (95.60s)
--- PASS: TestAccAWSInstance_noAMIEphemeralDevices (104.95s)
--- PASS: TestAccAWSInstance_withIamInstanceProfile (105.69s)
--- PASS: TestAccAWSInstance_tags (120.68s)
--- PASS: TestAccAWSInstance_instanceProfileChange (221.31s)
--- PASS: TestAccAWSInstancesDataSource_tags (324.12s)
--- PASS: TestAccAWSInstancesDataSource_basic (334.70s)
--- PASS: TestAccAWSInstancesDataSource_instanceStateNames (365.66s)
--- PASS: TestAccAWSInstance_ipv6_supportAddressCount (93.05s)
--- PASS: TestAccAWSInstance_userDataBase64 (95.58s)
--- PASS: TestAccAWSInstance_primaryNetworkInterface (114.99s)
--- PASS: TestAccAWSInstance_metadataOptions (138.04s)
--- PASS: TestAccAWSInstance_placementGroup (63.39s)
--- PASS: TestAccAWSInstance_privateIP (94.85s)
--- PASS: TestAccAWSInstance_primaryNetworkInterfaceSourceDestCheck (124.80s)
--- PASS: TestAccAWSInstance_ipv6_supportAddressCountWithIpv4 (91.96s)
--- PASS: TestAccAWSInstance_sourceDestCheck (145.33s)
--- PASS: TestAccAWSInstance_hibernation (202.76s)
--- PASS: TestAccAWSInstance_inEc2Classic (94.06s)

--- PASS: TestAccAWSENI_disappears (55.17s)
=== CONT TestAccAWSENI_ipv6
--- PASS: TestAccAWSENI_basic (58.65s)
=== CONT TestAccAWSENI_ipv6_count
--- PASS: TestAccAWSENI_tags (78.43s)
=== CONT TestAccAWSENI_attached
--- PASS: TestAccAWSENI_ignoreExternalAttachment (114.74s)
=== CONT TestAccAWSENI_PrivateIpsCount
--- PASS: TestAccAWSENI_ipv6 (76.68s)
=== CONT TestAccAWSENI_PrivateIpList
--- PASS: TestAccAWSENI_ipv6_count (88.29s)
=== CONT TestAccAWSENI_computedIPs
--- PASS: TestAccAWSENI_PrivateIpsCount (74.29s)
=== CONT TestAccAWSENI_sourceDestCheck
--- PASS: TestAccAWSENI_PrivateIpList (65.11s)
=== CONT TestAccAWSENI_updatedDescription
--- PASS: TestAccAWSENI_computedIPs (56.97s)
--- PASS: TestAccAWSENI_attached (144.41s)
--- PASS: TestAccAWSENI_updatedDescription (67.26s)
--- PASS: TestAccAWSENI_sourceDestCheck (77.23s)

--- PASS: TestAccAWSENI_PrivateIpsSet (206.04s)
--- PASS: TestAccAWSENI_PrivateIpList (249.32s)

@rick-masters rick-masters requested a review from a team as a code owner February 26, 2021 18:05
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. service/ec2 Issues and PRs that pertain to the ec2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Feb 26, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Feb 26, 2021
@breathingdust breathingdust 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 Sep 4, 2021
@bouzafr
Copy link

bouzafr commented Sep 30, 2021

Any idea when this feature will be merged / released?

@jasonkinsella
Copy link

Could really use this enhancement. Don't understand how it's not affecting more people.

@zhelding
Copy link
Contributor

Pull request #21306 has significantly refactored the AWS Provider codebase. As a result, most PRs opened prior to the refactor now have merge conflicts that must be resolved before proceeding.

Specifically, PR #21306 relocated the code for all AWS resources and data sources from a single aws directory to a large number of separate directories in internal/service, each corresponding to a particular AWS service. This separation of code has also allowed for us to simplify the names of underlying functions -- while still avoiding namespace collisions.

We recognize that many pull requests have been open for some time without yet being addressed by our maintainers. Therefore, we want to make it clear that resolving these conflicts in no way affects the prioritization of a particular pull request. Once a pull request has been prioritized for review, the necessary changes will be made by a maintainer -- either directly or in collaboration with the pull request author.

For a more complete description of this refactor, including examples of how old filepaths and function names correspond to their new counterparts: please refer to issue #20000.

For a quick guide on how to amend your pull request to resolve the merge conflicts resulting from this refactor and bring it in line with our new code patterns: please refer to our Service Package Refactor Pull Request Guide.

@breathingdust
Copy link
Member

Hi all 👋 Just letting you know that this is issue is featured on this quarters roadmap. If a PR exists to close the issue a maintainer will review and either make changes directly, or work with the original author to get the contribution merged. If you have written a PR to resolve the issue please ensure the "Allow edits from maintainers" box is checked. Thanks for your patience and we are looking forward to getting this merged soon!

@breathingdust breathingdust added this to the Roadmap milestone Nov 10, 2021
@YakDriver YakDriver added the pre-service-packages Includes pre-Service Packages aspects. label Nov 30, 2021
@ewbankkit ewbankkit assigned ewbankkit and unassigned ewbankkit Dec 13, 2021
@YakDriver YakDriver self-assigned this Jan 21, 2022
@github-actions github-actions bot removed the pre-service-packages Includes pre-Service Packages aspects. label Jan 21, 2022
Copy link
Member

@YakDriver YakDriver left a comment

Choose a reason for hiding this comment

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

Looks great! 🎉

Output from acceptance tests (us-west-2):

% make testacc TESTS=TestAccEC2NetworkInterface PKG=ec2                           
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccEC2NetworkInterface'  -timeout 180m
--- PASS: TestAccEC2NetworkInterfacesDataSource_filter (32.13s)
--- PASS: TestAccEC2NetworkInterfacesDataSource_tags (33.01s)
--- PASS: TestAccEC2NetworkInterfaceSgAttachment_disappears (34.76s)
--- PASS: TestAccEC2NetworkInterfaceSgAttachment_basic (35.93s)
--- PASS: TestAccEC2NetworkInterfaceDataSource_publicIPAssociation (41.42s)
--- PASS: TestAccEC2NetworkInterface_ENIInterfaceType_efa (55.69s)
--- SKIP: TestAccEC2NetworkInterfaceDataSource_carrierIPAssociation (1.25s)
--- PASS: TestAccEC2NetworkInterface_disappears (48.83s)
--- PASS: TestAccEC2NetworkInterface_description (83.63s)
--- PASS: TestAccEC2NetworkInterfaceDataSource_filters (46.90s)
--- PASS: TestAccEC2NetworkInterfaceSgAttachment_multiple (53.66s)
--- PASS: TestAccEC2NetworkInterfaceDataSource_basic (40.72s)
--- PASS: TestAccEC2NetworkInterface_ENI_ipv4Prefix (105.69s)
--- PASS: TestAccEC2NetworkInterface_ENI_ipv6Prefix (110.93s)
--- PASS: TestAccEC2NetworkInterface_sourceDestCheck (118.21s)
--- PASS: TestAccEC2NetworkInterface_ENI_ipv4PrefixCount (123.30s)
--- PASS: TestAccEC2NetworkInterface_basic (44.02s)
--- PASS: TestAccEC2NetworkInterface_privateIPsCount (129.17s)
--- PASS: TestAccEC2NetworkInterface_tags (97.67s)
--- PASS: TestAccEC2NetworkInterface_ENI_ipv6PrefixCount (136.56s)
--- PASS: TestAccEC2NetworkInterfaceSgAttachment_instance (137.85s)
--- PASS: TestAccEC2NetworkInterface_ipv6Count (123.14s)
--- PASS: TestAccEC2NetworkInterface_ipv6 (93.59s)
--- PASS: TestAccEC2NetworkInterface_privateIPSet (229.73s)
--- PASS: TestAccEC2NetworkInterface_ignoreExternalAttachment (275.28s)
--- PASS: TestAccEC2NetworkInterfaceDataSource_attachment (304.68s)
--- PASS: TestAccEC2NetworkInterfaceAttachment_basic (333.55s)
--- PASS: TestAccEC2NetworkInterface_attachment (341.64s)
--- PASS: TestAccEC2NetworkInterface_privateIPList (345.58s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	346.982s

Output from acceptance tests (GovCloud):

% make testacc TESTS=TestAccEC2NetworkInterface PKG=ec2 
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccEC2NetworkInterface'  -timeout 180m
--- PASS: TestAccEC2NetworkInterfacesDataSource_filter (34.28s)
--- PASS: TestAccEC2NetworkInterfacesDataSource_tags (34.63s)
--- PASS: TestAccEC2NetworkInterfaceSgAttachment_basic (37.19s)
--- PASS: TestAccEC2NetworkInterfaceSgAttachment_disappears (37.56s)
--- SKIP: TestAccEC2NetworkInterfaceDataSource_carrierIPAssociation (0.37s)
--- PASS: TestAccEC2NetworkInterfaceDataSource_publicIPAssociation (40.65s)
--- PASS: TestAccEC2NetworkInterface_disappears (48.02s)
--- PASS: TestAccEC2NetworkInterfaceSgAttachment_multiple (48.60s)
--- PASS: TestAccEC2NetworkInterface_basic (49.81s)
--- PASS: TestAccEC2NetworkInterface_description (84.31s)
--- PASS: TestAccEC2NetworkInterfaceDataSource_filters (40.81s)
--- PASS: TestAccEC2NetworkInterfaceDataSource_basic (44.13s)
--- PASS: TestAccEC2NetworkInterface_ENIInterfaceType_efa (58.26s)
--- PASS: TestAccEC2NetworkInterfaceSgAttachment_instance (102.69s)
--- PASS: TestAccEC2NetworkInterface_tags (107.12s)
--- PASS: TestAccEC2NetworkInterface_ENI_ipv6Prefix (117.36s)
--- PASS: TestAccEC2NetworkInterface_ipv6 (119.15s)
--- PASS: TestAccEC2NetworkInterface_ENI_ipv4Prefix (97.53s)
--- PASS: TestAccEC2NetworkInterface_ENI_ipv4PrefixCount (135.47s)
--- PASS: TestAccEC2NetworkInterface_ENI_ipv6PrefixCount (136.47s)
--- PASS: TestAccEC2NetworkInterface_ipv6Count (141.81s)
--- PASS: TestAccEC2NetworkInterface_sourceDestCheck (104.14s)
--- PASS: TestAccEC2NetworkInterface_privateIPsCount (123.43s)
--- PASS: TestAccEC2NetworkInterface_privateIPSet (221.95s)
--- PASS: TestAccEC2NetworkInterfaceAttachment_basic (306.17s)
--- PASS: TestAccEC2NetworkInterface_ignoreExternalAttachment (273.51s)
--- PASS: TestAccEC2NetworkInterfaceDataSource_attachment (331.56s)
--- PASS: TestAccEC2NetworkInterface_privateIPList (366.26s)
--- PASS: TestAccEC2NetworkInterface_attachment (318.32s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	367.929s

@github-actions
Copy link

This functionality has been released in v3.74.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 May 25, 2022
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/ec2 Issues and PRs that pertain to the ec2 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