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

resource/instance: fix non-empty plan after refresh #13589

Merged
merged 5 commits into from
Jun 3, 2020

Conversation

anGie44
Copy link
Contributor

@anGie44 anGie44 commented Jun 3, 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

Closes #13118

Release note for CHANGELOG:

resource/instance: set ebs_block_device from root_block_device when only 1 block device mapping in instance

Output from acceptance testing:

--- PASS: TestAccAWSInstanceDataSource_gp2IopsDevice (61.17s)
--- PASS: TestAccAWSInstanceDataSource_PlacementGroup (68.79s)
--- PASS: TestAccAWSInstanceDataSource_rootInstanceStore (82.66s)
--- PASS: TestAccAWSInstanceDataSource_VPCSecurityGroups (83.97s)
--- 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_EbsBlockDevice_KmsKeyId (91.01s)
--- PASS: TestAccAWSInstanceDataSource_privateIP (94.50s)
--- SKIP: TestAccAWSInstance_inEc2Classic (1.17s)
--- PASS: TestAccAWSInstanceDataSource_RootBlockDevice_KmsKeyId (105.64s)
--- PASS: TestAccAWSInstanceDataSource_creditSpecification (119.14s)
--- PASS: TestAccAWSInstanceDataSource_SecurityGroups (119.52s)
--- PASS: TestAccAWSInstanceDataSource_VPC (119.71s)
--- PASS: TestAccAWSInstanceDataSource_basic (129.03s)
--- PASS: TestAccAWSInstanceDataSource_GetUserData_NoUserData (130.24s)
--- PASS: TestAccAWSInstanceDataSource_blockDevices (131.20s)
--- PASS: TestAccAWSInstanceDataSource_getPasswordData_falseToTrue (144.76s)
--- PASS: TestAccAWSInstance_inDefaultVpcBySgName (64.02s)
--- PASS: TestAccAWSInstanceDataSource_getPasswordData_trueToFalse (156.45s)
--- PASS: TestAccAWSInstanceDataSource_GetUserData (164.53s)
--- PASS: TestAccAWSInstanceDataSource_keyPair (181.79s)
--- SKIP: TestAccAWSInstance_outpost (0.00s)
--- PASS: TestAccAWSInstance_GP2IopsDevice (70.20s)
--- PASS: TestAccAWSInstance_EbsBlockDevice_KmsKeyArn (90.81s)
--- PASS: TestAccAWSInstance_ipv6AddressCountAndSingleAddressCausesError (11.30s)
--- PASS: TestAccAWSInstance_rootInstanceStore (69.94s)
--- PASS: TestAccAWSInstance_inDefaultVpcBySgId (114.39s)
--- PASS: TestAccAWSInstance_GP2WithIopsValue (94.99s)
--- PASS: TestAccAWSInstanceDataSource_AzUserData (227.13s)
--- PASS: TestAccAWSInstance_basic (138.84s)
--- PASS: TestAccAWSInstanceDataSource_tags (242.31s)
--- PASS: TestAccAWSInstance_vpc (87.19s)
--- PASS: TestAccAWSInstance_disableApiTermination (98.83s)
--- PASS: TestAccAWSInstancesDataSource_tags (193.99s)
--- PASS: TestAccAWSInstance_ipv6_supportAddressCount (79.40s)
--- PASS: TestAccAWSInstancesDataSource_basic (205.21s)
--- PASS: TestAccAWSInstance_sourceDestCheck (127.11s)
--- PASS: TestAccAWSInstancesDataSource_instance_state_names (193.39s)
--- PASS: TestAccAWSInstance_NetworkInstanceSecurityGroups (78.93s)
--- PASS: TestAccAWSInstance_ipv6_supportAddressCountWithIpv4 (87.32s)
--- PASS: TestAccAWSInstance_NetworkInstanceRemovingAllSecurityGroups (84.89s)
--- PASS: TestAccAWSInstance_NetworkInstanceVPCSecurityGroupIDs (78.91s)
--- PASS: TestAccAWSInstanceDataSource_metadataOptions (317.58s)
--- PASS: TestAccAWSInstance_noAMIEphemeralDevices (175.81s)
--- PASS: TestAccAWSInstance_privateIP (67.28s)
--- PASS: TestAccAWSInstance_keyPairCheck (64.18s)
--- PASS: TestAccAWSInstance_multipleRegions (130.75s)
--- PASS: TestAccAWSInstance_rootBlockDeviceMismatch (64.98s)
--- PASS: TestAccAWSInstance_volumeTagsComputed (103.51s)
--- PASS: TestAccAWSInstance_volumeTags (113.70s)
--- PASS: TestAccAWSInstance_userDataBase64 (233.35s)
--- PASS: TestAccAWSInstance_tags (126.92s)
--- PASS: TestAccAWSInstance_EbsRootDevice_basic (74.19s)
--- PASS: TestAccAWSInstance_placementGroup (181.52s)
--- PASS: TestAccAWSInstance_withIamInstanceProfile (115.88s)
--- PASS: TestAccAWSInstance_EbsRootDevice_ModifySize (113.07s)
--- PASS: TestAccAWSInstance_forceNewAndTagsDrift (134.05s)
--- PASS: TestAccAWSInstance_RootBlockDevice_KmsKeyArn (291.02s)
--- PASS: TestAccAWSInstance_primaryNetworkInterface (68.55s)
--- PASS: TestAccAWSInstance_EbsRootDevice_ModifyType (113.65s)
--- PASS: TestAccAWSInstance_primaryNetworkInterfaceSourceDestCheck (88.19s)
--- PASS: TestAccAWSInstance_EbsRootDevice_MultipleBlockDevices_ModifySize (107.13s)
--- PASS: TestAccAWSInstance_associatePublic_explicitPublic (67.50s)
--- PASS: TestAccAWSInstance_associatePublic_defaultPrivate (81.92s)
--- PASS: TestAccAWSInstance_associatePublicIPAndPrivateIP (186.98s)
--- PASS: TestAccAWSInstance_associatePublic_defaultPublic (88.08s)
--- PASS: TestAccAWSInstance_EbsRootDevice_ModifyIOPS (134.84s)
--- PASS: TestAccAWSInstance_associatePublic_explicitPrivate (76.13s)
--- PASS: TestAccAWSInstance_addSecurityGroupNetworkInterface (108.25s)
--- PASS: TestAccAWSInstance_addSecondaryInterface (117.03s)
--- PASS: TestAccAWSInstance_associatePublic_overridePublic (67.36s)
--- PASS: TestAccAWSInstance_associatePublic_overridePrivate (66.77s)
--- PASS: TestAccAWSInstance_CreditSpecification_UnspecifiedToEmpty_NonBurstable (68.14s)
--- PASS: TestAccAWSInstance_changeInstanceType (225.72s)
--- PASS: TestAccAWSInstance_creditSpecification_unknownCpuCredits_t2 (73.43s)
--- PASS: TestAccAWSInstance_creditSpecification_standardCpuCredits (91.18s)
--- PASS: TestAccAWSInstance_creditSpecification_unspecifiedDefaultsToStandard (104.50s)
--- PASS: TestInstanceTenancySchema (0.00s)
--- PASS: TestInstanceHostIDSchema (0.00s)
--- PASS: TestInstanceCpuCoreCountSchema (0.00s)
--- PASS: TestInstanceCpuThreadsPerCoreSchema (0.00s)
--- PASS: TestAccAWSInstance_EbsRootDevice_MultipleDynamicEBSBlockDevices (193.30s)
--- PASS: TestAccAWSInstance_getPasswordData_falseToTrue (145.50s)
--- PASS: TestAccAWSInstance_creditSpecificationT3_standardCpuCredits (106.55s)
--- PASS: TestAccAWSInstance_creditSpecificationT3_unlimitedCpuCredits (102.13s)
--- PASS: TestAccAWSInstance_creditSpecification_updateCpuCredits (110.36s)
--- PASS: TestAccAWSInstance_getPasswordData_trueToFalse (150.46s)
--- PASS: TestAccAWSInstance_creditSpecification_unlimitedCpuCredits (140.46s)
--- PASS: TestAccAWSInstance_UserData_EmptyStringToUnspecified (92.93s)
--- PASS: TestAccAWSInstance_creditSpecification_isNotAppliedToNonBurstable (132.31s)
--- PASS: TestAccAWSInstance_creditSpecificationT3_updateCpuCredits (128.91s)
--- PASS: TestAccAWSInstance_UserData_UnspecifiedToEmptyString (96.42s)
--- PASS: TestAccAWSInstance_disappears (244.65s)
--- PASS: TestAccAWSInstance_hibernation (214.54s)
--- PASS: TestAccAWSInstance_CreditSpecification_Empty_NonBurstable (310.76s)
--- PASS: TestAccAWSInstance_creditSpecification_unknownCpuCredits_t3 (308.87s)
--- PASS: TestAccAWSInstance_creditSpecificationT3_unspecifiedDefaultsToUnlimited (310.23s)
--- PASS: TestAccAWSInstance_creditSpecification_unlimitedCpuCredits_t2Tot3Taint (390.69s)
--- PASS: TestAccAWSInstance_creditSpecification_standardCpuCredits_t2Tot3Taint (400.28s)

Failing in TC:

--- FAIL: TestAccAWSInstance_blockDevices (54.66s)
--- FAIL: TestAccAWSInstance_metadataOptions (281.46s)
--- FAIL: TestAccAWSInstance_EbsRootDevice_ModifyAll (122.22s)
--- FAIL: TestAccAWSInstance_EbsRootDevice_MultipleBlockDevices_ModifyDeleteOnTermination (92.74s)
--- FAIL: TestAccAWSInstance_instanceProfileChange (130.77s)
--- FAIL: TestAccAWSInstance_EbsRootDevice_ModifyDeleteOnTermination (100.62s)

But passing locally:

--- PASS: TestAccAWSInstance_blockDevices (103.57s)
--- PASS: TestAccAWSInstance_metadataOptions (128.92s)
--- PASS: TestAccAWSInstance_EbsRootDevice_ModifyAll (151.02s)
--- PASS: TestAccAWSInstance_EbsRootDevice_MultipleBlockDevices_ModifyDeleteOnTermination (122.33s)
--- PASS: TestAccAWSInstance_instanceProfileChange (221.20s)
--- PASS: TestAccAWSInstance_EbsRootDevice_ModifyDeleteOnTermination (129.02s)

@ghost ghost added size/L Managed by automation to categorize the size of a PR. service/ec2 Issues and PRs that pertain to the ec2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jun 3, 2020
@anGie44 anGie44 marked this pull request as ready for review June 3, 2020 15:57
@anGie44 anGie44 requested a review from a team June 3, 2020 15:57
@anGie44 anGie44 requested a review from ewbankkit June 3, 2020 16:41
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.

Just some minor tweaks required.
I'll run some relevant acceptance tests and paste the results in the PR conversation.

@ewbankkit
Copy link
Contributor

Verified (some relevant) acceptance tests:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSInstance_EbsRootDevice_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 2 -run=TestAccAWSInstance_EbsRootDevice_ -timeout 120m
=== RUN   TestAccAWSInstance_EbsRootDevice_basic
=== PAUSE TestAccAWSInstance_EbsRootDevice_basic
=== RUN   TestAccAWSInstance_EbsRootDevice_ModifySize
=== PAUSE TestAccAWSInstance_EbsRootDevice_ModifySize
=== RUN   TestAccAWSInstance_EbsRootDevice_ModifyType
=== PAUSE TestAccAWSInstance_EbsRootDevice_ModifyType
=== RUN   TestAccAWSInstance_EbsRootDevice_ModifyIOPS
=== PAUSE TestAccAWSInstance_EbsRootDevice_ModifyIOPS
=== RUN   TestAccAWSInstance_EbsRootDevice_ModifyDeleteOnTermination
=== PAUSE TestAccAWSInstance_EbsRootDevice_ModifyDeleteOnTermination
=== RUN   TestAccAWSInstance_EbsRootDevice_ModifyAll
=== PAUSE TestAccAWSInstance_EbsRootDevice_ModifyAll
=== RUN   TestAccAWSInstance_EbsRootDevice_MultipleBlockDevices_ModifySize
=== PAUSE TestAccAWSInstance_EbsRootDevice_MultipleBlockDevices_ModifySize
=== RUN   TestAccAWSInstance_EbsRootDevice_MultipleBlockDevices_ModifyDeleteOnTermination
=== PAUSE TestAccAWSInstance_EbsRootDevice_MultipleBlockDevices_ModifyDeleteOnTermination
=== RUN   TestAccAWSInstance_EbsRootDevice_MultipleDynamicEBSBlockDevices
=== PAUSE TestAccAWSInstance_EbsRootDevice_MultipleDynamicEBSBlockDevices
=== CONT  TestAccAWSInstance_EbsRootDevice_basic
=== CONT  TestAccAWSInstance_EbsRootDevice_ModifyAll
--- PASS: TestAccAWSInstance_EbsRootDevice_basic (112.50s)
=== CONT  TestAccAWSInstance_EbsRootDevice_MultipleDynamicEBSBlockDevices
--- PASS: TestAccAWSInstance_EbsRootDevice_ModifyAll (142.10s)
=== CONT  TestAccAWSInstance_EbsRootDevice_MultipleBlockDevices_ModifyDeleteOnTermination
--- PASS: TestAccAWSInstance_EbsRootDevice_MultipleBlockDevices_ModifyDeleteOnTermination (126.42s)
=== CONT  TestAccAWSInstance_EbsRootDevice_MultipleBlockDevices_ModifySize
--- PASS: TestAccAWSInstance_EbsRootDevice_MultipleDynamicEBSBlockDevices (222.28s)
=== CONT  TestAccAWSInstance_EbsRootDevice_ModifyDeleteOnTermination
--- PASS: TestAccAWSInstance_EbsRootDevice_MultipleBlockDevices_ModifySize (145.75s)
=== CONT  TestAccAWSInstance_EbsRootDevice_ModifyIOPS
--- PASS: TestAccAWSInstance_EbsRootDevice_ModifyDeleteOnTermination (116.19s)
=== CONT  TestAccAWSInstance_EbsRootDevice_ModifyType
--- PASS: TestAccAWSInstance_EbsRootDevice_ModifyIOPS (156.58s)
=== CONT  TestAccAWSInstance_EbsRootDevice_ModifySize
--- PASS: TestAccAWSInstance_EbsRootDevice_ModifyType (178.96s)
--- PASS: TestAccAWSInstance_EbsRootDevice_ModifySize (146.83s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	717.717s

@anGie44
Copy link
Contributor Author

anGie44 commented Jun 3, 2020

thanks @ewbankkit for the review/testing verification! PR now updated with changes from review comments

@anGie44 anGie44 requested a review from ewbankkit June 3, 2020 20:29
@anGie44 anGie44 merged commit a6a929e into master Jun 3, 2020
@anGie44 anGie44 deleted the ap_13118_ebs_block_devices branch June 3, 2020 21:42
anGie44 added a commit that referenced this pull request Jun 3, 2020
@anGie44 anGie44 added this to the v2.65.0 milestone Jun 3, 2020
@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!

@ghost
Copy link

ghost commented Jul 4, 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 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/ec2 Issues and PRs that pertain to the ec2 service. size/L 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.

aws_instance dynamic ebs_block_device forces replacement
2 participants