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

Implement Provider Ignore Tags Functionality Across All Resources #10689

Closed
bflad opened this issue Oct 31, 2019 · 4 comments · Fixed by #13039
Closed

Implement Provider Ignore Tags Functionality Across All Resources #10689

bflad opened this issue Oct 31, 2019 · 4 comments · Fixed by #13039
Assignees
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/ec2 Issues and PRs that pertain to the ec2 service.
Milestone

Comments

@bflad
Copy link
Contributor

bflad commented Oct 31, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

This issue is currently a placeholder for future work and should not be implemented at this time. The writeup here is dependent on the refactoring from #10688 and based off the proof of concept contained in #10418. The implementation details of this issue may change.

Historically, the Terraform AWS Provider has taken a holistic approach to managing resource tagging for a resource, by requiring complete management of all tag keys and values or ignoring them on a per-resource basis using the resource lifecycle configuration block ignore_changes functionality:

# Terraform 0.12 syntax
resource "aws_vpc" "example" {
  # ... other configuration ...

  lifecycle {
    ignore_changes = [tags]
  }
}

Especially in Terraform 0.12, the ability to ignore a specific tag key requires first configuring it.

Certain external systems such as Configuration Management Databases or Kubernetes deployments, may be creating and managing specific resource tags outside of Terraform's control to numerous resources, that operators do not wish to remove, ignore, or otherwise change.

To help in these situations, the Terraform AWS Provider in the future will support ignoring tags across all resources under a specific provider configuration, e.g.

# Proof of Concept implementation, both arguments are optional
provider "aws" {
  ignore_tags {
    key_prefixes = ["keyprefix"]
    keys         = ["exactkey"]
  }
}

For this functionality to work correctly across all resources, they each must implement some additional logic to get the provider-level ignore tags configuration and filter out those tags.

In the data source or resource Read function, the following can be added:

ignoreTagConfig := meta.(*AWSClient).IgnoreTagsConfig

Where the calls to save the tags attribute to the Terraform state, such as:

d.Set("tags", keyvaluetags.Ec2KeyValueTags(subnet.Tags).IgnoreAws().Map())

Can use the new variables to filter tags:

d.Set("tags", keyvaluetags.Ec2KeyValueTags(subnet.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map())

For completeness this can be checked via acceptance testing similar to the below, however in a pragmatic sense, the acceptance testing of the proof of concept resources cover the functionality already so this additional acceptance testing should likely not be considered a requirement for future resources.

func TestAccAWSVpc_ignoreTags(t *testing.T) {
	var providers []*schema.Provider
	var vpc ec2.Vpc
	resourceName := "aws_vpc.test"

	resource.ParallelTest(t, resource.TestCase{
		PreCheck:          func() { testAccPreCheck(t) },
		ProviderFactories: testAccProviderFactories(&providers),
		CheckDestroy:      testAccCheckVpcDestroy,
		Steps: []resource.TestStep{
			{
				Config: testAccVpcConfigTags,
				Check: resource.ComposeTestCheckFunc(
					testAccCheckVpcExists(resourceName, &vpc),
					testAccCheckVpcUpdateTags(&vpc, nil, map[string]string{"ignorekey1": "ignorevalue1"}),
				),
				ExpectNonEmptyPlan: true,
			},
			{
				Config:   testAccProviderConfigIgnoreTagPrefixes1("ignorekey") + testAccVpcConfigTags,
				PlanOnly: true,
			},
			{
				Config:   testAccProviderConfigIgnoreTags1("ignorekey1") + testAccVpcConfigTags,
				PlanOnly: true,
			},
		},
	})
}

func testAccCheckVpcUpdateTags(vpc *ec2.Vpc, oldTags, newTags map[string]string) resource.TestCheckFunc {
	return func(s *terraform.State) error {
		conn := testAccProvider.Meta().(*AWSClient).ec2conn

		return keyvaluetags.Ec2UpdateTags(conn, aws.StringValue(vpc.VpcId), oldTags, newTags)
	}
}

Affected Resource(s)

The maintainers will decide if these should be completed all at once or in another manner.

  • 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
  • aws/resource_aws_autoscaling_group.go (skip for now)
  • 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_dlm_lifecycle_policy.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

References

@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 Oct 31, 2019
@ghost ghost added the service/ec2 Issues and PRs that pertain to the ec2 service. label Oct 31, 2019
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Oct 31, 2019
@bflad bflad removed needs-triage Waiting for first response or review from a maintainer. service/ec2 Issues and PRs that pertain to the ec2 service. labels Oct 31, 2019
@ghost ghost added the service/ec2 Issues and PRs that pertain to the ec2 service. label Oct 31, 2019
@bflad bflad removed the service/ec2 Issues and PRs that pertain to the ec2 service. label Oct 31, 2019
@ghost ghost added the service/ec2 Issues and PRs that pertain to the ec2 service. label Nov 2, 2019
@paultyng paultyng added good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. help wanted and removed good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. help wanted labels Nov 5, 2019
@bflad bflad self-assigned this Mar 30, 2020
bflad added a commit that referenced this issue Mar 30, 2020
…and shared struct type

Reference: #10689

Based on feedback and for future extensibility.

Output from acceptance testing:

```
--- PASS: TestAccAWSProvider_Endpoints (4.06s)
--- PASS: TestAccAWSProvider_Endpoints_Deprecated (4.04s)
--- PASS: TestAccAWSProvider_IgnoreTags_EmptyConfigurationBlock (3.99s)
--- PASS: TestAccAWSProvider_IgnoreTags_KeyPrefixes_Multiple (4.01s)
--- PASS: TestAccAWSProvider_IgnoreTags_KeyPrefixes_None (4.00s)
--- PASS: TestAccAWSProvider_IgnoreTags_KeyPrefixes_One (4.02s)
--- PASS: TestAccAWSProvider_IgnoreTags_Keys_Multiple (4.02s)
--- PASS: TestAccAWSProvider_IgnoreTags_Keys_None (3.96s)
--- PASS: TestAccAWSProvider_IgnoreTags_Keys_One (4.01s)
--- PASS: TestAccAWSProvider_Region_AwsChina (3.83s)
--- PASS: TestAccAWSProvider_Region_AwsCommercial (3.83s)
--- PASS: TestAccAWSProvider_Region_AwsGovCloudUs (3.77s)

--- PASS: TestAccAWSSubnet_availabilityZoneId (30.61s)
--- PASS: TestAccAWSSubnet_basic (30.88s)
--- PASS: TestAccAWSSubnet_enableIpv6 (49.79s)
--- PASS: TestAccAWSSubnet_ignoreTags (57.70s)
--- PASS: TestAccAWSSubnet_ipv6 (79.46s)

--- PASS: TestAccAWSVpc_AssignGeneratedIpv6CidrBlock (70.48s)
--- PASS: TestAccAWSVpc_basic (29.30s)
--- PASS: TestAccAWSVpc_bothDnsOptionsSet (30.18s)
--- PASS: TestAccAWSVpc_classiclinkDnsSupportOptionSet (31.10s)
--- PASS: TestAccAWSVpc_classiclinkOptionSet (30.48s)
--- PASS: TestAccAWSVpc_coreMismatchedDiffs (25.43s)
--- PASS: TestAccAWSVpc_DisabledDnsSupport (29.98s)
--- PASS: TestAccAWSVpc_disappears (15.64s)
--- PASS: TestAccAWSVpc_ignoreTags (51.16s)
--- PASS: TestAccAWSVpc_tags (48.55s)
--- PASS: TestAccAWSVpc_Tenancy (70.60s)
--- PASS: TestAccAWSVpc_update (44.36s)
```
bflad added a commit that referenced this issue Apr 7, 2020
…and shared struct type (#12586)

Reference: #10689

Based on feedback and for future extensibility.

Output from acceptance testing:

```
--- PASS: TestAccAWSProvider_Endpoints (4.06s)
--- PASS: TestAccAWSProvider_Endpoints_Deprecated (4.04s)
--- PASS: TestAccAWSProvider_IgnoreTags_EmptyConfigurationBlock (3.99s)
--- PASS: TestAccAWSProvider_IgnoreTags_KeyPrefixes_Multiple (4.01s)
--- PASS: TestAccAWSProvider_IgnoreTags_KeyPrefixes_None (4.00s)
--- PASS: TestAccAWSProvider_IgnoreTags_KeyPrefixes_One (4.02s)
--- PASS: TestAccAWSProvider_IgnoreTags_Keys_Multiple (4.02s)
--- PASS: TestAccAWSProvider_IgnoreTags_Keys_None (3.96s)
--- PASS: TestAccAWSProvider_IgnoreTags_Keys_One (4.01s)
--- PASS: TestAccAWSProvider_Region_AwsChina (3.83s)
--- PASS: TestAccAWSProvider_Region_AwsCommercial (3.83s)
--- PASS: TestAccAWSProvider_Region_AwsGovCloudUs (3.77s)

--- PASS: TestAccAWSSubnet_availabilityZoneId (30.61s)
--- PASS: TestAccAWSSubnet_basic (30.88s)
--- PASS: TestAccAWSSubnet_enableIpv6 (49.79s)
--- PASS: TestAccAWSSubnet_ignoreTags (57.70s)
--- PASS: TestAccAWSSubnet_ipv6 (79.46s)

--- PASS: TestAccAWSVpc_AssignGeneratedIpv6CidrBlock (70.48s)
--- PASS: TestAccAWSVpc_basic (29.30s)
--- PASS: TestAccAWSVpc_bothDnsOptionsSet (30.18s)
--- PASS: TestAccAWSVpc_classiclinkDnsSupportOptionSet (31.10s)
--- PASS: TestAccAWSVpc_classiclinkOptionSet (30.48s)
--- PASS: TestAccAWSVpc_coreMismatchedDiffs (25.43s)
--- PASS: TestAccAWSVpc_DisabledDnsSupport (29.98s)
--- PASS: TestAccAWSVpc_disappears (15.64s)
--- PASS: TestAccAWSVpc_ignoreTags (51.16s)
--- PASS: TestAccAWSVpc_tags (48.55s)
--- PASS: TestAccAWSVpc_Tenancy (70.60s)
--- PASS: TestAccAWSVpc_update (44.36s)
```
bflad added a commit that referenced this issue Apr 27, 2020
… 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
Copy link
Contributor Author

bflad commented Apr 27, 2020

Implementation submitted: #13039

@bflad bflad added this to the v2.60.0 milestone Apr 30, 2020
bflad added a commit that referenced this issue Apr 30, 2020
… resources (#13039)

Reference: #10689

Changes:

```
NOTES:

* provider: Ignore tags functionality across all resources (except `aws_autoscaling_group`) 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
Copy link
Contributor Author

bflad commented Apr 30, 2020

Support for the provider level ignore tags functionality across all data sources and resources (except aws_autoscaling_group) has been merged and will release with version 2.60.0 of the Terraform AWS Provider, likely later today. 👍

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

twitty-rival pushed a commit to twitty-rival/terraform-provider-aws that referenced this issue May 6, 2020
…and shared struct type (hashicorp#12586)

Reference: hashicorp#10689

Based on feedback and for future extensibility.

Output from acceptance testing:

```
--- PASS: TestAccAWSProvider_Endpoints (4.06s)
--- PASS: TestAccAWSProvider_Endpoints_Deprecated (4.04s)
--- PASS: TestAccAWSProvider_IgnoreTags_EmptyConfigurationBlock (3.99s)
--- PASS: TestAccAWSProvider_IgnoreTags_KeyPrefixes_Multiple (4.01s)
--- PASS: TestAccAWSProvider_IgnoreTags_KeyPrefixes_None (4.00s)
--- PASS: TestAccAWSProvider_IgnoreTags_KeyPrefixes_One (4.02s)
--- PASS: TestAccAWSProvider_IgnoreTags_Keys_Multiple (4.02s)
--- PASS: TestAccAWSProvider_IgnoreTags_Keys_None (3.96s)
--- PASS: TestAccAWSProvider_IgnoreTags_Keys_One (4.01s)
--- PASS: TestAccAWSProvider_Region_AwsChina (3.83s)
--- PASS: TestAccAWSProvider_Region_AwsCommercial (3.83s)
--- PASS: TestAccAWSProvider_Region_AwsGovCloudUs (3.77s)

--- PASS: TestAccAWSSubnet_availabilityZoneId (30.61s)
--- PASS: TestAccAWSSubnet_basic (30.88s)
--- PASS: TestAccAWSSubnet_enableIpv6 (49.79s)
--- PASS: TestAccAWSSubnet_ignoreTags (57.70s)
--- PASS: TestAccAWSSubnet_ipv6 (79.46s)

--- PASS: TestAccAWSVpc_AssignGeneratedIpv6CidrBlock (70.48s)
--- PASS: TestAccAWSVpc_basic (29.30s)
--- PASS: TestAccAWSVpc_bothDnsOptionsSet (30.18s)
--- PASS: TestAccAWSVpc_classiclinkDnsSupportOptionSet (31.10s)
--- PASS: TestAccAWSVpc_classiclinkOptionSet (30.48s)
--- PASS: TestAccAWSVpc_coreMismatchedDiffs (25.43s)
--- PASS: TestAccAWSVpc_DisabledDnsSupport (29.98s)
--- PASS: TestAccAWSVpc_disappears (15.64s)
--- PASS: TestAccAWSVpc_ignoreTags (51.16s)
--- PASS: TestAccAWSVpc_tags (48.55s)
--- PASS: TestAccAWSVpc_Tenancy (70.60s)
--- PASS: TestAccAWSVpc_update (44.36s)
```
adamdecaf pushed a commit to adamdecaf/terraform-provider-aws that referenced this issue May 28, 2020
…and shared struct type (hashicorp#12586)

Reference: hashicorp#10689

Based on feedback and for future extensibility.

Output from acceptance testing:

```
--- PASS: TestAccAWSProvider_Endpoints (4.06s)
--- PASS: TestAccAWSProvider_Endpoints_Deprecated (4.04s)
--- PASS: TestAccAWSProvider_IgnoreTags_EmptyConfigurationBlock (3.99s)
--- PASS: TestAccAWSProvider_IgnoreTags_KeyPrefixes_Multiple (4.01s)
--- PASS: TestAccAWSProvider_IgnoreTags_KeyPrefixes_None (4.00s)
--- PASS: TestAccAWSProvider_IgnoreTags_KeyPrefixes_One (4.02s)
--- PASS: TestAccAWSProvider_IgnoreTags_Keys_Multiple (4.02s)
--- PASS: TestAccAWSProvider_IgnoreTags_Keys_None (3.96s)
--- PASS: TestAccAWSProvider_IgnoreTags_Keys_One (4.01s)
--- PASS: TestAccAWSProvider_Region_AwsChina (3.83s)
--- PASS: TestAccAWSProvider_Region_AwsCommercial (3.83s)
--- PASS: TestAccAWSProvider_Region_AwsGovCloudUs (3.77s)

--- PASS: TestAccAWSSubnet_availabilityZoneId (30.61s)
--- PASS: TestAccAWSSubnet_basic (30.88s)
--- PASS: TestAccAWSSubnet_enableIpv6 (49.79s)
--- PASS: TestAccAWSSubnet_ignoreTags (57.70s)
--- PASS: TestAccAWSSubnet_ipv6 (79.46s)

--- PASS: TestAccAWSVpc_AssignGeneratedIpv6CidrBlock (70.48s)
--- PASS: TestAccAWSVpc_basic (29.30s)
--- PASS: TestAccAWSVpc_bothDnsOptionsSet (30.18s)
--- PASS: TestAccAWSVpc_classiclinkDnsSupportOptionSet (31.10s)
--- PASS: TestAccAWSVpc_classiclinkOptionSet (30.48s)
--- PASS: TestAccAWSVpc_coreMismatchedDiffs (25.43s)
--- PASS: TestAccAWSVpc_DisabledDnsSupport (29.98s)
--- PASS: TestAccAWSVpc_disappears (15.64s)
--- PASS: TestAccAWSVpc_ignoreTags (51.16s)
--- PASS: TestAccAWSVpc_tags (48.55s)
--- PASS: TestAccAWSVpc_Tenancy (70.60s)
--- PASS: TestAccAWSVpc_update (44.36s)
```
@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/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
2 participants