-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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 ARN attribute for aws_instance and data.aws_instance (#5425) #5432
Conversation
Hi @blckct 👋 Thanks for submitting this!
Thanks for asking! Since we're adding a My recommendation is to add a line around here in the That checks that an ARN attribute exists with an EC2 instance looking ARN, e.g. resource.TestMatchResourceAttr("aws_instance.foo", "arn", regexp.MustCompile(`^arn:[^:]+:ec2:[^:]+:\d{12}:instance/i-.+`)), For the data source, something similar can be done around here in resource.TestMatchResourceAttr("data.aws_instance.web-instance", "arn", regexp.MustCompile(`^arn:[^:]+:ec2:[^:]+:\d{12}:instance/i-.+`)), At some point we'll circle back through all these ARN type checks to simplify them and better validate their values. 👍 |
9d40935
to
ecc2a66
Compare
Those tests were easier than I thought, thank you for writing them for me. I updated and squashed the branch
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @blckct! 🚀
(Test failures unrelated)
Tests failed: 2, passed: 67
=== RUN TestAccAWSInstanceDataSource_blockDevices
--- PASS: TestAccAWSInstanceDataSource_blockDevices (61.13s)
=== RUN TestAccAWSInstanceDataSource_keyPair
--- PASS: TestAccAWSInstanceDataSource_keyPair (87.90s)
=== RUN TestAccAWSInstanceDataSource_VPC
--- PASS: TestAccAWSInstanceDataSource_VPC (97.93s)
=== RUN TestAccAWSInstanceDataSource_rootInstanceStore
--- PASS: TestAccAWSInstanceDataSource_rootInstanceStore (100.54s)
=== RUN TestAccAWSInstance_importBasic
--- PASS: TestAccAWSInstance_importBasic (105.76s)
=== RUN TestAccAWSInstancesDataSource_basic
--- PASS: TestAccAWSInstancesDataSource_basic (106.64s)
=== RUN TestAccAWSInstanceDataSource_AzUserData
--- PASS: TestAccAWSInstanceDataSource_AzUserData (119.14s)
=== RUN TestAccAWSInstancesDataSource_tags
--- PASS: TestAccAWSInstancesDataSource_tags (120.54s)
=== RUN TestAccAWSInstanceDataSource_creditSpecification
--- PASS: TestAccAWSInstanceDataSource_creditSpecification (120.73s)
=== RUN TestAccAWSInstanceDataSource_VPCSecurityGroups
--- PASS: TestAccAWSInstanceDataSource_VPCSecurityGroups (126.82s)
=== RUN TestAccAWSInstanceDataSource_tags
--- PASS: TestAccAWSInstanceDataSource_tags (132.86s)
=== RUN TestAccAWSInstanceDataSource_privateIP
--- PASS: TestAccAWSInstanceDataSource_privateIP (135.63s)
=== RUN TestAccAWSInstanceDataSource_getPasswordData_falseToTrue
--- PASS: TestAccAWSInstanceDataSource_getPasswordData_falseToTrue (158.00s)
=== RUN TestAccAWSInstanceDataSource_gp2IopsDevice
--- PASS: TestAccAWSInstanceDataSource_gp2IopsDevice (162.97s)
=== RUN TestAccAWSInstanceDataSource_getPasswordData_trueToFalse
--- PASS: TestAccAWSInstanceDataSource_getPasswordData_trueToFalse (170.36s)
=== RUN TestAccAWSInstance_noAMIEphemeralDevices
--- PASS: TestAccAWSInstance_noAMIEphemeralDevices (49.68s)
=== RUN TestAccAWSInstanceDataSource_PlacementGroup
--- PASS: TestAccAWSInstanceDataSource_PlacementGroup (174.14s)
=== RUN TestAccAWSInstance_ipv6AddressCountAndSingleAddressCausesError
--- PASS: TestAccAWSInstance_ipv6AddressCountAndSingleAddressCausesError (4.70s)
=== RUN TestAccAWSInstance_importInEc2Classic
--- PASS: TestAccAWSInstance_importInEc2Classic (94.61s)
=== RUN TestAccAWSInstance_importInDefaultVpcBySgName
--- PASS: TestAccAWSInstance_importInDefaultVpcBySgName (192.68s)
=== RUN TestAccAWSInstancesDataSource_instance_state_names
--- FAIL: TestAccAWSInstancesDataSource_instance_state_names (193.10s)
=== RUN TestAccAWSInstance_importInDefaultVpcBySgId
--- PASS: TestAccAWSInstance_importInDefaultVpcBySgId (135.34s)
=== RUN TestAccAWSInstance_rootInstanceStore
--- PASS: TestAccAWSInstance_rootInstanceStore (90.53s)
=== RUN TestAccAWSInstance_vpc
--- PASS: TestAccAWSInstance_vpc (89.27s)
=== RUN TestAccAWSInstanceDataSource_SecurityGroups
--- PASS: TestAccAWSInstanceDataSource_SecurityGroups (226.42s)
=== RUN TestAccAWSInstance_ipv6_supportAddressCountWithIpv4
--- PASS: TestAccAWSInstance_ipv6_supportAddressCountWithIpv4 (59.57s)
=== RUN TestAccAWSInstance_ipv6_supportAddressCount
--- PASS: TestAccAWSInstance_ipv6_supportAddressCount (76.13s)
=== RUN TestAccAWSInstance_volumeTags
--- PASS: TestAccAWSInstance_volumeTags (76.71s)
=== RUN TestAccAWSInstance_GP2IopsDevice
--- PASS: TestAccAWSInstance_GP2IopsDevice (169.14s)
=== RUN TestAccAWSInstance_sourceDestCheck
--- PASS: TestAccAWSInstance_sourceDestCheck (150.47s)
=== RUN TestAccAWSInstance_GP2WithIopsValue
--- PASS: TestAccAWSInstance_GP2WithIopsValue (172.80s)
=== RUN TestAccAWSInstance_NetworkInstanceRemovingAllSecurityGroups
--- PASS: TestAccAWSInstance_NetworkInstanceRemovingAllSecurityGroups (105.15s)
=== RUN TestAccAWSInstance_blockDevices
--- PASS: TestAccAWSInstance_blockDevices (175.24s)
=== RUN TestAccAWSInstance_volumeTagsComputed
--- FAIL: TestAccAWSInstance_volumeTagsComputed (90.35s)
=== RUN TestAccAWSInstanceDataSource_basic
--- PASS: TestAccAWSInstanceDataSource_basic (312.96s)
=== RUN TestAccAWSInstance_privateIP
--- PASS: TestAccAWSInstance_privateIP (87.95s)
=== RUN TestAccAWSInstance_associatePublicIPAndPrivateIP
--- PASS: TestAccAWSInstance_associatePublicIPAndPrivateIP (87.86s)
=== RUN TestAccAWSInstance_placementGroup
--- PASS: TestAccAWSInstance_placementGroup (170.20s)
=== RUN TestAccAWSInstance_primaryNetworkInterface
--- PASS: TestAccAWSInstance_primaryNetworkInterface (42.84s)
=== RUN TestAccAWSInstance_basic
--- PASS: TestAccAWSInstance_basic (236.45s)
=== RUN TestAccAWSInstance_primaryNetworkInterfaceSourceDestCheck
--- PASS: TestAccAWSInstance_primaryNetworkInterfaceSourceDestCheck (53.96s)
=== RUN TestAccAWSInstance_addSecondaryInterface
--- PASS: TestAccAWSInstance_addSecondaryInterface (54.46s)
=== RUN TestAccAWSInstance_userDataBase64
--- PASS: TestAccAWSInstance_userDataBase64 (259.52s)
=== RUN TestAccAWSInstance_keyPairCheck
--- PASS: TestAccAWSInstance_keyPairCheck (88.66s)
=== RUN TestAccAWSInstance_disableApiTermination
--- PASS: TestAccAWSInstance_disableApiTermination (230.43s)
=== RUN TestAccAWSInstance_associatePublic_explicitPrivate
--- PASS: TestAccAWSInstance_associatePublic_explicitPrivate (38.92s)
=== RUN TestAccAWSInstance_NetworkInstanceSecurityGroups
--- PASS: TestAccAWSInstance_NetworkInstanceSecurityGroups (204.02s)
=== RUN TestAccAWSInstance_forceNewAndTagsDrift
--- PASS: TestAccAWSInstance_forceNewAndTagsDrift (114.66s)
=== RUN TestAccAWSInstance_multipleRegions
--- PASS: TestAccAWSInstance_multipleRegions (220.61s)
=== RUN TestAccAWSInstance_associatePublic_explicitPublic
--- PASS: TestAccAWSInstance_associatePublic_explicitPublic (67.84s)
=== RUN TestAccAWSInstance_associatePublic_defaultPrivate
--- PASS: TestAccAWSInstance_associatePublic_defaultPrivate (79.00s)
=== RUN TestAccAWSInstance_NetworkInstanceVPCSecurityGroupIDs
--- PASS: TestAccAWSInstance_NetworkInstanceVPCSecurityGroupIDs (207.38s)
=== RUN TestAccAWSInstance_associatePublic_defaultPublic
--- PASS: TestAccAWSInstance_associatePublic_defaultPublic (79.33s)
=== RUN TestAccAWSInstance_tags
--- PASS: TestAccAWSInstance_tags (219.67s)
=== RUN TestAccAWSInstance_associatePublic_overridePublic
--- PASS: TestAccAWSInstance_associatePublic_overridePublic (88.97s)
=== RUN TestAccAWSInstance_creditSpecification_removalReturnsStandard
--- PASS: TestAccAWSInstance_creditSpecification_removalReturnsStandard (42.98s)
=== RUN TestAccAWSInstance_instanceProfileChange
--- PASS: TestAccAWSInstance_instanceProfileChange (210.64s)
=== RUN TestAccAWSInstance_associatePublic_overridePrivate
--- PASS: TestAccAWSInstance_associatePublic_overridePrivate (89.25s)
=== RUN TestAccAWSInstance_creditSpecification_unspecifiedDefaultsToStandard
--- PASS: TestAccAWSInstance_creditSpecification_unspecifiedDefaultsToStandard (77.55s)
=== RUN TestAccAWSInstance_creditSpecification_unlimitedCpuCredits
--- PASS: TestAccAWSInstance_creditSpecification_unlimitedCpuCredits (78.25s)
=== RUN TestAccAWSInstance_rootBlockDeviceMismatch
--- PASS: TestAccAWSInstance_rootBlockDeviceMismatch (178.22s)
=== RUN TestAccAWSInstance_withIamInstanceProfile
--- PASS: TestAccAWSInstance_withIamInstanceProfile (240.33s)
=== RUN TestAccAWSInstance_creditSpecification_isNotAppliedToNonBurstable
--- PASS: TestAccAWSInstance_creditSpecification_isNotAppliedToNonBurstable (118.04s)
=== RUN TestAccAWSInstance_getPasswordData_trueToFalse
--- PASS: TestAccAWSInstance_getPasswordData_trueToFalse (155.71s)
=== RUN TestAccAWSInstance_getPasswordData_falseToTrue
--- PASS: TestAccAWSInstance_getPasswordData_falseToTrue (203.62s)
=== RUN TestAccAWSInstance_creditSpecification_updateCpuCredits
--- PASS: TestAccAWSInstance_creditSpecification_updateCpuCredits (183.36s)
=== RUN TestAccAWSInstance_creditSpecification_standardCpuCredits
--- PASS: TestAccAWSInstance_creditSpecification_standardCpuCredits (209.24s)
=== RUN TestAccAWSInstance_addSecurityGroupNetworkInterface
--- PASS: TestAccAWSInstance_addSecurityGroupNetworkInterface (262.04s)
=== RUN TestAccAWSInstance_changeInstanceType
--- PASS: TestAccAWSInstance_changeInstanceType (321.23s)
This has been released in version 1.31.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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! |
Fixes #5425
Changes proposed in this pull request:
Output from acceptance testing:
N/A
I would need a little help with how to write tests for it.