-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Refactor Resource Tagging Code to use keyvaluetags Package #10688
Comments
@bflad Should we mark the S3 data sources and resources as skip for now as S3 doesn't have |
…ckage and call Read after Create Reference: #10688 Output from acceptance testing: ``` --- PASS: TestAccAWSSNSTopic_name (13.72s) --- PASS: TestAccAWSSNSTopic_namePrefix (13.88s) --- PASS: TestAccAWSSNSTopic_basic (14.02s) --- PASS: TestAccAWSSNSTopic_withDeliveryPolicy (14.52s) --- PASS: TestAccAWSSNSTopic_policy (14.77s) --- PASS: TestAccAWSSNSTopic_encryption (22.23s) --- PASS: TestAccAWSSNSTopic_withIAMRole (22.35s) --- PASS: TestAccAWSSNSTopic_tags (30.82s) --- PASS: TestAccAWSSNSTopic_deliveryStatus (31.95s) --- PASS: TestAccAWSSNSTopic_withFakeIAMRole (129.10s) ```
Reference: #10688 Output from acceptance testing: ``` --- PASS: TestAccAWSTransferUser_UserName_Validation (5.86s) --- PASS: TestAccAWSTransferServer_disappears (11.20s) --- PASS: TestAccAWSTransferUser_disappears (14.61s) --- PASS: TestAccAWSTransferServer_forcedestroy (15.39s) --- PASS: TestAccAWSTransferUser_basic (16.12s) --- PASS: TestAccAWSTransferServer_apigateway (20.54s) --- PASS: TestAccAWSTransferServer_basic (21.48s) --- PASS: TestAccAWSTransferUser_modifyWithOptions (36.18s) --- PASS: TestAccAWSTransferServer_vpcEndpointId (77.08s) ```
Reference: #10688 Output from acceptance testing: ``` --- PASS: TestAccDataSourceAwsSecretsManagerSecret_Basic (5.99s) --- PASS: TestAccAwsSecretsManagerSecret_Basic (13.99s) --- PASS: TestAccAwsSecretsManagerSecret_withNamePrefix (14.02s) --- PASS: TestAccDataSourceAwsSecretsManagerSecret_ARN (15.28s) --- PASS: TestAccDataSourceAwsSecretsManagerSecret_Policy (16.05s) --- PASS: TestAccDataSourceAwsSecretsManagerSecret_Name (16.35s) --- PASS: TestAccAwsSecretsManagerSecret_policy (17.75s) --- PASS: TestAccAwsSecretsManagerSecret_Description (21.89s) --- PASS: TestAccAwsSecretsManagerSecret_Tags (38.69s) --- PASS: TestAccAwsSecretsManagerSecret_RecoveryWindowInDays_Recreate (39.41s) --- PASS: TestAccAwsSecretsManagerSecret_RotationRules (50.42s) --- PASS: TestAccAwsSecretsManagerSecret_RotationLambdaARN (50.55s) --- PASS: TestAccAwsSecretsManagerSecret_KmsKeyID (53.23s) ```
Reference: #10688 Output from acceptance testing: ``` --- PASS: TestAccAwsRamResourceShare_basic (14.82s) --- PASS: TestAccDataSourceAwsRamResourceShare_Tags (15.10s) --- PASS: TestAccDataSourceAwsRamResourceShare_Basic (16.75s) --- PASS: TestAccAwsRamResourceShare_AllowExternalPrincipals (24.02s) --- PASS: TestAccAwsRamResourceShare_Name (24.09s) --- PASS: TestAccAwsRamResourceShare_Tags (32.51s) ```
…kage Reference: #10688 Output from acceptance testing: ``` --- PASS: TestAccAWSVPCPeeringConnection_peerRegionAutoAccept (18.18s) --- PASS: TestAccAWSVPCPeeringConnection_failedState (18.90s) --- PASS: TestAccAWSVPCPeeringConnection_optionsNoAutoAccept (22.54s) --- PASS: TestAccAWSVPCPeeringConnection_plan (30.03s) --- PASS: TestAccAWSVPCPeeringConnection_basic (32.13s) --- PASS: TestAccAWSVPCPeeringConnection_tags (33.94s) --- PASS: TestAccAWSVPCPeeringConnection_region (35.88s) --- PASS: TestAccAWSVPCPeeringConnection_options (57.71s) --- PASS: TestAccAWSVPCPeeringConnection_accept (68.21s) ```
…ckage (#11917) Reference: #10688 Output from acceptance testing: ``` --- PASS: TestAccAwsEc2ClientVpnEndpoint_disappears (20.98s) --- PASS: TestAccAwsEc2ClientVpnEndpoint_basic (32.30s) --- PASS: TestAccAwsEc2ClientVpnEndpoint_withDNSServers (36.48s) --- PASS: TestAccAwsEc2ClientVpnEndpoint_splitTunnel (39.03s) --- PASS: TestAccAwsEc2ClientVpnEndpoint_withLogGroup (41.00s) --- PASS: TestAccAwsEc2ClientVpnEndpoint_tags (51.32s) --- PASS: TestAccAwsEc2ClientVpnEndpoint_msAD (1806.58s) ```
…rce to use keyvaluetags package (#11912) Reference: #10688 Output from acceptance testing: ``` --- PASS: TestAccAWSENI_computedIPs (40.42s) --- PASS: TestAccAWSENI_disappears (41.08s) --- PASS: TestAccAWSENI_sourceDestCheck (41.52s) --- PASS: TestAccAWSENI_basic (44.39s) --- PASS: TestAccAWSENI_updatedDescription (71.87s) --- PASS: TestAccAWSENI_PrivateIpsCount (110.97s) --- PASS: TestAccAWSENI_ignoreExternalAttachment (113.13s) --- PASS: TestAccAWSENI_attached (241.64s) --- PASS: TestAccDataSourceAwsNetworkInterface_filters (44.99s) --- PASS: TestAccDataSourceAwsNetworkInterface_basic (45.00s) --- PASS: TestAccDataSourceAwsNetworkInterfaces_Filter (41.65s) --- PASS: TestAccDataSourceAwsNetworkInterfaces_Tags (41.69s) ```
…yvaluetags package (#11913) Reference: #10688 Output from acceptance testing (failure is reproducible locally but unrelated): ``` --- PASS: TestAccAWSNetworkAcl_ipv6ICMPRules (34.10s) --- PASS: TestAccAWSNetworkAcl_disappears (34.71s) --- PASS: TestAccAWSNetworkAcl_espProtocol (35.04s) --- PASS: TestAccAWSNetworkAcl_basic (37.94s) --- PASS: TestAccAWSNetworkAcl_ipv6VpcRules (38.32s) --- PASS: TestAccAWSNetworkAcl_OnlyEgressRules (39.16s) --- PASS: TestAccAWSNetworkAcl_EgressAndIngressRules (39.44s) --- PASS: TestAccAWSNetworkAcl_CaseSensitivityNoChanges (43.76s) --- PASS: TestAccAWSNetworkAcl_ipv6Rules (43.86s) --- PASS: TestAccAWSNetworkAcl_OnlyIngressRules_basic (45.15s) --- PASS: TestAccAWSNetworkAcl_OnlyIngressRules_update (70.53s) --- PASS: TestAccAWSNetworkAcl_SubnetChange (70.90s) --- PASS: TestAccAWSNetworkAcl_Subnets (75.73s) --- PASS: TestAccAWSNetworkAcl_Ingress_ConfigMode (81.14s) --- PASS: TestAccAWSNetworkAcl_Egress_ConfigMode (84.11s) --- FAIL: TestAccAWSNetworkAcl_SubnetsDelete (61.78s) testing.go:640: Step 2 error: errors during apply: Error: InvalidAssociationID.NotFound: The association ID 'aclassoc-0680583195befd52d' does not exist --- PASS: TestAccAWSDefaultNetworkAcl_basic (31.09s) --- PASS: TestAccAWSDefaultNetworkAcl_deny_ingress (31.48s) --- PASS: TestAccAWSDefaultNetworkAcl_withIpv6Ingress (31.55s) --- PASS: TestAccAWSDefaultNetworkAcl_basicIpv6Vpc (32.62s) --- PASS: TestAccAWSDefaultNetworkAcl_SubnetRemoval (62.43s) --- PASS: TestAccAWSDefaultNetworkAcl_SubnetReassign (70.95s) --- PASS: TestAccDataSourceAwsNetworkAcls_VpcID (36.42s) --- PASS: TestAccDataSourceAwsNetworkAcls_Filter (37.19s) --- PASS: TestAccDataSourceAwsNetworkAcls_Tags (38.04s) --- PASS: TestAccDataSourceAwsNetworkAcls_basic (52.66s) ```
…1932) Reference: #10688 Output from acceptance testing: ``` --- PASS: TestAccAWSVpnConnection_tunnelOptions (375.61s) --- PASS: TestAccAWSVpnConnection_withoutStaticRoutes (376.60s) --- PASS: TestAccAWSVpnConnection_disappears (425.76s) --- PASS: TestAccAWSVpnConnection_TransitGatewayID (489.10s) --- PASS: TestAccAWSVpnConnection_basic (821.66s) ```
…e to use keyvaluetags package (#11931) Reference: #10688 Output from acceptance testing: ``` --- PASS: TestAccAWSVpcEndpointService_removed (402.00s) --- PASS: TestAccAWSVpcEndpointService_basic (496.96s) --- PASS: TestAccAWSVpcEndpointService_AllowedPrincipalsAndTags (552.52s) --- PASS: TestAccDataSourceAwsVpcEndpoint_byId (42.27s) --- PASS: TestAccDataSourceAwsVpcEndpoint_byFilter (42.46s) --- PASS: TestAccDataSourceAwsVpcEndpoint_gatewayBasic (42.52s) --- PASS: TestAccDataSourceAwsVpcEndpoint_byTags (47.33s) --- PASS: TestAccDataSourceAwsVpcEndpoint_gatewayWithRouteTableAndTags (53.17s) --- PASS: TestAccDataSourceAwsVpcEndpoint_interface (198.80s) --- PASS: TestAccDataSourceAwsVpcEndpointService_interface (15.12s) --- PASS: TestAccDataSourceAwsVpcEndpointService_gateway (15.52s) --- PASS: TestAccDataSourceAwsVpcEndpointService_custom (275.50s) ```
… use keyvaluetags package (#11915) Reference: #10688 Output from acceptance testing: ``` --- PASS: TestAccAWSRouteTable_panicEmptyRoute (25.53s) --- PASS: TestAccAWSRouteTable_ipv6 (39.37s) --- PASS: TestAccAWSRouteTable_vpcPeering (50.45s) --- PASS: TestAccAWSRouteTable_vgwRoutePropagation (54.85s) --- PASS: TestAccAWSRouteTable_tags (56.74s) --- PASS: TestAccAWSRouteTable_basic (71.67s) --- PASS: TestAccAWSRouteTable_Route_ConfigMode (93.39s) --- PASS: TestAccAWSRouteTable_instance (114.93s) --- PASS: TestAccAWSRouteTable_Route_TransitGatewayID (332.43s) --- PASS: TestAccDataSourceAwsRouteTable_main (32.43s) --- PASS: TestAccDataSourceAwsRouteTable_basic (49.36s) --- PASS: TestAccDataSourceAwsRouteTables (61.83s) ```
…uetags package (#11934) Reference: #10688 Output from acceptance testing: ``` --- PASS: TestAccAWSSpotFleetRequest_associatePublicIpAddress (274.60s) --- PASS: TestAccAWSSpotFleetRequest_basic (283.14s) --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (522.10s) --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (298.59s) --- PASS: TestAccAWSSpotFleetRequest_fleetType (282.73s) --- PASS: TestAccAWSSpotFleetRequest_iamInstanceProfileArn (276.40s) --- PASS: TestAccAWSSpotFleetRequest_instanceInterruptionBehavior (274.55s) --- PASS: TestAccAWSSpotFleetRequest_LaunchSpecification_EbsBlockDevice_KmsKeyId (165.46s) --- PASS: TestAccAWSSpotFleetRequest_LaunchSpecification_RootBlockDevice_KmsKeyId (174.06s) --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (292.48s) --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (290.78s) --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (296.09s) --- PASS: TestAccAWSSpotFleetRequest_multipleInstancePools (289.26s) --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (297.04s) --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (298.03s) --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (297.99s) --- PASS: TestAccAWSSpotFleetRequest_placementTenancyAndGroup (62.05s) --- PASS: TestAccAWSSpotFleetRequest_updateExcessCapacityTerminationPolicy (482.51s) --- PASS: TestAccAWSSpotFleetRequest_updateTargetCapacity (839.04s) --- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (281.29s) --- PASS: TestAccAWSSpotFleetRequest_WithELBs (337.32s) --- PASS: TestAccAWSSpotFleetRequest_withoutSpotPrice (255.23s) --- PASS: TestAccAWSSpotFleetRequest_withTags (275.65s) --- PASS: TestAccAWSSpotFleetRequest_WithTargetGroups (413.66s) --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (369.73s) --- PASS: TestAccAWSSpotInstanceRequest_withBlockDuration (83.23s) --- PASS: TestAccAWSSpotInstanceRequest_validUntil (93.46s) --- PASS: TestAccAWSSpotInstanceRequest_withoutSpotPrice (104.36s) --- PASS: TestAccAWSSpotInstanceRequest_SubnetAndSGAndPublicIpAddress (113.97s) --- PASS: TestAccAWSSpotInstanceRequest_basic (114.64s) --- PASS: TestAccAWSSpotInstanceRequest_vpc (122.18s) --- PASS: TestAccAWSSpotInstanceRequest_NetworkInterfaceAttributes (126.37s) --- PASS: TestAccAWSSpotInstanceRequest_withLaunchGroup (126.68s) --- PASS: TestAccAWSSpotInstanceRequest_getPasswordData (247.92s) ```
…kage (#11935) Reference: #10688 Output from acceptance testing: ``` --- PASS: TestAccAWSVPCPeeringConnection_peerRegionAutoAccept (18.18s) --- PASS: TestAccAWSVPCPeeringConnection_failedState (18.90s) --- PASS: TestAccAWSVPCPeeringConnection_optionsNoAutoAccept (22.54s) --- PASS: TestAccAWSVPCPeeringConnection_plan (30.03s) --- PASS: TestAccAWSVPCPeeringConnection_basic (32.13s) --- PASS: TestAccAWSVPCPeeringConnection_tags (33.94s) --- PASS: TestAccAWSVPCPeeringConnection_region (35.88s) --- PASS: TestAccAWSVPCPeeringConnection_options (57.71s) --- PASS: TestAccAWSVPCPeeringConnection_accept (68.21s) ```
…o use keyvaluetags package (#11907) Reference: #10688 Output from acceptance testing: ``` --- PASS: TestAccAWSInternetGateway_delete (57.40s) --- PASS: TestAccAWSInternetGateway_tags (60.09s) --- PASS: TestAccAWSInternetGateway_basic (77.06s) --- PASS: TestAccDataSourceAwsInternetGateway_typical (42.69s) ```
…e keyvaluetags package (#11918) Reference: #10688 Output from acceptance testing: ``` --- PASS: TestAccDataSourceAwsSecurityGroup_basic (37.66s) --- PASS: TestAccDataSourceAwsSecurityGroups_tag (37.81s) --- PASS: TestAccDataSourceAwsSecurityGroups_filter (38.43s) --- PASS: TestAccAWSDefaultSecurityGroup_basic (33.65s) --- PASS: TestAccAWSDefaultSecurityGroup_classic (10.22s) --- PASS: TestAccAWSSecurityGroup_allowAll (64.34s) --- PASS: TestAccAWSSecurityGroup_basic (33.11s) --- PASS: TestAccAWSSecurityGroup_change (73.42s) --- PASS: TestAccAWSSecurityGroup_CIDRandGroups (59.48s) --- PASS: TestAccAWSSecurityGroup_defaultEgressClassic (70.38s) --- PASS: TestAccAWSSecurityGroup_defaultEgressVPC (43.71s) --- PASS: TestAccAWSSecurityGroup_drift (20.32s) --- PASS: TestAccAWSSecurityGroup_driftComplex (38.09s) --- PASS: TestAccAWSSecurityGroup_egressConfigMode (77.34s) --- PASS: TestAccAWSSecurityGroup_egressWithPrefixList (62.50s) --- PASS: TestAccAWSSecurityGroup_failWithDiffMismatch (49.74s) --- PASS: TestAccAWSSecurityGroup_forceRevokeRulesFalse (690.01s) --- PASS: TestAccAWSSecurityGroup_forceRevokeRulesTrue (732.92s) --- PASS: TestAccAWSSecurityGroup_generatedName (40.25s) --- PASS: TestAccAWSSecurityGroup_ingressConfigMode (57.14s) --- PASS: TestAccAWSSecurityGroup_ingressWithCidrAndSGsClassic (27.95s) --- PASS: TestAccAWSSecurityGroup_ingressWithCidrAndSGsVPC (45.17s) --- PASS: TestAccAWSSecurityGroup_ingressWithPrefixList (51.39s) --- PASS: TestAccAWSSecurityGroup_invalidCIDRBlock (2.23s) --- PASS: TestAccAWSSecurityGroup_IPRangeAndSecurityGroupWithSameRules (43.29s) --- PASS: TestAccAWSSecurityGroup_IPRangesWithSameRules (45.55s) --- PASS: TestAccAWSSecurityGroup_ipv4andipv6Egress (41.18s) --- PASS: TestAccAWSSecurityGroup_ipv6 (34.86s) --- PASS: TestAccAWSSecurityGroup_multiIngress (53.10s) --- PASS: TestAccAWSSecurityGroup_namePrefix (53.10s) --- PASS: TestAccAWSSecurityGroup_ruleDescription (104.82s) --- PASS: TestAccAWSSecurityGroup_ruleGathering (65.55s) --- PASS: TestAccAWSSecurityGroup_ruleLimitCidrBlockExceededAppend (75.12s) --- PASS: TestAccAWSSecurityGroup_ruleLimitExceededAllNew (83.09s) --- PASS: TestAccAWSSecurityGroup_ruleLimitExceededAppend (73.30s) --- PASS: TestAccAWSSecurityGroup_ruleLimitExceededPrepend (74.60s) --- PASS: TestAccAWSSecurityGroup_rulesDropOnError (73.15s) --- PASS: TestAccAWSSecurityGroup_self (39.02s) --- PASS: TestAccAWSSecurityGroup_sourceSecurityGroup (40.50s) --- PASS: TestAccAWSSecurityGroup_tags (83.69s) --- PASS: TestAccAWSSecurityGroup_vpc (53.47s) --- PASS: TestAccAWSSecurityGroup_vpcNegOneIngress (36.25s) --- PASS: TestAccAWSSecurityGroup_vpcProtoNumIngress (66.03s) ```
Reference: #10688 Replaces `testAccCheckTags()` custom `TestCheckFunc` with the standard Terraform Plugin SDK `resource.TestCheckResourceAttr()` -- nowadays we prefer checking the Terraform state values and checking `ImportStateVerify` for state validity compared to the API. Output from acceptance testing: ``` --- PASS: TestAccDataSourceAwsEip_Id (22.59s) --- PASS: TestAccDataSourceAwsEip_Instance (144.97s) --- PASS: TestAccDataSourceAwsEip_NetworkInterface (54.82s) --- PASS: TestAccDataSourceAwsEip_PublicIP_EC2Classic (14.56s) --- PASS: TestAccAWSAMI_basic (71.24s) --- PASS: TestAccAWSAMI_disappears (57.69s) --- PASS: TestAccAWSAMI_snapshotSize (82.98s) --- PASS: TestAccAWSAMI_tags (98.21s) --- PASS: TestAccAWSInstance_tags (145.87s) --- PASS: TestAccAWSInstancesDataSource_basic (99.26s) --- PASS: TestAccAWSInstancesDataSource_instance_state_names (94.67s) --- PASS: TestAccAWSInstancesDataSource_tags (83.91s) --- PASS: TestAccAWSInternetGateway_tags (67.39s) --- PASS: TestAccAWSLaunchTemplate_tags (35.69s) --- PASS: TestAccAWSNatGateway_tags (273.08s) --- PASS: TestAccAWSNetworkAcl_OnlyEgressRules (43.22s) --- PASS: TestAccAWSRouteTable_tags (64.47s) --- PASS: TestAccAWSSecurityGroup_tags (71.51s) --- PASS: TestAccAWSVPCPeeringConnection_tags (43.86s) --- PASS: TestAccAWSVpc_tags (74.30s) --- PASS: TestAccAWSVpnGateway_tags (91.97s) --- PASS: TestAccDataSourceAwsSubnetIDs (58.36s) --- PASS: TestAccDataSourceAwsSubnetIDs_filter (48.78s) --- PASS: TestAccDataSourceAwsSubnet_basic (41.70s) --- PASS: TestAccDataSourceAwsSubnet_ipv6ByIpv6CidrBlock (69.88s) --- PASS: TestAccDataSourceAwsSubnet_ipv6ByIpv6Filter (63.06s) --- PASS: TestAccDataSourceAwsVpc_basic (46.32s) --- PASS: TestAccDataSourceAwsVpc_ipv6Associated (45.43s) --- PASS: TestAccDataSourceAwsVpc_multipleCidr (57.43s) --- PASS: TestAccDataSourceAwsVpcPeeringConnection_basic (36.43s) --- PASS: TestAccDataSourceAwsVpcs_basic (32.72s) --- PASS: TestAccDataSourceAwsVpcs_filters (38.44s) --- PASS: TestAccDataSourceAwsVpcs_tags (41.74s) ```
…ashicorp#11094](hashicorp#11094). Modified to use keyvaluetags which for QuickSight were enabled by [hashicorp#12220](hashicorp#12220). Aligns with the [Refactor Resource Tagging Code to use keyvaluetags Package](hashicorp#10688) Added `DefaultTimeout`, 60s for now, and respective wait'n'retry functionality.
Reference: #10688 Replaces `testAccCheckTags()` custom `TestCheckFunc` with the standard Terraform Plugin SDK `resource.TestCheckResourceAttr()` -- nowadays we prefer checking the Terraform state values and checking `ImportStateVerify` for state validity compared to the API. Output from acceptance testing: ``` --- PASS: TestAccDataSourceAwsEip_Id (22.59s) --- PASS: TestAccDataSourceAwsEip_Instance (144.97s) --- PASS: TestAccDataSourceAwsEip_NetworkInterface (54.82s) --- PASS: TestAccDataSourceAwsEip_PublicIP_EC2Classic (14.56s) --- PASS: TestAccAWSAMI_basic (71.24s) --- PASS: TestAccAWSAMI_disappears (57.69s) --- PASS: TestAccAWSAMI_snapshotSize (82.98s) --- PASS: TestAccAWSAMI_tags (98.21s) --- PASS: TestAccAWSInstance_tags (145.87s) --- PASS: TestAccAWSInstancesDataSource_basic (99.26s) --- PASS: TestAccAWSInstancesDataSource_instance_state_names (94.67s) --- PASS: TestAccAWSInstancesDataSource_tags (83.91s) --- PASS: TestAccAWSInternetGateway_tags (67.39s) --- PASS: TestAccAWSLaunchTemplate_tags (35.69s) --- PASS: TestAccAWSNatGateway_tags (273.08s) --- PASS: TestAccAWSNetworkAcl_OnlyEgressRules (43.22s) --- PASS: TestAccAWSRouteTable_tags (64.47s) --- PASS: TestAccAWSSecurityGroup_tags (71.51s) --- PASS: TestAccAWSVPCPeeringConnection_tags (43.86s) --- PASS: TestAccAWSVpc_tags (74.30s) --- PASS: TestAccAWSVpnGateway_tags (91.97s) --- PASS: TestAccDataSourceAwsSubnetIDs (58.36s) --- PASS: TestAccDataSourceAwsSubnetIDs_filter (48.78s) --- PASS: TestAccDataSourceAwsSubnet_basic (41.70s) --- PASS: TestAccDataSourceAwsSubnet_ipv6ByIpv6CidrBlock (69.88s) --- PASS: TestAccDataSourceAwsSubnet_ipv6ByIpv6Filter (63.06s) --- PASS: TestAccDataSourceAwsVpc_basic (46.32s) --- PASS: TestAccDataSourceAwsVpc_ipv6Associated (45.43s) --- PASS: TestAccDataSourceAwsVpc_multipleCidr (57.43s) --- PASS: TestAccDataSourceAwsVpcPeeringConnection_basic (36.43s) --- PASS: TestAccDataSourceAwsVpcs_basic (32.72s) --- PASS: TestAccDataSourceAwsVpcs_filters (38.44s) --- PASS: TestAccDataSourceAwsVpcs_tags (41.74s) ```
This has been released in version 2.53.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
Description
Since its inception, the Terraform AWS Provider has supported resource tagging on various Terraform resources. While in theory most resource tagging looks similar to practitioners (a simple key-value mapping), in practice there are underlying differences between how each AWS service API implements tagging support. Another challenge within this space is that the AWS Go SDK implementation itself can differ (e.g. whether a key-value map or struct containing a Key and Value field) and that each AWS service has its own Go types in the latter implementation.
The internal
keyvaluetags
package was introduced into this codebase to provide a consistent interface for handling AWS resource key-value tags. Using this package simplifies the process of adding support for resource tagging and will allow for much easier implementation of provider-wide enhancements for tagging support, such as the ability to specify default tags and tags to ignore for all resources under a provider (e.g. #7926). To sustainably support those enhancements, a refactoring of the existing resources to use the new package needs to occur.The existing tagging code across AWS services in the Terraform AWS Provider varies on a few dimensions:
map[string]*string
versus an AWS Go SDK specific type (e.g.[]*eks.Tag
)aws/tagsXXX.go
fileEach of these will slightly vary the refactoring instructions, however in principle the highest level of the refactoring process is:
Read
function to using thekeyvaluetags
packageCreate
,Read
, andUpdate
functions to using thekeyvaluetags
packageaws/tagsXXX.go
and associatedaws/tagsXXX_test.go
filesTo prevent lengthy review processes and overlapping contributions, this refactoring should preferably be performed per resource for AWS services that support tagging across more than (roughly) three datasources/resources or can be done at once for an entire AWS service with a smaller implementation. Any functionality missing from the
keyvaluetags
library should preferably be submitted separately.Below is additional technical information to help guide this refactoring process and the refactoring checklist.
Refactoring Process
In the all cases, the data source or resource Go file (e.g.
aws/resource_aws_eks_cluster.go
) will need a new import:"github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags"
Data Source or Resource Read Function
If the tags are returned in the API response for retrieving the data source or resource, you may see code like the following:
This can be replaced similar to the below (where
Ec2
should be replaced with the relevant service name):Otherwise, if the tags are returned by making a separate API call, you may see code like the following:
Both of these can be replaced similar to the below (where
Ecr
should be replaced with the relevant service name andarn
generally containing the resource ARN or ID used to fetch the tags):Resource Create Function
If the resource supports tagging on creation, you may see code like the following in the input:
This can be replaced similar to the below (where
Ecr
should be replaced with the relevant service name):Otherwise, if the resource requires a separate API call to tag a resource after recreation, it can be replaced similar to the below (where
Ec2
should be replaced with the relevant service name andd.Id()
replaced with the appropriate resource ARN or ID to update the tags):Resource Update Function
You may see code like the following (with or without the
if d.HasChange("tags")
conditional):Both of these can be replaced similar to the below (where
Ecr
should be replaced with the relevant service name,arn
generally containing the resource ARN or ID used to update the tags, and adding theif d.HasChange("tags") {
if missing in the update function):Removing Service Tagging Files
Once the codebase is no longer using any functions from them, any relevant
aws/tags{SERVICE}.go
andaws/tags{SERVICE}_test.go
files can be removed. If these unused functions are left in the codebase during a pull request, the pull request testing will flag these. You can runmake lint
locally to check for unused functions before submission, if you desire.Additional References
If you would like to contribute, but are stuck in the details, these references may also help:
Create
,Read
, andUpdate
functionality with thekeyvaluetags
package.Definition of Done
aws/data_source_aws_acmpca_certificate_authority.go
aws/data_source_aws_ami.go
aws/data_source_aws_cloudformation_stack.go
aws/data_source_aws_customer_gateway.go
aws/data_source_aws_db_cluster_snapshot.go
aws/data_source_aws_db_instance.go
aws/data_source_aws_dynamodb_table.go
aws/data_source_aws_ebs_snapshot.go
aws/data_source_aws_ebs_volume.go
aws/data_source_aws_ec2_transit_gateway.go
aws/data_source_aws_ec2_transit_gateway_dx_gateway_attachment.go
aws/data_source_aws_ec2_transit_gateway_route_table.go
aws/data_source_aws_ec2_transit_gateway_vpc_attachment.go
aws/data_source_aws_ec2_transit_gateway_vpn_attachment.go
aws/data_source_aws_ecr_repository.go
aws/data_source_aws_efs_file_system.go
aws/data_source_aws_eip.go
aws/data_source_aws_eks_cluster.go
aws/data_source_aws_elasticache_cluster.go
aws/data_source_aws_elasticsearch_domain.go
aws/data_source_aws_elb.go
aws/data_source_aws_instance.go
aws/data_source_aws_internet_gateway.go
aws/data_source_aws_kinesis_stream.go
aws/data_source_aws_lambda_function.go
aws/data_source_aws_launch_template.go
aws/data_source_aws_lb.go
aws/data_source_aws_lb_target_group.go
aws/data_source_aws_mq_broker.go
aws/data_source_aws_msk_cluster.go
aws/data_source_aws_nat_gateway.go
aws/data_source_aws_network_acls.go
aws/data_source_aws_network_interface.go
aws/data_source_aws_network_interfaces.go
aws/data_source_aws_ram_resource_share.go
aws/data_source_aws_rds_cluster.go
aws/data_source_aws_redshift_cluster.go
aws/data_source_aws_route53_resolver_rule.go
aws/data_source_aws_route53_zone.go
aws/data_source_aws_route_table.go
aws/data_source_aws_route_tables.go
aws/data_source_aws_s3_bucket_object.go
aws/data_source_aws_secretsmanager_secret.go
aws/data_source_aws_security_group.go
aws/data_source_aws_security_groups.go
aws/data_source_aws_subnet.go
aws/data_source_aws_subnet_ids.go
aws/data_source_aws_vpc.go
aws/data_source_aws_vpc_dhcp_options.go
aws/data_source_aws_vpc_endpoint.go
aws/data_source_aws_vpc_endpoint_service.go
aws/data_source_aws_vpc_peering_connection.go
aws/data_source_aws_vpcs.go
aws/data_source_aws_vpn_gateway.go
aws/resource_aws_acm_certificate.go
aws/resource_aws_acmpca_certificate_authority.go
aws/resource_aws_ami.go
aws/resource_aws_ami_copy.go
aws/resource_aws_ami_from_instance.go
aws/resource_aws_api_gateway_api_key.go
aws/resource_aws_api_gateway_client_certificate.go
aws/resource_aws_api_gateway_domain_name.go
aws/resource_aws_api_gateway_rest_api.go
aws/resource_aws_api_gateway_stage.go
aws/resource_aws_api_gateway_usage_plan.go
aws/resource_aws_api_gateway_vpc_link.go
aws/resource_aws_appmesh_mesh.go
aws/resource_aws_appmesh_route.go
aws/resource_aws_appmesh_virtual_node.go
aws/resource_aws_appmesh_virtual_router.go
aws/resource_aws_appmesh_virtual_service.go
aws/resource_aws_appsync_graphql_api.go
aws/resource_aws_athena_workgroup.go
(skip for now)aws/resource_aws_autoscaling_group.go
aws/resource_aws_backup_plan.go
aws/resource_aws_backup_vault.go
aws/resource_aws_batch_compute_environment.go
aws/resource_aws_cloudformation_stack.go
aws/resource_aws_cloudformation_stack_set.go
aws/resource_aws_cloudfront_distribution.go
aws/resource_aws_cloudhsm2_cluster.go
aws/resource_aws_cloudtrail.go
aws/resource_aws_cloudwatch_event_rule.go
aws/resource_aws_cloudwatch_log_group.go
aws/resource_aws_cloudwatch_metric_alarm.go
aws/resource_aws_codebuild_project.go
aws/resource_aws_codecommit_repository.go
aws/resource_aws_codepipeline.go
aws/resource_aws_codepipeline_webhook.go
aws/resource_aws_cognito_identity_pool.go
aws/resource_aws_cognito_user_pool.go
aws/resource_aws_config_aggregate_authorization.go
aws/resource_aws_config_config_rule.go
aws/resource_aws_config_configuration_aggregator.go
aws/resource_aws_customer_gateway.go
aws/resource_aws_datapipeline_pipeline.go
aws/resource_aws_datasync_agent.go
aws/resource_aws_datasync_location_efs.go
aws/resource_aws_datasync_location_nfs.go
aws/resource_aws_datasync_location_s3.go
aws/resource_aws_datasync_task.go
aws/resource_aws_dax_cluster.go
aws/resource_aws_db_cluster_snapshot.go
aws/resource_aws_db_event_subscription.go
aws/resource_aws_db_instance.go
aws/resource_aws_db_option_group.go
aws/resource_aws_db_parameter_group.go
aws/resource_aws_db_security_group.go
aws/resource_aws_db_snapshot.go
aws/resource_aws_db_subnet_group.go
aws/resource_aws_default_network_acl.go
aws/resource_aws_default_route_table.go
aws/resource_aws_directory_service_directory.go
aws/resource_aws_dms_endpoint.go
aws/resource_aws_dms_replication_instance.go
aws/resource_aws_dms_replication_subnet_group.go
aws/resource_aws_dms_replication_task.go
aws/resource_aws_docdb_cluster.go
aws/resource_aws_docdb_cluster_instance.go
aws/resource_aws_docdb_cluster_parameter_group.go
aws/resource_aws_docdb_subnet_group.go
aws/resource_aws_dx_connection.go
aws/resource_aws_dx_hosted_private_virtual_interface_accepter.go
aws/resource_aws_dx_hosted_public_virtual_interface_accepter.go
aws/resource_aws_dx_lag.go
aws/resource_aws_dx_private_virtual_interface.go
aws/resource_aws_dx_public_virtual_interface.go
aws/resource_aws_dx_transit_virtual_interface.go
aws/resource_aws_dynamodb_table.go
aws/resource_aws_ebs_snapshot.go
aws/resource_aws_ebs_snapshot_copy.go
aws/resource_aws_ebs_volume.go
aws/resource_aws_ec2_capacity_reservation.go
aws/resource_aws_ec2_client_vpn_endpoint.go
aws/resource_aws_ec2_fleet.go
aws/resource_aws_ec2_transit_gateway.go
aws/resource_aws_ec2_transit_gateway_route_table.go
aws/resource_aws_ec2_transit_gateway_vpc_attachment.go
aws/resource_aws_ec2_transit_gateway_vpc_attachment_accepter.go
aws/resource_aws_ecr_repository.go
aws/resource_aws_ecs_cluster.go
aws/resource_aws_ecs_service.go
aws/resource_aws_ecs_task_definition.go
aws/resource_aws_efs_file_system.go
aws/resource_aws_eip.go
aws/resource_aws_eks_cluster.go
aws/resource_aws_elastic_beanstalk_application.go
aws/resource_aws_elastic_beanstalk_application_version.go
aws/resource_aws_elastic_beanstalk_environment.go
aws/resource_aws_elasticache_cluster.go
aws/resource_aws_elasticache_replication_group.go
aws/resource_aws_elasticsearch_domain.go
aws/resource_aws_elb.go
aws/resource_aws_emr_cluster.go
aws/resource_aws_fsx_lustre_file_system.go
aws/resource_aws_fsx_windows_file_system.go
aws/resource_aws_glacier_vault.go
aws/resource_aws_glue_crawler.go
aws/resource_aws_glue_job.go
aws/resource_aws_glue_trigger.go
aws/resource_aws_iam_role.go
aws/resource_aws_iam_user.go
aws/resource_aws_inspector_resource_group.go
aws/resource_aws_instance.go
aws/resource_aws_internet_gateway.go
aws/resource_aws_kinesis_analytics_application.go
aws/resource_aws_kinesis_firehose_delivery_stream.go
aws/resource_aws_kinesis_stream.go
aws/resource_aws_kms_external_key.go
aws/resource_aws_kms_key.go
aws/resource_aws_lambda_function.go
aws/resource_aws_launch_template.go
aws/resource_aws_lb.go
aws/resource_aws_lb_target_group.go
aws/resource_aws_licensemanager_license_configuration.go
aws/resource_aws_lightsail_instance.go
aws/resource_aws_media_package_channel.go
aws/resource_aws_media_store_container.go
aws/resource_aws_mq_broker.go
aws/resource_aws_mq_configuration.go
aws/resource_aws_msk_cluster.go
aws/resource_aws_nat_gateway.go
aws/resource_aws_neptune_cluster.go
aws/resource_aws_neptune_cluster_instance.go
aws/resource_aws_neptune_cluster_parameter_group.go
aws/resource_aws_neptune_event_subscription.go
aws/resource_aws_neptune_parameter_group.go
aws/resource_aws_neptune_subnet_group.go
aws/resource_aws_network_acl.go
aws/resource_aws_network_interface.go
aws/resource_aws_opsworks_stack.go
aws/resource_aws_organizations_account.go
aws/resource_aws_pinpoint_app.go
aws/resource_aws_ram_resource_share.go
aws/resource_aws_rds_cluster.go
aws/resource_aws_rds_cluster_instance.go
aws/resource_aws_rds_cluster_parameter_group.go
aws/resource_aws_redshift_cluster.go
aws/resource_aws_redshift_event_subscription.go
aws/resource_aws_redshift_parameter_group.go
aws/resource_aws_redshift_snapshot_copy_grant.go
aws/resource_aws_redshift_snapshot_schedule.go
aws/resource_aws_redshift_subnet_group.go
aws/resource_aws_route53_health_check.go
aws/resource_aws_route53_resolver_endpoint.go
aws/resource_aws_route53_resolver_rule.go
aws/resource_aws_route53_zone.go
aws/resource_aws_route_table.go
aws/resource_aws_s3_bucket.go
aws/resource_aws_s3_bucket_metric.go
aws/resource_aws_s3_bucket_object.go
aws/resource_aws_sagemaker_endpoint.go
aws/resource_aws_sagemaker_endpoint_configuration.go
aws/resource_aws_sagemaker_model.go
aws/resource_aws_sagemaker_notebook_instance.go
aws/resource_aws_secretsmanager_secret.go
aws/resource_aws_security_group.go
aws/resource_aws_servicecatalog_portfolio.go
aws/resource_aws_sfn_activity.go
aws/resource_aws_sfn_state_machine.go
aws/resource_aws_sns_topic.go
aws/resource_aws_spot_fleet_request.go
aws/resource_aws_spot_instance_request.go
aws/resource_aws_sqs_queue.go
aws/resource_aws_ssm_activation.go
aws/resource_aws_ssm_document.go
aws/resource_aws_ssm_maintenance_window.go
aws/resource_aws_ssm_parameter.go
aws/resource_aws_ssm_patch_baseline.go
aws/resource_aws_storagegateway_cached_iscsi_volume.go
aws/resource_aws_storagegateway_gateway.go
aws/resource_aws_storagegateway_nfs_file_share.go
aws/resource_aws_storagegateway_smb_file_share.go
aws/resource_aws_subnet.go
aws/resource_aws_swf_domain.go
aws/resource_aws_transfer_server.go
aws/resource_aws_transfer_user.go
aws/resource_aws_vpc.go
aws/resource_aws_vpc_dhcp_options.go
aws/resource_aws_vpc_endpoint.go
aws/resource_aws_vpc_endpoint_service.go
aws/resource_aws_vpc_peering_connection.go
aws/resource_aws_vpc_peering_connection_accepter.go
aws/resource_aws_vpn_connection.go
aws/resource_aws_vpn_gateway.go
aws/resource_aws_waf_rate_based_rule.go
aws/resource_aws_waf_rule.go
aws/resource_aws_waf_rule_group.go
aws/resource_aws_waf_web_acl.go
aws/resource_aws_wafregional_rate_based_rule.go
aws/resource_aws_wafregional_rule.go
aws/resource_aws_wafregional_rule_group.go
aws/resource_aws_wafregional_web_acl.go
The text was updated successfully, but these errors were encountered: