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

r/instance - plan time validations #13033

Merged
merged 7 commits into from
Jun 4, 2020
Merged

Conversation

DrFaust92
Copy link
Collaborator

@DrFaust92 DrFaust92 commented Apr 27, 2020

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

Relates: #12991, #12988, #12986, #13624

Release note for CHANGELOG:

resource_aws_instance: plan time validation for `private_ip`, `tenancy`, `ipv6_addresses`, `volume_type`

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccXXX'

...

@DrFaust92 DrFaust92 requested a review from a team April 27, 2020 13:31
@ghost ghost added size/M Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. service/ec2 Issues and PRs that pertain to the ec2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Apr 27, 2020
@ewbankkit
Copy link
Contributor

Looks like a failure in TestInstanceTenancySchema (which TBH I don't see much point in).

@DrFaust92
Copy link
Collaborator Author

fixed, and remove redundant test

@ewbankkit
Copy link
Contributor

@DrFaust92 FYI, some of is being addressed via #13589.

@DrFaust92
Copy link
Collaborator Author

@ewbankkit , ill close this one then. if needed ill reopen with changes.

@DrFaust92 DrFaust92 closed this Jun 3, 2020
@ewbankkit
Copy link
Contributor

@DrFaust92 Closing may be a bit extreme as for example the plan-time validations are not included in #13589.

@DrFaust92
Copy link
Collaborator Author

cool, ill rebase this then after #13589 is merged, its a higher priority.

@DrFaust92 DrFaust92 reopened this Jun 3, 2020
@ewbankkit
Copy link
Contributor

#13589 has now been merged 😄.

@DrFaust92 DrFaust92 changed the title r/instance - use enums + errors r/instance - plan time validations Jun 3, 2020
@DrFaust92
Copy link
Collaborator Author

rebased

@anGie44 anGie44 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 4, 2020
Copy link
Contributor

@anGie44 anGie44 left a comment

Choose a reason for hiding this comment

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

Thanks for rebasing @DrFaust92, you'll just need to run go fmt for the check errors.
I just have a comment regarding an error check, otherwise LGTM 👍

Output of acceptance tests:

--- PASS: TestAccAWSInstanceDataSource_PlacementGroup (72.11s)
--- PASS: TestAccAWSInstanceDataSource_keyPair (75.05s)
--- PASS: TestAccAWSInstanceDataSource_gp2IopsDevice (75.55s)
--- PASS: TestAccAWSInstanceDataSource_RootBlockDevice_KmsKeyId (86.13s)
--- PASS: TestFetchRootDevice (0.00s)
    --- PASS: TestFetchRootDevice/device_name_in_mappings (0.00s)
    --- PASS: TestFetchRootDevice/device_name_not_in_mappings (0.00s)
    --- PASS: TestFetchRootDevice/no_images (0.00s)
--- PASS: TestAccAWSInstanceDataSource_blockDevices (94.08s)
--- PASS: TestAccAWSInstanceDataSource_VPC (95.34s)
--- SKIP: TestAccAWSInstance_inEc2Classic (1.04s)
--- PASS: TestAccAWSInstanceDataSource_VPCSecurityGroups (99.07s)
--- PASS: TestAccAWSInstanceDataSource_EbsBlockDevice_KmsKeyId (101.88s)
--- PASS: TestAccAWSInstanceDataSource_creditSpecification (107.84s)
--- PASS: TestAccAWSInstanceDataSource_rootInstanceStore (109.52s)
--- PASS: TestAccAWSInstanceDataSource_privateIP (110.48s)
--- PASS: TestAccAWSInstanceDataSource_GetUserData (115.93s)
--- PASS: TestAccAWSInstanceDataSource_AzUserData (117.23s)
--- PASS: TestAccAWSInstanceDataSource_SecurityGroups (117.80s)
--- PASS: TestAccAWSInstanceDataSource_GetUserData_NoUserData (120.58s)
--- PASS: TestAccAWSInstanceDataSource_getPasswordData_falseToTrue (126.61s)
--- PASS: TestAccAWSInstanceDataSource_tags (129.70s)
--- PASS: TestAccAWSInstancesDataSource_instance_state_names (73.94s)
--- SKIP: TestAccAWSInstance_outpost (0.00s)
--- PASS: TestAccAWSInstance_inDefaultVpcBySgName (73.69s)
--- PASS: TestAccAWSInstanceDataSource_getPasswordData_trueToFalse (168.25s)
--- PASS: TestAccAWSInstance_inDefaultVpcBySgId (74.78s)
--- PASS: TestAccAWSInstance_ipv6AddressCountAndSingleAddressCausesError (11.13s)
--- PASS: TestAccAWSInstance_GP2WithIopsValue (75.59s)
--- PASS: TestAccAWSInstance_placementGroup (60.19s)
--- PASS: TestAccAWSInstance_vpc (86.09s)
--- PASS: TestAccAWSInstance_userDataBase64 (111.77s)
--- PASS: TestAccAWSInstance_ipv6_supportAddressCount (65.46s)
--- PASS: TestAccAWSInstance_rootInstanceStore (109.46s)
--- PASS: TestAccAWSInstanceDataSource_basic (240.87s)
--- PASS: TestAccAWSInstance_disableApiTermination (119.52s)
--- PASS: TestAccAWSInstance_ipv6_supportAddressCountWithIpv4 (79.75s)
--- PASS: TestAccAWSInstance_sourceDestCheck (128.65s)
--- PASS: TestAccAWSInstance_NetworkInstanceSecurityGroups (77.38s)
--- PASS: TestAccAWSInstancesDataSource_basic (195.26s)
--- PASS: TestAccAWSInstancesDataSource_tags (193.03s)
--- PASS: TestAccAWSInstance_NetworkInstanceRemovingAllSecurityGroups (82.43s)
--- PASS: TestAccAWSInstance_NetworkInstanceVPCSecurityGroupIDs (79.05s)
--- PASS: TestAccAWSInstance_noAMIEphemeralDevices (181.47s)
--- PASS: TestAccAWSInstance_EbsBlockDevice_KmsKeyArn (200.98s)
--- PASS: TestAccAWSInstance_GP2IopsDevice (191.69s)
--- PASS: TestAccAWSInstance_blockDevices (191.00s)
--- PASS: TestAccAWSInstance_basic (229.55s)
--- PASS: TestAccAWSInstance_volumeTags (101.41s)
--- PASS: TestAccAWSInstance_privateIP (85.55s)
--- PASS: TestAccAWSInstance_associatePublicIPAndPrivateIP (85.55s)
--- PASS: TestAccAWSInstanceDataSource_metadataOptions (335.59s)
--- PASS: TestAccAWSInstance_EbsRootDevice_basic (63.73s)
--- PASS: TestAccAWSInstance_volumeTagsComputed (132.42s)
--- PASS: TestAccAWSInstance_withIamInstanceProfile (126.04s)
--- PASS: TestAccAWSInstance_EbsRootDevice_ModifyType (106.28s)
--- PASS: TestAccAWSInstance_RootBlockDevice_KmsKeyArn (316.98s)
--- PASS: TestAccAWSInstance_EbsRootDevice_ModifySize (123.25s)
--- PASS: TestAccAWSInstance_primaryNetworkInterfaceSourceDestCheck (77.67s)
--- PASS: TestAccAWSInstance_keyPairCheck (183.75s)
--- PASS: TestAccAWSInstance_associatePublic_defaultPublic (65.53s)
--- PASS: TestAccAWSInstance_EbsRootDevice_MultipleBlockDevices_ModifySize (125.55s)
--- PASS: TestAccAWSInstance_rootBlockDeviceMismatch (186.12s)
--- PASS: TestAccAWSInstance_EbsRootDevice_ModifyIOPS (153.42s)
--- PASS: TestAccAWSInstance_associatePublic_defaultPrivate (85.26s)
--- PASS: TestAccAWSInstance_tags (237.74s)
--- PASS: TestAccAWSInstance_multipleRegions (282.53s)
--- PASS: TestAccAWSInstance_addSecondaryInterface (103.48s)
--- PASS: TestAccAWSInstance_addSecurityGroupNetworkInterface (114.99s)
--- PASS: TestAccAWSInstance_associatePublic_explicitPublic (76.40s)
--- PASS: TestAccAWSInstance_associatePublic_overridePublic (69.33s)
--- PASS: TestAccAWSInstance_associatePublic_overridePrivate (76.51s)
--- PASS: TestAccAWSInstance_associatePublic_explicitPrivate (90.25s)
--- PASS: TestAccAWSInstance_forceNewAndTagsDrift (244.51s)
--- PASS: TestAccAWSInstance_EbsRootDevice_MultipleDynamicEBSBlockDevices (183.74s)
--- PASS: TestAccAWSInstance_primaryNetworkInterface (189.63s)
--- PASS: TestAccAWSInstance_creditSpecificationT3_unspecifiedDefaultsToUnlimited (55.85s)
--- PASS: TestAccAWSInstance_changeInstanceType (242.39s)
--- PASS: TestAccAWSInstance_creditSpecification_unknownCpuCredits_t2 (85.84s)
--- PASS: TestAccAWSInstance_creditSpecification_unspecifiedDefaultsToStandard (91.28s)
--- PASS: TestInstanceHostIDSchema (0.00s)
--- PASS: TestInstanceCpuCoreCountSchema (0.00s)
--- PASS: TestInstanceCpuThreadsPerCoreSchema (0.00s)
--- PASS: TestAccAWSInstance_CreditSpecification_UnspecifiedToEmpty_NonBurstable (102.12s)
--- PASS: TestAccAWSInstance_creditSpecification_standardCpuCredits (108.42s)
--- PASS: TestAccAWSInstance_creditSpecification_unlimitedCpuCredits (108.37s)
--- PASS: TestAccAWSInstance_creditSpecification_isNotAppliedToNonBurstable (110.76s)
--- PASS: TestAccAWSInstance_creditSpecification_unknownCpuCredits_t3 (115.90s)
--- PASS: TestAccAWSInstance_creditSpecificationT3_unlimitedCpuCredits (84.55s)
--- PASS: TestAccAWSInstance_getPasswordData_falseToTrue (143.84s)
--- PASS: TestAccAWSInstance_creditSpecification_updateCpuCredits (121.36s)
--- PASS: TestAccAWSInstance_creditSpecificationT3_standardCpuCredits (109.49s)
--- PASS: TestAccAWSInstance_UserData_UnspecifiedToEmptyString (87.05s)
--- PASS: TestAccAWSInstance_UserData_EmptyStringToUnspecified (95.29s)
--- PASS: TestAccAWSInstance_getPasswordData_trueToFalse (175.56s)
--- PASS: TestAccAWSInstance_disappears (122.25s)
--- PASS: TestAccAWSInstance_creditSpecificationT3_updateCpuCredits (144.28s)
--- PASS: TestAccAWSInstance_CreditSpecification_Empty_NonBurstable (304.84s)
--- PASS: TestAccAWSInstance_creditSpecification_standardCpuCredits_t2Tot3Taint (384.17s)
--- PASS: TestAccAWSInstance_creditSpecification_unlimitedCpuCredits_t2Tot3Taint (393.81s)
--- PASS: TestAccAWSInstance_hibernation (407.17s)
--- PASS: TestAccAWSInstance_metadataOptions (145.64s)
--- PASS: TestAccAWSInstance_instanceProfileChange (221.62s)--- PASS: TestAccAWSInstance_EbsRootDevice_ModifyAll (149.94s)--- PASS: TestAccAWSInstance_EbsRootDevice_MultipleBlockDevices_ModifyDeleteOnTermination (127.48s)
--- PASS: TestAccAWSInstance_EbsRootDevice_ModifyDeleteOnTermination (129.01s)

aws/resource_aws_instance.go Outdated Show resolved Hide resolved
@anGie44 anGie44 added this to the v2.65.0 milestone Jun 4, 2020
@anGie44 anGie44 merged commit cd86ea5 into hashicorp:master Jun 4, 2020
anGie44 added a commit that referenced this pull request Jun 4, 2020
anGie44 added a commit that referenced this pull request Jun 4, 2020
and reword log for #13033
@ghost
Copy link

ghost commented Jun 5, 2020

This has been released in version 2.65.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 for triage. Thanks!

@tdmalone
Copy link
Contributor

tdmalone commented Jun 5, 2020

This PR causes #13626

Optional: true,
ForceNew: true,
Computed: true,
ValidateFunc: validation.IsIPv4Address,

Choose a reason for hiding this comment

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

This validation means that you cannot pass an empty string and as a result ALL of our EC2 instances that were created with a module which passes an empty string (which is a valid value) when an IP is not specified are now producing diffs.

mcanevet added a commit to camptocamp/terraform-instance-aws that referenced this pull request Jun 8, 2020
@DrFaust92 DrFaust92 deleted the r/ec2_refactor branch June 23, 2020 11:27
@ghost
Copy link

ghost commented Jul 5, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Jul 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service. size/M 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
Development

Successfully merging this pull request may close these issues.

None yet

5 participants