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

provider: Implement ignore tags functionality across all data sources and resources #13039

Merged
merged 1 commit into from
Apr 30, 2020

Conversation

bflad
Copy link
Contributor

@bflad bflad 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

Closes #10689

Release note for CHANGELOG:

NOTES:

* provider: Ignore tags functionality across all resources via the provider-level `ignore_tags` configuration block has been enabled and this functionality is no longer considered in preview.

ENHANCEMENTS:

* provider: Implement ignore functionality across all data sources and resources (except aws_autoscaling_group)

Implements a static analysis check to verify the inclusion of the IgnoreConfig() call within d.Set("tags", /* ... */) implementations. Acceptance testing for the ignore tags functionality is handled at the provider level and only the aws_subnet and aws_vpc resources to verify. This choice was a pragmatic compromise given there is static analysis enforcement of the implementation and approved via HashiCorp RFC process.

The aws_dynamodb_table data source and resource were missing their keyvaluetags implementation. This rectifies this for consistency with the rest of the provider resources.

Output from acceptance testing (DynamoDB Tables only as smoke test and since its implementation was adjusted to keyvaluetags):

--- PASS: TestAccDataSourceAwsDynamoDbTable_basic (44.65s)

--- PASS: TestAccAWSDynamoDbTable_attributeUpdate (507.13s)
--- PASS: TestAccAWSDynamoDbTable_attributeUpdateValidation (6.81s)
--- PASS: TestAccAWSDynamoDbTable_basic (31.10s)
--- PASS: TestAccAWSDynamoDbTable_BillingMode_GSI_PayPerRequestToProvisioned (70.75s)
--- PASS: TestAccAWSDynamoDbTable_BillingMode_GSI_ProvisionedToPayPerRequest (1199.18s)
--- PASS: TestAccAWSDynamoDbTable_BillingMode_PayPerRequestToProvisioned (54.48s)
--- PASS: TestAccAWSDynamoDbTable_BillingMode_ProvisionedToPayPerRequest (1070.16s)
--- PASS: TestAccAWSDynamoDbTable_disappears (25.90s)
--- PASS: TestAccAWSDynamoDbTable_disappears_PayPerRequestWithGSI (78.70s)
--- PASS: TestAccAWSDynamoDbTable_enablePitr (67.70s)
--- PASS: TestAccAWSDynamoDbTable_encryption (167.85s)
--- PASS: TestAccAWSDynamoDbTable_extended (189.24s)
--- PASS: TestAccAWSDynamoDbTable_gsiUpdateCapacity (72.21s)
--- PASS: TestAccAWSDynamoDbTable_gsiUpdateNonKeyAttributes (197.54s)
--- PASS: TestAccAWSDynamoDbTable_gsiUpdateOtherAttributes (498.37s)
--- PASS: TestAccAWSDynamoDbTable_Replica (482.28s)
--- PASS: TestAccAWSDynamoDbTable_streamSpecification (69.19s)
--- PASS: TestAccAWSDynamoDbTable_streamSpecificationValidation (5.38s)
--- PASS: TestAccAWSDynamoDbTable_tags (50.77s)
--- PASS: TestAccAWSDynamoDbTable_Ttl_Disabled (45.57s)
--- PASS: TestAccAWSDynamoDbTable_Ttl_Enabled (31.79s)

… resources

Reference: #10689

Changes:

```
NOTES:

* provider: Ignore tags functionality across all resources via the provider-level `ignore_tags` configuration block has been enabled and this functionality is no longer considered in preview.

ENHANCEMENTS:

* provider: Implement ignore functionality across all data sources and resources (except aws_autoscaling_group)
```

Implements a static analysis check to verify the inclusion of the `IgnoreConfig()` call within `d.Set("tags", /* ... */)` implementations. Acceptance testing for the ignore tags functionality is handled at the provider level and only the `aws_subnet` and `aws_vpc` resources to verify. This choice was a pragmatic compromise given there is static analysis enforcement of the implementation and approved via HashiCorp RFC process.

The `aws_dynamodb_table` data source and resource were missing their `keyvaluetags` implementation. This rectifies this for consistency with the rest of the provider resources.

Output from acceptance testing (DynamoDB Tables only as smoke test and since its implementation was adjusted to keyvaluetags):

```
--- PASS: TestAccDataSourceAwsDynamoDbTable_basic (44.65s)

--- PASS: TestAccAWSDynamoDbTable_attributeUpdate (507.13s)
--- PASS: TestAccAWSDynamoDbTable_attributeUpdateValidation (6.81s)
--- PASS: TestAccAWSDynamoDbTable_basic (31.10s)
--- PASS: TestAccAWSDynamoDbTable_BillingMode_GSI_PayPerRequestToProvisioned (70.75s)
--- PASS: TestAccAWSDynamoDbTable_BillingMode_GSI_ProvisionedToPayPerRequest (1199.18s)
--- PASS: TestAccAWSDynamoDbTable_BillingMode_PayPerRequestToProvisioned (54.48s)
--- PASS: TestAccAWSDynamoDbTable_BillingMode_ProvisionedToPayPerRequest (1070.16s)
--- PASS: TestAccAWSDynamoDbTable_disappears (25.90s)
--- PASS: TestAccAWSDynamoDbTable_disappears_PayPerRequestWithGSI (78.70s)
--- PASS: TestAccAWSDynamoDbTable_enablePitr (67.70s)
--- PASS: TestAccAWSDynamoDbTable_encryption (167.85s)
--- PASS: TestAccAWSDynamoDbTable_extended (189.24s)
--- PASS: TestAccAWSDynamoDbTable_gsiUpdateCapacity (72.21s)
--- PASS: TestAccAWSDynamoDbTable_gsiUpdateNonKeyAttributes (197.54s)
--- PASS: TestAccAWSDynamoDbTable_gsiUpdateOtherAttributes (498.37s)
--- PASS: TestAccAWSDynamoDbTable_Replica (482.28s)
--- PASS: TestAccAWSDynamoDbTable_streamSpecification (69.19s)
--- PASS: TestAccAWSDynamoDbTable_streamSpecificationValidation (5.38s)
--- PASS: TestAccAWSDynamoDbTable_tags (50.77s)
--- PASS: TestAccAWSDynamoDbTable_Ttl_Disabled (45.57s)
--- PASS: TestAccAWSDynamoDbTable_Ttl_Enabled (31.79s)
```
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. provider Pertains to the provider itself, rather than any interaction with AWS. labels Apr 27, 2020
@bflad bflad requested a review from a team April 27, 2020 17:08
@ghost ghost added size/XXL Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. service/acm Issues and PRs that pertain to the acm service. service/acmpca Issues and PRs that pertain to the acmpca service. service/apigateway Issues and PRs that pertain to the apigateway service. service/cloudformation Issues and PRs that pertain to the cloudformation service. service/cloudfront Issues and PRs that pertain to the cloudfront service. service/cloudwatchlogs service/directconnect Issues and PRs that pertain to the directconnect service. service/dynamodb Issues and PRs that pertain to the dynamodb service. service/ec2 Issues and PRs that pertain to the ec2 service. service/ecr Issues and PRs that pertain to the ecr service. service/efs Issues and PRs that pertain to the efs service. service/eks Issues and PRs that pertain to the eks service. service/elasticache Issues and PRs that pertain to the elasticache service. service/elasticsearch Issues and PRs that pertain to the elasticsearch service. service/elb Issues and PRs that pertain to the elb service. service/rds Issues and PRs that pertain to the rds service. labels Apr 27, 2020
@bflad bflad removed the needs-triage Waiting for first response or review from a maintainer. label Apr 27, 2020
@bflad bflad changed the title provider: Implement ignore tags functionality across all data sources resources provider: Implement ignore tags functionality across all data sources and resources Apr 27, 2020
Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

--- SKIP: TestAccAWSAcmCertificateDataSource_multipleIssued (0.00s)
--- SKIP: TestAccAWSAcmCertificateDataSource_singleIssued (0.00s)
--- SKIP: TestAccAWSAcmCertificateDataSource_noMatchReturnsError (0.00s)
--- PASS: TestAccAWSCloudwatchLogGroupDataSource_retention (13.38s)
--- PASS: TestAccAWSCloudwatchLogGroupDataSource_basic (13.47s)
--- PASS: TestAccAWSAmiDataSource_instanceStore (13.66s)
--- PASS: TestAccAWSCloudwatchLogGroupDataSource_tags (13.93s)
--- PASS: TestAccDataSourceAwsApiGatewayApiKey (14.10s)
--- PASS: TestAccDataSourceAwsApiGatewayRestApi (14.60s)
--- SKIP: TestAccAWSDbInstanceDataSource_ec2Classic (1.13s)
--- PASS: TestAccAWSAmiDataSource_natInstance (15.08s)
--- PASS: TestAccAWSAmiDataSource_windowsInstance (16.80s)
--- PASS: TestAccDataSourceAwsAcmpcaCertificateAuthority_Basic (16.94s)
--- PASS: TestAccAWSAcmCertificateDataSource_KeyTypes (17.48s)
--- PASS: TestAccAWSAmiDataSource_localNameFilter (18.60s)
--- PASS: TestAccAWSCustomerGatewayDataSource_Filter (22.77s)
--- PASS: TestAccAWSCustomerGatewayDataSource_ID (23.33s)
--- PASS: TestAccAWSCloudwatchLogGroupDataSource_kms (32.62s)
--- PASS: TestAccAWSEbsVolumeDataSource_basic (20.38s)
--- PASS: TestAccAWSEbsVolumeDataSource_multipleFilters (19.92s)
--- PASS: TestAccDataSourceAwsDynamoDbTable_basic (26.37s)
--- FAIL: TestAccAWSEc2TransitGatewayVpcAttachmentDataSource_Filter (8.63s)
--- PASS: TestAccAWSEbsSnapshotDataSource_basic (35.53s)
--- PASS: TestAccAWSEbsSnapshotDataSource_Filter (35.82s)
--- FAIL: TestAccAWSEc2TransitGatewayVpcAttachmentDataSource_ID (8.80s)
--- PASS: TestAccAWSCloudFormationStack_dataSource_basic (62.43s)
--- PASS: TestAccAWSCloudFormationStack_dataSource_yaml (63.66s)
--- PASS: TestAccAWSEcrDataSource_ecrImage (7.95s)
--- FAIL: TestAccAWSEc2TransitGatewayVpnAttachmentDataSource_TransitGatewayIdAndVpnConnectionId (16.64s)
--- FAIL: TestAccAWSEc2TransitGatewayVpnAttachmentDataSource_filter (16.62s)
--- PASS: TestAccAWSEbsSnapshotDataSource_MostRecent (51.27s)
--- PASS: TestAccAWSEcrDataSource_ecrRepository (8.41s)
--- PASS: TestAccDataSourceAwsEip_Filter (8.70s)
--- PASS: TestAccDataSourceAwsEip_Id (8.81s)
--- PASS: TestAccDataSourceAwsEfsFileSystem_id (15.86s)
--- PASS: TestAccDataSourceAwsEip_PublicIP_VPC (9.31s)
--- PASS: TestAccDataSourceAwsEfsFileSystem_name (16.24s)
--- PASS: TestAccDataSourceAwsEip_PublicIP_EC2Classic (14.57s)
--- PASS: TestAccDataSourceAwsEip_Tags (8.95s)
--- PASS: TestAccDataSourceAwsEip_NetworkInterface (23.14s)
--- PASS: TestAccDataSourceAWSELB_basic (17.02s)
--- FAIL: TestAccAWSDbClusterSnapshotDataSource_MostRecent (147.82s)
--- PASS: TestAccAWSDbClusterSnapshotDataSource_DbClusterSnapshotIdentifier (163.78s)
--- PASS: TestAccAWSCloudFormationStack_basic (58.56s)
--- PASS: TestAccDataSourceAwsEip_Instance (110.09s)
--- PASS: TestAccAWSDbClusterSnapshotDataSource_DbClusterIdentifier (204.92s)
--- PASS: TestAccAWSEc2TransitGatewayDataSource_Filter (178.56s)
--- PASS: TestAccAWSEc2TransitGatewayDataSource_ID (178.65s)
--- PASS: TestAccAWSCloudFormationStack_yaml (58.59s)
--- PASS: TestAccAWSCloudFormationStack_disappears (61.38s)
--- PASS: TestAccAWSCloudFormationStack_defaultParams (58.97s)
--- PASS: TestAccAWSCloudFormationStack_allAttributes (63.98s)
--- PASS: TestAccAWSCloudFormationStack_withTransform (40.45s)
--- PASS: TestAccAWSCloudFormationStack_withUrl_withParams_withYaml (62.48s)
--- PASS: TestAccAWSCloudFormationStack_withUrl_withParams_noUpdate (68.55s)
--- PASS: TestAccAWSCloudFormationStack_withParams (108.75s)
--- PASS: TestAccAWSEc2TransitGatewayRouteTableDataSource_ID (295.31s)
--- PASS: TestAccAWSEc2TransitGatewayRouteTableDataSource_Filter (305.02s)
--- PASS: TestAccAWSCloudFormationStack_withUrl_withParams (114.09s)
--- PASS: TestAccDataSourceAwsDirectoryServiceDirectory_SimpleAD (505.86s)
--- PASS: TestAccAWSDataElasticacheCluster_basic (442.15s)
--- PASS: TestAccAWSDbInstanceDataSource_basic (526.21s)
--- PASS: TestAccDataSourceAwsApiGatewayVpcLink (688.38s)
--- PASS: TestAccAWSDataElasticsearchDomain_basic (720.87s)
--- PASS: TestAccAWSEc2TransitGatewayDxGatewayAttachmentDataSource_TransitGatewayIdAndDxGatewayId (1050.68s)
--- PASS: TestAccAWSDataSourceCloudFrontDistribution_basic (1147.92s)
--- PASS: TestAccAWSDataElasticsearchDomain_advanced (1127.86s)
--- PASS: TestAccAWSEc2TransitGatewayDxGatewayAttachmentDataSource_filter (1214.05s)
--- PASS: TestAccAWSEksClusterDataSource_basic (1347.06s)
--- PASS: TestAccDataSourceAwsDirectoryServiceDirectory_MicrosoftAD (1801.73s)

Does not introduce any new failures

@bflad bflad merged commit 7ce1660 into master Apr 30, 2020
@bflad bflad deleted the f-ignore-tags branch April 30, 2020 12:30
bflad added a commit that referenced this pull request Apr 30, 2020
@ghost
Copy link

ghost commented May 1, 2020

This has been released in version 2.60.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 May 30, 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 May 30, 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. provider Pertains to the provider itself, rather than any interaction with AWS. service/acm Issues and PRs that pertain to the acm service. service/acmpca Issues and PRs that pertain to the acmpca service. service/apigateway Issues and PRs that pertain to the apigateway service. service/cloudformation Issues and PRs that pertain to the cloudformation service. service/cloudfront Issues and PRs that pertain to the cloudfront service. service/directconnect Issues and PRs that pertain to the directconnect service. service/dynamodb Issues and PRs that pertain to the dynamodb service. service/ec2 Issues and PRs that pertain to the ec2 service. service/ecr Issues and PRs that pertain to the ecr service. service/efs Issues and PRs that pertain to the efs service. service/eks Issues and PRs that pertain to the eks service. service/elasticache Issues and PRs that pertain to the elasticache service. service/elasticsearch Issues and PRs that pertain to the elasticsearch service. service/elb Issues and PRs that pertain to the elb service. service/rds Issues and PRs that pertain to the rds service. size/XXL Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Provider Ignore Tags Functionality Across All Resources
2 participants