-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
provider: Add SERVICECreateTags generator to keyvaluetags, refactor EC2 resources to use keyvaluetags.CreateEc2Tags #12735
Conversation
…o shared service_generation_customizations.go
…g tagging of new resources Some services require special handling for newly created resources, such as retrying on "not found" errors for eventual consistency. This generator starts with just the EC2 service implementation, but is extensible for any service. We can also consider generating this for all services to simplify `{SERVICE}UpdateTags(conn, id, nil, tags)` usage, but that is not a current refactoring goal.
…CreateEc2Tags implementation Reference: #11060 Reference: #12427 Reference: https://github.com/terraform-providers/terraform-provider-aws/blob/0c56c9bea1291e77f28ae99c79748251a2e23517/aws/tags.go#L198 The EC2 service has special considerations during resource creation to retry for eventual consistency within the API itself on "NotFound" errors. This switches Terraform resources that cannot tag-on-create due to the lack of EC2 API support to the keyvaluetags implementation that handles this eventual consistency automatically for 5 minutes (or max retries if API is throttling). This retry logic was present prior to the service refactoring to keyvaluetags (although errantly retrying on "NotFound" errors on every update, which may never succeed) and was still present in the `aws_vpc` and `aws_subnet` resources manually in the logic after the refactoring. This refactor also catches cases where the resource `Create` function was depending on the `Update` logic to handle tagging on creation logic. We discourage the usage of `Update` after `Create` for new resources, but this refactor only guards against running the tag update logic rather than bundling more complex resource refactoring into this changeset. Now all EC2 resources are consolidated to similar tagging on creation logic. Output from acceptance testing: ``` ```
…ng ResourceData on creation Otherwise information like tagging can be dropped and not written on first apply. Previously: ``` === CONT TestAccAWSVPCPeeringConnectionAccepter_sameRegionDifferentAccount TestAccAWSVPCPeeringConnectionAccepter_sameRegionDifferentAccount: testing.go:669: Step 0 error: After applying this step, the plan was not empty: DIFF: UPDATE: aws_vpc_peering_connection_accepter.peer ... tags.Name: "" => "terraform-testacc-pcxaccpt-118309467362907493" ... ```
Previously: ``` --- FAIL: TestAccAWSNetworkAcl_basic (7.89s) testing.go:669: Step 0 error: After applying this step, the plan was not empty: DIFF: UPDATE: aws_network_acl.test ... tags.Name: "" => "tf-acc-acl-egress-and-ingress" ... ``` Output from acceptance testing: ``` --- PASS: TestAccAWSNetworkAcl_basic (44.83s) --- PASS: TestAccAWSNetworkAcl_CaseSensitivityNoChanges (45.84s) --- PASS: TestAccAWSNetworkAcl_disappears (41.71s) --- PASS: TestAccAWSNetworkAcl_Egress_ConfigMode (80.98s) --- PASS: TestAccAWSNetworkAcl_EgressAndIngressRules (40.63s) --- PASS: TestAccAWSNetworkAcl_espProtocol (43.41s) --- PASS: TestAccAWSNetworkAcl_Ingress_ConfigMode (74.98s) --- PASS: TestAccAWSNetworkAcl_ipv6ICMPRules (31.16s) --- PASS: TestAccAWSNetworkAcl_ipv6Rules (38.52s) --- PASS: TestAccAWSNetworkAcl_ipv6VpcRules (37.93s) --- PASS: TestAccAWSNetworkAcl_OnlyEgressRules (37.58s) --- PASS: TestAccAWSNetworkAcl_OnlyIngressRules_basic (39.35s) --- PASS: TestAccAWSNetworkAcl_OnlyIngressRules_update (63.18s) --- PASS: TestAccAWSNetworkAcl_SubnetChange (60.24s) --- PASS: TestAccAWSNetworkAcl_Subnets (69.00s) --- PASS: TestAccAWSNetworkAcl_SubnetsDelete (67.02s) --- PASS: TestAccAWSNetworkAclRule_allProtocol (57.73s) --- PASS: TestAccAWSNetworkAclRule_basic (42.24s) --- PASS: TestAccAWSNetworkAclRule_disappears (45.36s) --- PASS: TestAccAWSNetworkAclRule_disappears_NetworkAcl (41.05s) --- PASS: TestAccAWSNetworkAclRule_ingressEgressSameNumberDisappears (46.62s) --- PASS: TestAccAWSNetworkAclRule_ipv6 (42.03s) --- PASS: TestAccAWSNetworkAclRule_ipv6ICMP (36.46s) --- PASS: TestAccAWSNetworkAclRule_ipv6VpcAssignGeneratedIpv6CidrBlockUpdate (58.86s) --- PASS: TestAccAWSNetworkAclRule_missingParam (20.95s) ```
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 🚀
--- PASS: TestAccAWSVpc_coreMismatchedDiffs (12.68s)
--- PASS: TestAccAWSDefaultSecurityGroup_basic (12.92s)
--- PASS: TestAccAWSEgressOnlyInternetGateway_basic (16.65s)
--- PASS: TestAccAWSDefaultSecurityGroup_classic (21.20s)
--- PASS: TestAccAWSEIP_basic (9.07s)
--- PASS: TestAccAWSCustomerGateway_disappears (27.46s)
--- PASS: TestAccAWSCustomerGateway_similarAlreadyExists (38.38s)
--- PASS: TestAccAWSAMI_disappears (43.97s)
--- PASS: TestAccAWSCustomerGateway_basic (50.36s)
--- PASS: TestAccAWSAMI_snapshotSize (51.89s)
--- PASS: TestAccAWSEgressOnlyInternetGateway_Tags (39.31s)
--- PASS: TestAccAWSAMI_basic (61.75s)
--- PASS: TestAccAWSEIP_networkInterface (38.24s)
--- SKIP: TestAccAWSEIP_PublicIpv4Pool_custom (0.00s)
--- PASS: TestAccAWSEIP_twoEIPsOneNetworkInterface (36.71s)
--- PASS: TestAccAWSEIP_disappears (19.28s)
--- PASS: TestAccAWSEIP_PublicIpv4Pool_default (20.75s)
--- PASS: TestAccAWSEIP_tags (33.94s)
--- PASS: TestAccAWSAMI_tags (86.16s)
--- PASS: TestAccAWSInternetGateway_delete (26.01s)
--- PASS: TestAccAWSKeyPair_basic (7.89s)
--- PASS: TestAccAWSKeyPair_generatedName (7.41s)
--- PASS: TestAccAWSInternetGateway_tags (25.13s)
--- PASS: TestAccAWSKeyPair_disappears (5.65s)
--- PASS: TestAccAWSKeyPair_namePrefix (7.53s)
--- PASS: TestAccAWSKeyPair_tags (17.83s)
--- PASS: TestAccAWSNetworkAcl_basic (10.37s)
--- PASS: TestAccAWSNetworkAcl_disappears (9.93s)
--- PASS: TestAccAWSInternetGateway_basic (49.75s)
--- PASS: TestAccAWSNetworkAcl_EgressAndIngressRules (14.42s)
--- PASS: TestAccAWSNetworkAcl_OnlyIngressRules_basic (19.53s)
--- PASS: TestAccAWSNetworkAcl_CaseSensitivityNoChanges (14.13s)
--- PASS: TestAccAWSEIP_associated_user_private_ip (91.32s)
--- PASS: TestAccAWSEIP_instance (113.38s)
--- PASS: TestAccAWSNetworkAcl_OnlyEgressRules (21.84s)
--- PASS: TestAccAWSNetworkAcl_Egress_ConfigMode (46.46s)
--- PASS: TestAccAWSNetworkAcl_Ingress_ConfigMode (57.92s)
--- PASS: TestAccAWSNetworkAcl_Subnets (31.93s)
--- FAIL: TestAccAWSEIP_Ec2Classic (148.21s)
--- PASS: TestAccAWSNetworkAcl_SubnetsDelete (32.63s)
--- PASS: TestAccAWSNetworkAcl_OnlyIngressRules_update (58.26s)
--- PASS: TestAccAWSNetworkAcl_ipv6VpcRules (22.73s)
--- PASS: TestAccAWSEIPAssociate_notAssociated (119.78s)
--- PASS: TestAccAWSNetworkAcl_ipv6ICMPRules (32.61s)
--- PASS: TestAccAWSENI_basic (15.11s)
--- PASS: TestAccAWSNetworkAcl_SubnetChange (53.33s)
--- PASS: TestAccAWSNetworkAcl_ipv6Rules (45.02s)
--- PASS: TestAccAWSEIP_Instance_Reassociate (137.87s)
--- PASS: TestAccAWSENI_disappears (27.08s)
--- PASS: TestAccAWSPlacementGroup_disappears (7.78s)
--- PASS: TestAccAWSNetworkAcl_espProtocol (42.83s)
--- PASS: TestAccAWSPlacementGroup_basic (31.44s)
--- PASS: TestAccAWSENI_sourceDestCheck (37.95s)
--- PASS: TestAccAWSRouteTable_panicEmptyRoute (7.64s)
--- PASS: TestAccAWSENI_computedIPs (45.46s)
--- PASS: TestAccAWSRouteTable_ipv6 (32.22s)
--- PASS: TestAccAWSENI_updatedDescription (76.64s)
--- PASS: TestAccAWSRouteTable_tags (31.44s)
--- PASS: TestProtocolStateFunc (0.00s)
--- PASS: TestProtocolForValue (0.00s)
--- PASS: TestResourceAwsSecurityGroupExpandCollapseRules (0.00s)
--- PASS: TestResourceAwsSecurityGroupIPPermGather (0.00s)
--- PASS: TestAccAWSRouteTable_basic (70.25s)
--- PASS: TestAccAWSPlacementGroup_tags (78.85s)
--- FAIL: TestAccAWSRouteTable_vpcPeering (28.96s)
--- PASS: TestAccAWSSecurityGroup_allowAll (22.42s)
--- FAIL: TestAccAWSRouteTable_vgwRoutePropagation (30.40s)
--- PASS: TestAccAWSENI_PrivateIpsCount (95.03s)
--- PASS: TestAccAWSENI_ignoreExternalAttachment (108.45s)
--- PASS: TestAccAWSSecurityGroup_IPRangesWithSameRules (16.59s)
--- PASS: TestAccAWSSecurityGroup_basic (14.98s)
--- PASS: TestAccAWSRouteTable_instance (90.63s)
--- PASS: TestAccAWSSecurityGroup_sourceSecurityGroup (25.51s)
--- PASS: TestAccAWSRouteTable_Route_ConfigMode (72.09s)
--- PASS: TestAccAWSSecurityGroup_egressConfigMode (31.73s)
--- PASS: TestAccAWSSecurityGroup_ipv6 (21.19s)
--- PASS: TestAccAWSSecurityGroup_IPRangeAndSecurityGroupWithSameRules (44.45s)
--- PASS: TestAccAWSSecurityGroup_self (16.72s)
--- PASS: TestAccAWSSecurityGroup_namePrefix (29.22s)
--- PASS: TestAccAWSSecurityGroup_ingressConfigMode (47.96s)
--- PASS: TestAccAWSSecurityGroup_vpcNegOneIngress (17.75s)
--- PASS: TestAccAWSSecurityGroup_vpc (19.76s)
--- PASS: TestAccAWSSecurityGroup_ruleGathering (47.70s)
--- PASS: TestAccAWSSecurityGroup_vpcProtoNumIngress (26.00s)
--- PASS: TestAccAWSSecurityGroup_multiIngress (23.24s)
--- PASS: TestAccAWSSecurityGroup_defaultEgressVPC (12.75s)
--- PASS: TestAccAWSSecurityGroup_invalidCIDRBlock (1.63s)
--- PASS: TestAccAWSSecurityGroup_generatedName (16.51s)
--- PASS: TestAccAWSSecurityGroup_change (22.65s)
--- PASS: TestAccAWSSecurityGroup_drift (8.89s)
--- PASS: TestAccAWSSecurityGroup_defaultEgressClassic (18.96s)
--- PASS: TestAccAWSSecurityGroup_driftComplex (14.09s)
--- PASS: TestAccAWSSecurityGroup_ingressWithCidrAndSGsVPC (20.97s)
--- PASS: TestAccAWSEc2TransitGatewayVpcAttachmentAccepter_basic (360.85s)
--- PASS: TestAccAWSSecurityGroup_CIDRandGroups (25.45s)
--- PASS: TestAccAWSSecurityGroup_tags (26.02s)
--- PASS: TestAccAWSSecurityGroup_ingressWithCidrAndSGsClassic (24.00s)
--- PASS: TestAccAWSSecurityGroup_ruleDescription (45.12s)
--- PASS: TestAccAWSAMICopy_EnaSupport (368.89s)
--- PASS: TestAccAWSAMICopy_basic (370.36s)
--- PASS: TestAccAWSSecurityGroup_egressWithPrefixList (35.80s)
--- PASS: TestAccAWSAMICopy_Description (377.16s)
--- PASS: TestAccAWSSecurityGroup_failWithDiffMismatch (26.69s)
--- PASS: TestAccAWSSecurityGroup_ingressWithPrefixList (48.29s)
--- PASS: TestAccAWSSecurityGroup_ipv4andipv6Egress (35.22s)
--- PASS: TestAccAWSEc2TransitGatewayVpcAttachmentAccepter_Tags (396.65s)
--- PASS: TestAccAWSAMICopy_tags (401.85s)
--- PASS: TestAccAWSENI_attached (245.57s)
--- PASS: TestAccAWSAMIFromInstance_tags (410.87s)
--- PASS: TestAccAWSSecurityGroup_rulesDropOnError (45.62s)
--- PASS: TestAccAWSSecurityGroup_ruleLimitExceededAppend (54.77s)
--- PASS: TestAccAWSAMIFromInstance_basic (418.49s)
--- PASS: TestAccAWSSecurityGroup_ruleLimitCidrBlockExceededAppend (60.34s)
--- PASS: TestAccAWSSecurityGroup_ruleLimitExceededPrepend (60.88s)
--- PASS: TestAccAWSSpotInstanceRequest_basic (58.29s)
--- PASS: TestAccAWSSubnet_basic (23.08s)
--- PASS: TestAccAWSSecurityGroup_ruleLimitExceededAllNew (83.30s)
--- PASS: TestAccAWSDHCPOptions_deleteOptions (18.79s)
--- PASS: TestAccAWSSubnet_availabilityZoneId (43.77s)
--- PASS: TestAccAWSSubnet_enableIpv6 (52.67s)
--- PASS: TestAccAWSSubnet_ipv6 (57.82s)
--- PASS: TestAccAWSSubnet_ignoreTags (63.05s)
--- PASS: TestAccAWSDHCPOptions_basic (51.29s)
--- PASS: TestAccAWSSpotInstanceRequest_withBlockDuration (115.28s)
--- PASS: TestAccAWSSpotInstanceRequest_vpc (115.48s)
--- PASS: TestAccAWSVPCPeeringConnectionAccepter_sameRegionSameAccount (32.91s)
--- PASS: TestAccAWSVPCPeeringConnection_tags (11.00s)
--- PASS: TestAccAWSSpotInstanceRequestInterruptHibernate (103.46s)
--- PASS: TestAccAWSSpotInstanceRequest_SubnetAndSGAndPublicIpAddress (126.25s)
--- PASS: TestAccAWSVPCPeeringConnection_failedState (8.94s)
--- PASS: TestAccAWSVPCPeeringConnection_basic (33.22s)
--- PASS: TestAccAWSVPCPeeringConnection_options (19.22s)
--- PASS: TestAccAWSVPCPeeringConnection_plan (34.50s)
--- PASS: TestAccAWSVPCPeeringConnection_optionsNoAutoAccept (8.29s)
--- PASS: TestAccAWSDHCPOptions_tags (68.58s)
--- PASS: TestAccAWSVPCPeeringConnectionAccepter_sameRegionDifferentAccount (57.55s)
--- PASS: TestAccAWSVPCPeeringConnection_peerRegionAutoAccept (20.42s)
--- PASS: TestAccAWSVPCPeeringConnectionAccepter_differentRegionDifferentAccount (60.51s)
--- PASS: TestAccAWSVPCPeeringConnectionAccepter_differentRegionSameAccount (71.27s)
--- PASS: TestAccAWSVpc_basic (23.94s)
--- PASS: TestAccAWSVpc_disappears (22.23s)
--- PASS: TestAccAWSSpotInstanceRequest_withLaunchGroup (182.31s)
--- PASS: TestAccAWSVpc_bothDnsOptionsSet (15.06s)
--- PASS: TestAccAWSVPCPeeringConnection_region (40.24s)
--- PASS: TestAccAWSRouteTable_Route_TransitGatewayID (346.93s)
--- PASS: TestAccAWSSpotInstanceRequest_validUntil (173.31s)
--- PASS: TestAccAWSVpc_update (23.36s)
--- PASS: TestAccAWSVpc_ignoreTags (35.52s)
--- PASS: TestAWSVpnConnection_xmlconfig (0.00s)
--- PASS: TestAccAWSVpc_tags (30.14s)
--- PASS: TestAccAWSVPCPeeringConnection_accept (48.11s)
--- PASS: TestAccAWSVpc_DisabledDnsSupport (24.73s)
--- PASS: TestAccAWSVpc_classiclinkOptionSet (25.21s)
--- PASS: TestAccAWSVpc_Tenancy (49.40s)
--- PASS: TestAccAWSVpc_classiclinkDnsSupportOptionSet (30.87s)
--- PASS: TestAccAWSVpc_AssignGeneratedIpv6CidrBlock (57.99s)
--- PASS: TestAccAWSSpotInstanceRequest_NetworkInterfaceAttributes (191.54s)
--- PASS: TestAccAWSEc2TransitGatewayVpcAttachmentAccepter_TransitGatewayDefaultRouteTableAssociationAndPropagation (603.57s)
--- PASS: TestAccAWSVpnGateway_withAvailabilityZoneSetToState (37.08s)
--- PASS: TestAccAWSVpnGateway_disappears (54.97s)
--- PASS: TestAccAWSVpnGateway_basic (65.01s)
--- PASS: TestAccAWSVpnGateway_withAmazonSideAsnSetToState (62.22s)
--- PASS: TestAccAWSVpnGateway_tags (73.39s)
--- PASS: TestAccAWSVpnGateway_delete (84.43s)
--- PASS: TestAccAWSVpnGateway_reattach (102.56s)
--- PASS: TestAccAWSSpotInstanceRequest_withoutSpotPrice (312.78s)
--- PASS: TestAccAWSSpotInstanceRequestInterruptStop (313.03s)
--- PASS: TestAccAWSSpotInstanceRequest_getPasswordData (374.75s)
--- PASS: TestAccAWSVpnConnection_withoutStaticRoutes (287.26s)
--- PASS: TestAccAWSVpnConnection_tunnelOptions (288.44s)
--- PASS: TestAccAWSSecurityGroup_forceRevokeRulesTrue (673.21s)
--- PASS: TestAccAWSSecurityGroup_forceRevokeRulesFalse (688.91s)
--- PASS: TestAccAWSVpnConnection_disappears (465.20s)
--- PASS: TestAccAWSVpnConnection_TransitGatewayID (581.30s)
--- PASS: TestAccAWSVpnConnection_basic (957.23s)
The test failures are unrelated to this change:
TestAccAWSEIP_Ec2Classic
TestAccAWSRouteTable_vgwRoutePropagation
TestAccAWSRouteTable_vpcPeering
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 🚀
--- PASS: TestAWSVpnConnection_xmlconfig (0.00s)
--- PASS: TestAccAWSAMICopy_Description (377.16s)
--- PASS: TestAccAWSAMICopy_EnaSupport (368.89s)
--- PASS: TestAccAWSAMICopy_basic (370.36s)
--- PASS: TestAccAWSAMICopy_tags (401.85s)
--- PASS: TestAccAWSAMIFromInstance_basic (418.49s)
--- PASS: TestAccAWSAMIFromInstance_tags (410.87s)
--- PASS: TestAccAWSAMI_basic (61.75s)
--- PASS: TestAccAWSAMI_disappears (43.97s)
--- PASS: TestAccAWSAMI_snapshotSize (51.89s)
--- PASS: TestAccAWSAMI_tags (86.16s)
--- PASS: TestAccAWSCustomerGateway_basic (50.36s)
--- PASS: TestAccAWSCustomerGateway_disappears (27.46s)
--- PASS: TestAccAWSCustomerGateway_similarAlreadyExists (38.38s)
--- PASS: TestAccAWSDHCPOptions_basic (51.29s)
--- PASS: TestAccAWSDHCPOptions_deleteOptions (18.79s)
--- PASS: TestAccAWSDHCPOptions_tags (68.58s)
--- PASS: TestAccAWSDefaultSecurityGroup_basic (12.92s)
--- PASS: TestAccAWSDefaultSecurityGroup_classic (21.20s)
--- PASS: TestAccAWSEIPAssociate_notAssociated (119.78s)
--- PASS: TestAccAWSEIP_Instance_Reassociate (137.87s)
--- PASS: TestAccAWSEIP_PublicIpv4Pool_default (20.75s)
--- PASS: TestAccAWSEIP_associated_user_private_ip (91.32s)
--- PASS: TestAccAWSEIP_basic (9.07s)
--- PASS: TestAccAWSEIP_disappears (19.28s)
--- PASS: TestAccAWSEIP_instance (113.38s)
--- PASS: TestAccAWSEIP_networkInterface (38.24s)
--- PASS: TestAccAWSEIP_tags (33.94s)
--- PASS: TestAccAWSEIP_twoEIPsOneNetworkInterface (36.71s)
--- PASS: TestAccAWSENI_PrivateIpsCount (95.03s)
--- PASS: TestAccAWSENI_attached (245.57s)
--- PASS: TestAccAWSENI_basic (15.11s)
--- PASS: TestAccAWSENI_computedIPs (45.46s)
--- PASS: TestAccAWSENI_disappears (27.08s)
--- PASS: TestAccAWSENI_ignoreExternalAttachment (108.45s)
--- PASS: TestAccAWSENI_sourceDestCheck (37.95s)
--- PASS: TestAccAWSENI_updatedDescription (76.64s)
--- PASS: TestAccAWSEc2TransitGatewayVpcAttachmentAccepter_Tags (396.65s)
--- PASS: TestAccAWSEc2TransitGatewayVpcAttachmentAccepter_TransitGatewayDefaultRouteTableAssociationAndPropagation (603.57s)
--- PASS: TestAccAWSEc2TransitGatewayVpcAttachmentAccepter_basic (360.85s)
--- PASS: TestAccAWSEgressOnlyInternetGateway_Tags (39.31s)
--- PASS: TestAccAWSEgressOnlyInternetGateway_basic (16.65s)
--- PASS: TestAccAWSInternetGateway_basic (49.75s)
--- PASS: TestAccAWSInternetGateway_delete (26.01s)
--- PASS: TestAccAWSInternetGateway_tags (25.13s)
--- PASS: TestAccAWSKeyPair_basic (7.89s)
--- PASS: TestAccAWSKeyPair_disappears (5.65s)
--- PASS: TestAccAWSKeyPair_generatedName (7.41s)
--- PASS: TestAccAWSKeyPair_namePrefix (7.53s)
--- PASS: TestAccAWSKeyPair_tags (17.83s)
--- PASS: TestAccAWSNetworkAcl_CaseSensitivityNoChanges (14.13s)
--- PASS: TestAccAWSNetworkAcl_EgressAndIngressRules (14.42s)
--- PASS: TestAccAWSNetworkAcl_Egress_ConfigMode (46.46s)
--- PASS: TestAccAWSNetworkAcl_Ingress_ConfigMode (57.92s)
--- PASS: TestAccAWSNetworkAcl_OnlyEgressRules (21.84s)
--- PASS: TestAccAWSNetworkAcl_OnlyIngressRules_basic (19.53s)
--- PASS: TestAccAWSNetworkAcl_OnlyIngressRules_update (58.26s)
--- PASS: TestAccAWSNetworkAcl_SubnetChange (53.33s)
--- PASS: TestAccAWSNetworkAcl_Subnets (31.93s)
--- PASS: TestAccAWSNetworkAcl_SubnetsDelete (32.63s)
--- PASS: TestAccAWSNetworkAcl_basic (10.37s)
--- PASS: TestAccAWSNetworkAcl_disappears (9.93s)
--- PASS: TestAccAWSNetworkAcl_espProtocol (42.83s)
--- PASS: TestAccAWSNetworkAcl_ipv6ICMPRules (32.61s)
--- PASS: TestAccAWSNetworkAcl_ipv6Rules (45.02s)
--- PASS: TestAccAWSNetworkAcl_ipv6VpcRules (22.73s)
--- PASS: TestAccAWSPlacementGroup_basic (31.44s)
--- PASS: TestAccAWSPlacementGroup_disappears (7.78s)
--- PASS: TestAccAWSPlacementGroup_tags (78.85s)
--- PASS: TestAccAWSRouteTable_Route_ConfigMode (72.09s)
--- PASS: TestAccAWSRouteTable_Route_TransitGatewayID (346.93s)
--- PASS: TestAccAWSRouteTable_basic (70.25s)
--- PASS: TestAccAWSRouteTable_instance (90.63s)
--- PASS: TestAccAWSRouteTable_ipv6 (32.22s)
--- PASS: TestAccAWSRouteTable_panicEmptyRoute (7.64s)
--- PASS: TestAccAWSRouteTable_tags (31.44s)
--- PASS: TestAccAWSSecurityGroup_CIDRandGroups (25.45s)
--- PASS: TestAccAWSSecurityGroup_IPRangeAndSecurityGroupWithSameRules (44.45s)
--- PASS: TestAccAWSSecurityGroup_IPRangesWithSameRules (16.59s)
--- PASS: TestAccAWSSecurityGroup_allowAll (22.42s)
--- PASS: TestAccAWSSecurityGroup_basic (14.98s)
--- PASS: TestAccAWSSecurityGroup_change (22.65s)
--- PASS: TestAccAWSSecurityGroup_defaultEgressClassic (18.96s)
--- PASS: TestAccAWSSecurityGroup_defaultEgressVPC (12.75s)
--- PASS: TestAccAWSSecurityGroup_drift (8.89s)
--- PASS: TestAccAWSSecurityGroup_driftComplex (14.09s)
--- PASS: TestAccAWSSecurityGroup_egressConfigMode (31.73s)
--- PASS: TestAccAWSSecurityGroup_egressWithPrefixList (35.80s)
--- PASS: TestAccAWSSecurityGroup_failWithDiffMismatch (26.69s)
--- PASS: TestAccAWSSecurityGroup_forceRevokeRulesFalse (688.91s)
--- PASS: TestAccAWSSecurityGroup_forceRevokeRulesTrue (673.21s)
--- PASS: TestAccAWSSecurityGroup_generatedName (16.51s)
--- PASS: TestAccAWSSecurityGroup_ingressConfigMode (47.96s)
--- PASS: TestAccAWSSecurityGroup_ingressWithCidrAndSGsClassic (24.00s)
--- PASS: TestAccAWSSecurityGroup_ingressWithCidrAndSGsVPC (20.97s)
--- PASS: TestAccAWSSecurityGroup_ingressWithPrefixList (48.29s)
--- PASS: TestAccAWSSecurityGroup_invalidCIDRBlock (1.63s)
--- PASS: TestAccAWSSecurityGroup_ipv4andipv6Egress (35.22s)
--- PASS: TestAccAWSSecurityGroup_ipv6 (21.19s)
--- PASS: TestAccAWSSecurityGroup_multiIngress (23.24s)
--- PASS: TestAccAWSSecurityGroup_namePrefix (29.22s)
--- PASS: TestAccAWSSecurityGroup_ruleDescription (45.12s)
--- PASS: TestAccAWSSecurityGroup_ruleGathering (47.70s)
--- PASS: TestAccAWSSecurityGroup_ruleLimitCidrBlockExceededAppend (60.34s)
--- PASS: TestAccAWSSecurityGroup_ruleLimitExceededAllNew (83.30s)
--- PASS: TestAccAWSSecurityGroup_ruleLimitExceededAppend (54.77s)
--- PASS: TestAccAWSSecurityGroup_ruleLimitExceededPrepend (60.88s)
--- PASS: TestAccAWSSecurityGroup_rulesDropOnError (45.62s)
--- PASS: TestAccAWSSecurityGroup_self (16.72s)
--- PASS: TestAccAWSSecurityGroup_sourceSecurityGroup (25.51s)
--- PASS: TestAccAWSSecurityGroup_tags (26.02s)
--- PASS: TestAccAWSSecurityGroup_vpc (19.76s)
--- PASS: TestAccAWSSecurityGroup_vpcNegOneIngress (17.75s)
--- PASS: TestAccAWSSecurityGroup_vpcProtoNumIngress (26.00s)
--- PASS: TestAccAWSSpotInstanceRequestInterruptHibernate (103.46s)
--- PASS: TestAccAWSSpotInstanceRequestInterruptStop (313.03s)
--- PASS: TestAccAWSSpotInstanceRequest_NetworkInterfaceAttributes (191.54s)
--- PASS: TestAccAWSSpotInstanceRequest_SubnetAndSGAndPublicIpAddress (126.25s)
--- PASS: TestAccAWSSpotInstanceRequest_basic (58.29s)
--- PASS: TestAccAWSSpotInstanceRequest_getPasswordData (374.75s)
--- PASS: TestAccAWSSpotInstanceRequest_validUntil (173.31s)
--- PASS: TestAccAWSSpotInstanceRequest_vpc (115.48s)
--- PASS: TestAccAWSSpotInstanceRequest_withBlockDuration (115.28s)
--- PASS: TestAccAWSSpotInstanceRequest_withLaunchGroup (182.31s)
--- PASS: TestAccAWSSpotInstanceRequest_withoutSpotPrice (312.78s)
--- PASS: TestAccAWSSubnet_availabilityZoneId (43.77s)
--- PASS: TestAccAWSSubnet_basic (23.08s)
--- PASS: TestAccAWSSubnet_enableIpv6 (52.67s)
--- PASS: TestAccAWSSubnet_ignoreTags (63.05s)
--- PASS: TestAccAWSSubnet_ipv6 (57.82s)
--- PASS: TestAccAWSVPCPeeringConnectionAccepter_differentRegionDifferentAccount (60.51s)
--- PASS: TestAccAWSVPCPeeringConnectionAccepter_differentRegionSameAccount (71.27s)
--- PASS: TestAccAWSVPCPeeringConnectionAccepter_sameRegionDifferentAccount (57.55s)
--- PASS: TestAccAWSVPCPeeringConnectionAccepter_sameRegionSameAccount (32.91s)
--- PASS: TestAccAWSVPCPeeringConnection_accept (48.11s)
--- PASS: TestAccAWSVPCPeeringConnection_basic (33.22s)
--- PASS: TestAccAWSVPCPeeringConnection_failedState (8.94s)
--- PASS: TestAccAWSVPCPeeringConnection_options (19.22s)
--- PASS: TestAccAWSVPCPeeringConnection_optionsNoAutoAccept (8.29s)
--- PASS: TestAccAWSVPCPeeringConnection_peerRegionAutoAccept (20.42s)
--- PASS: TestAccAWSVPCPeeringConnection_plan (34.50s)
--- PASS: TestAccAWSVPCPeeringConnection_region (40.24s)
--- PASS: TestAccAWSVPCPeeringConnection_tags (11.00s)
--- PASS: TestAccAWSVpc_AssignGeneratedIpv6CidrBlock (57.99s)
--- PASS: TestAccAWSVpc_DisabledDnsSupport (24.73s)
--- PASS: TestAccAWSVpc_Tenancy (49.40s)
--- PASS: TestAccAWSVpc_basic (23.94s)
--- PASS: TestAccAWSVpc_bothDnsOptionsSet (15.06s)
--- PASS: TestAccAWSVpc_classiclinkDnsSupportOptionSet (30.87s)
--- PASS: TestAccAWSVpc_classiclinkOptionSet (25.21s)
--- PASS: TestAccAWSVpc_coreMismatchedDiffs (12.68s)
--- PASS: TestAccAWSVpc_disappears (22.23s)
--- PASS: TestAccAWSVpc_ignoreTags (35.52s)
--- PASS: TestAccAWSVpc_tags (30.14s)
--- PASS: TestAccAWSVpc_update (23.36s)
--- PASS: TestAccAWSVpnConnection_TransitGatewayID (581.30s)
--- PASS: TestAccAWSVpnConnection_basic (957.23s)
--- PASS: TestAccAWSVpnConnection_disappears (465.20s)
--- PASS: TestAccAWSVpnConnection_tunnelOptions (288.44s)
--- PASS: TestAccAWSVpnConnection_withoutStaticRoutes (287.26s)
--- PASS: TestAccAWSVpnGateway_basic (65.01s)
--- PASS: TestAccAWSVpnGateway_delete (84.43s)
--- PASS: TestAccAWSVpnGateway_disappears (54.97s)
--- PASS: TestAccAWSVpnGateway_reattach (102.56s)
--- PASS: TestAccAWSVpnGateway_tags (73.39s)
--- PASS: TestAccAWSVpnGateway_withAmazonSideAsnSetToState (62.22s)
--- PASS: TestAccAWSVpnGateway_withAvailabilityZoneSetToState (37.08s)
This has been released in version 2.57.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! |
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! |
Community Note
Closes #11060
Closes #12427
Reference: https://github.com/terraform-providers/terraform-provider-aws/blob/0c56c9bea1291e77f28ae99c79748251a2e23517/aws/tags.go#L198
Release note for CHANGELOG:
Some services require special handling for newly created resources, such as retrying on "not found" errors for eventual consistency. This generator starts with just the EC2 service implementation, but is extensible for any service.
We can also consider generating this for all services to simplify
{SERVICE}UpdateTags(conn, id, nil, tags)
usage, but that is not a current refactoring goal.Specifically, the EC2 service has special considerations during resource creation to retry for eventual consistency within the API itself on "NotFound" errors. This switches Terraform resources that cannot tag-on-create due to the lack of EC2 API support to the keyvaluetags implementation that handles this eventual consistency automatically for 5 minutes (or max retries if API is throttling).
This retry logic was present prior to the service refactoring to keyvaluetags (although errantly retrying on "NotFound" errors on every update, which may never succeed) and was still present in the
aws_vpc
andaws_subnet
resources manually in the logic after the refactoring.This refactor also catches cases where the resource
Create
function was depending on theUpdate
logic to handle tagging on creation logic. We discourage the usage ofUpdate
afterCreate
for new resources, but this refactor only guards against running the tag update logic rather than bundling more complex resource refactoring into this changeset.Now all EC2 resources are consolidated to similar tagging on creation logic.
Output from acceptance testing: