diff --git a/aws/resource_aws_ram_resource_share.go b/aws/resource_aws_ram_resource_share.go index 1c15f49f5ea..521182d89e6 100644 --- a/aws/resource_aws_ram_resource_share.go +++ b/aws/resource_aws_ram_resource_share.go @@ -45,21 +45,26 @@ func resourceAwsRamResourceShare() *schema.Resource { Default: false, }, - "tags": tagsSchema(), + "tags": tagsSchema(), + "tags_all": tagsSchemaComputed(), }, + + CustomizeDiff: SetTagsDiff, } } func resourceAwsRamResourceShareCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ramconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig + tags := defaultTagsConfig.MergeTags(keyvaluetags.New(d.Get("tags").(map[string]interface{}))) request := &ram.CreateResourceShareInput{ Name: aws.String(d.Get("name").(string)), AllowExternalPrincipals: aws.Bool(d.Get("allow_external_principals").(bool)), } - if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { - request.Tags = keyvaluetags.New(v).IgnoreAws().RamTags() + if len(tags) > 0 { + request.Tags = tags.IgnoreAws().RamTags() } log.Println("[DEBUG] Create RAM resource share request:", request) @@ -87,6 +92,7 @@ func resourceAwsRamResourceShareCreate(d *schema.ResourceData, meta interface{}) func resourceAwsRamResourceShareRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ramconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig request := &ram.GetResourceSharesInput{ @@ -122,8 +128,15 @@ func resourceAwsRamResourceShareRead(d *schema.ResourceData, meta interface{}) e d.Set("name", resourceShare.Name) d.Set("allow_external_principals", resourceShare.AllowExternalPrincipals) - if err := d.Set("tags", keyvaluetags.RamKeyValueTags(resourceShare.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { - return fmt.Errorf("error setting tags: %s", err) + tags := keyvaluetags.RamKeyValueTags(resourceShare.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig) + + //lintignore:AWSR002 + if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { + return fmt.Errorf("error setting tags: %w", err) + } + + if err := d.Set("tags_all", tags.Map()); err != nil { + return fmt.Errorf("error setting tags_all: %w", err) } return nil @@ -151,8 +164,8 @@ func resourceAwsRamResourceShareUpdate(d *schema.ResourceData, meta interface{}) } } - if d.HasChange("tags") { - o, n := d.GetChange("tags") + if d.HasChange("tags_all") { + o, n := d.GetChange("tags_all") if err := keyvaluetags.RamUpdateTags(conn, d.Id(), o, n); err != nil { return fmt.Errorf("error updating RAM resource share (%s) tags: %s", d.Id(), err) diff --git a/aws/resource_aws_rds_cluster.go b/aws/resource_aws_rds_cluster.go index 4e1edb97d16..488e4197000 100644 --- a/aws/resource_aws_rds_cluster.go +++ b/aws/resource_aws_rds_cluster.go @@ -456,8 +456,11 @@ func resourceAwsRDSCluster() *schema.Resource { Default: false, }, - "tags": tagsSchema(), + "tags": tagsSchema(), + "tags_all": tagsSchemaComputed(), }, + + CustomizeDiff: SetTagsDiff, } } @@ -472,7 +475,8 @@ func resourceAwsRdsClusterImport( func resourceAwsRDSClusterCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).rdsconn - tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().RdsTags() + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig + tags := defaultTagsConfig.MergeTags(keyvaluetags.New(d.Get("tags").(map[string]interface{}))) // Some API calls (e.g. RestoreDBClusterFromSnapshot do not support all // parameters to correctly apply all settings in one pass. For missing @@ -502,7 +506,7 @@ func resourceAwsRDSClusterCreate(d *schema.ResourceData, meta interface{}) error EngineMode: aws.String(d.Get("engine_mode").(string)), ScalingConfiguration: expandRdsClusterScalingConfiguration(d.Get("scaling_configuration").([]interface{})), SnapshotIdentifier: aws.String(d.Get("snapshot_identifier").(string)), - Tags: tags, + Tags: tags.IgnoreAws().RdsTags(), } if attr := d.Get("availability_zones").(*schema.Set); attr.Len() > 0 { @@ -606,7 +610,7 @@ func resourceAwsRDSClusterCreate(d *schema.ResourceData, meta interface{}) error S3Prefix: aws.String(s3_bucket["bucket_prefix"].(string)), SourceEngine: aws.String(s3_bucket["source_engine"].(string)), SourceEngineVersion: aws.String(s3_bucket["source_engine_version"].(string)), - Tags: tags, + Tags: tags.IgnoreAws().RdsTags(), } if v, ok := d.GetOk("backtrack_window"); ok { @@ -707,7 +711,7 @@ func resourceAwsRDSClusterCreate(d *schema.ResourceData, meta interface{}) error DBClusterIdentifier: aws.String(identifier), DeletionProtection: aws.Bool(d.Get("deletion_protection").(bool)), SourceDBClusterIdentifier: aws.String(pointInTime["source_cluster_identifier"].(string)), - Tags: tags, + Tags: tags.IgnoreAws().RdsTags(), } if v, ok := pointInTime["restore_to_time"].(string); ok && v != "" { @@ -807,7 +811,7 @@ func resourceAwsRDSClusterCreate(d *schema.ResourceData, meta interface{}) error Engine: aws.String(d.Get("engine").(string)), EngineMode: aws.String(d.Get("engine_mode").(string)), ScalingConfiguration: expandRdsClusterScalingConfiguration(d.Get("scaling_configuration").([]interface{})), - Tags: tags, + Tags: tags.IgnoreAws().RdsTags(), } // Note: Username and password credentials are required and valid @@ -973,6 +977,7 @@ func resourceAwsRDSClusterCreate(d *schema.ResourceData, meta interface{}) error func resourceAwsRDSClusterRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).rdsconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig input := &rds.DescribeDBClustersInput{ @@ -1088,8 +1093,15 @@ func resourceAwsRDSClusterRead(d *schema.ResourceData, meta interface{}) error { if err != nil { return fmt.Errorf("error listing tags for RDS Cluster (%s): %s", aws.StringValue(dbc.DBClusterArn), err) } - if err := d.Set("tags", tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { - return fmt.Errorf("error setting tags: %s", err) + tags = tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig) + + //lintignore:AWSR002 + if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { + return fmt.Errorf("error setting tags: %w", err) + } + + if err := d.Set("tags_all", tags.Map()); err != nil { + return fmt.Errorf("error setting tags_all: %w", err) } // Fetch and save Global Cluster if engine mode global @@ -1297,8 +1309,8 @@ func resourceAwsRDSClusterUpdate(d *schema.ResourceData, meta interface{}) error } } - if d.HasChange("tags") { - o, n := d.GetChange("tags") + if d.HasChange("tags_all") { + o, n := d.GetChange("tags_all") if err := keyvaluetags.RdsUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { return fmt.Errorf("error updating tags: %s", err) diff --git a/aws/resource_aws_rds_cluster_endpoint.go b/aws/resource_aws_rds_cluster_endpoint.go index 72de494a8a8..d7dea9ca9f6 100644 --- a/aws/resource_aws_rds_cluster_endpoint.go +++ b/aws/resource_aws_rds_cluster_endpoint.go @@ -72,13 +72,18 @@ func resourceAwsRDSClusterEndpoint() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "tags": tagsSchema(), + "tags": tagsSchema(), + "tags_all": tagsSchemaComputed(), }, + + CustomizeDiff: SetTagsDiff, } } func resourceAwsRDSClusterEndpointCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).rdsconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig + tags := defaultTagsConfig.MergeTags(keyvaluetags.New(d.Get("tags").(map[string]interface{}))) clusterId := d.Get("cluster_identifier").(string) endpointId := d.Get("cluster_endpoint_identifier").(string) @@ -88,7 +93,7 @@ func resourceAwsRDSClusterEndpointCreate(d *schema.ResourceData, meta interface{ DBClusterIdentifier: aws.String(clusterId), DBClusterEndpointIdentifier: aws.String(endpointId), EndpointType: aws.String(endpointType), - Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().RdsTags(), + Tags: tags.IgnoreAws().RdsTags(), } if v := d.Get("static_members"); v != nil { @@ -115,6 +120,7 @@ func resourceAwsRDSClusterEndpointCreate(d *schema.ResourceData, meta interface{ func resourceAwsRDSClusterEndpointRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).rdsconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig input := &rds.DescribeDBClusterEndpointsInput{ @@ -166,8 +172,15 @@ func resourceAwsRDSClusterEndpointRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("error listing tags for RDS Cluster Endpoint (%s): %s", *arn, err) } - if err := d.Set("tags", tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { - return fmt.Errorf("error setting tags: %s", err) + tags = tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig) + + //lintignore:AWSR002 + if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { + return fmt.Errorf("error setting tags: %w", err) + } + + if err := d.Set("tags_all", tags.Map()); err != nil { + return fmt.Errorf("error setting tags_all: %w", err) } return nil @@ -179,8 +192,8 @@ func resourceAwsRDSClusterEndpointUpdate(d *schema.ResourceData, meta interface{ DBClusterEndpointIdentifier: aws.String(d.Id()), } - if d.HasChange("tags") { - o, n := d.GetChange("tags") + if d.HasChange("tags_all") { + o, n := d.GetChange("tags_all") if err := keyvaluetags.RdsUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { return fmt.Errorf("error updating RDS Cluster Endpoint (%s) tags: %s", d.Get("arn").(string), err) diff --git a/aws/resource_aws_rds_cluster_instance.go b/aws/resource_aws_rds_cluster_instance.go index 7db2fa2759c..6a1725c68a8 100644 --- a/aws/resource_aws_rds_cluster_instance.go +++ b/aws/resource_aws_rds_cluster_instance.go @@ -212,13 +212,18 @@ func resourceAwsRDSClusterInstance() *schema.Resource { Computed: true, }, - "tags": tagsSchema(), + "tags": tagsSchema(), + "tags_all": tagsSchemaComputed(), }, + + CustomizeDiff: SetTagsDiff, } } func resourceAwsRDSClusterInstanceCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).rdsconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig + tags := defaultTagsConfig.MergeTags(keyvaluetags.New(d.Get("tags").(map[string]interface{}))) createOpts := &rds.CreateDBInstanceInput{ DBInstanceClass: aws.String(d.Get("instance_class").(string)), @@ -228,7 +233,7 @@ func resourceAwsRDSClusterInstanceCreate(d *schema.ResourceData, meta interface{ PubliclyAccessible: aws.Bool(d.Get("publicly_accessible").(bool)), PromotionTier: aws.Int64(int64(d.Get("promotion_tier").(int))), AutoMinorVersionUpgrade: aws.Bool(d.Get("auto_minor_version_upgrade").(bool)), - Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().RdsTags(), + Tags: tags.IgnoreAws().RdsTags(), } if attr, ok := d.GetOk("availability_zone"); ok { @@ -398,6 +403,7 @@ func resourceAwsRDSClusterInstanceRead(d *schema.ResourceData, meta interface{}) // Retrieve DB Cluster information, to determine if this Instance is a writer conn := meta.(*AWSClient).rdsconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig resp, err := conn.DescribeDBClusters(&rds.DescribeDBClustersInput{ @@ -465,8 +471,15 @@ func resourceAwsRDSClusterInstanceRead(d *schema.ResourceData, meta interface{}) if err != nil { return fmt.Errorf("error listing tags for RDS Cluster Instance (%s): %s", d.Id(), err) } - if err := d.Set("tags", tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { - return fmt.Errorf("error setting tags: %s", err) + tags = tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig) + + //lintignore:AWSR002 + if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { + return fmt.Errorf("error setting tags: %w", err) + } + + if err := d.Set("tags_all", tags.Map()); err != nil { + return fmt.Errorf("error setting tags_all: %w", err) } return nil @@ -584,8 +597,8 @@ func resourceAwsRDSClusterInstanceUpdate(d *schema.ResourceData, meta interface{ } - if d.HasChange("tags") { - o, n := d.GetChange("tags") + if d.HasChange("tags_all") { + o, n := d.GetChange("tags_all") if err := keyvaluetags.RdsUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { return fmt.Errorf("error updating RDS Cluster Instance (%s) tags: %s", d.Id(), err) diff --git a/aws/resource_aws_rds_cluster_parameter_group.go b/aws/resource_aws_rds_cluster_parameter_group.go index 965c9f16f48..49d0c18cb5d 100644 --- a/aws/resource_aws_rds_cluster_parameter_group.go +++ b/aws/resource_aws_rds_cluster_parameter_group.go @@ -82,13 +82,18 @@ func resourceAwsRDSClusterParameterGroup() *schema.Resource { Set: resourceAwsDbParameterHash, }, - "tags": tagsSchema(), + "tags": tagsSchema(), + "tags_all": tagsSchemaComputed(), }, + + CustomizeDiff: SetTagsDiff, } } func resourceAwsRDSClusterParameterGroupCreate(d *schema.ResourceData, meta interface{}) error { rdsconn := meta.(*AWSClient).rdsconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig + tags := defaultTagsConfig.MergeTags(keyvaluetags.New(d.Get("tags").(map[string]interface{}))) var groupName string if v, ok := d.GetOk("name"); ok { @@ -103,7 +108,7 @@ func resourceAwsRDSClusterParameterGroupCreate(d *schema.ResourceData, meta inte DBClusterParameterGroupName: aws.String(groupName), DBParameterGroupFamily: aws.String(d.Get("family").(string)), Description: aws.String(d.Get("description").(string)), - Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().RdsTags(), + Tags: tags.IgnoreAws().RdsTags(), } log.Printf("[DEBUG] Create DB Cluster Parameter Group: %#v", createOpts) @@ -123,6 +128,7 @@ func resourceAwsRDSClusterParameterGroupCreate(d *schema.ResourceData, meta inte func resourceAwsRDSClusterParameterGroupRead(d *schema.ResourceData, meta interface{}) error { rdsconn := meta.(*AWSClient).rdsconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig describeOpts := rds.DescribeDBClusterParameterGroupsInput{ @@ -173,8 +179,15 @@ func resourceAwsRDSClusterParameterGroupRead(d *schema.ResourceData, meta interf log.Printf("[DEBUG] Error retrieving tags for ARN: %s", arn) } - if err := d.Set("tags", keyvaluetags.RdsKeyValueTags(resp.TagList).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { - return fmt.Errorf("error setting tags: %s", err) + tags := keyvaluetags.RdsKeyValueTags(resp.TagList).IgnoreAws().IgnoreConfig(ignoreTagsConfig) + + //lintignore:AWSR002 + if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { + return fmt.Errorf("error setting tags: %w", err) + } + + if err := d.Set("tags_all", tags.Map()); err != nil { + return fmt.Errorf("error setting tags_all: %w", err) } return nil @@ -279,8 +292,8 @@ func resourceAwsRDSClusterParameterGroupUpdate(d *schema.ResourceData, meta inte } } - if d.HasChange("tags") { - o, n := d.GetChange("tags") + if d.HasChange("tags_all") { + o, n := d.GetChange("tags_all") if err := keyvaluetags.RdsUpdateTags(rdsconn, d.Get("arn").(string), o, n); err != nil { return fmt.Errorf("error updating RDS Cluster Parameter Group (%s) tags: %s", d.Id(), err) diff --git a/aws/resource_aws_redshift_cluster.go b/aws/resource_aws_redshift_cluster.go index e9fe42c035a..ece741ddcf0 100644 --- a/aws/resource_aws_redshift_cluster.go +++ b/aws/resource_aws_redshift_cluster.go @@ -320,8 +320,11 @@ func resourceAwsRedshiftCluster() *schema.Resource { Optional: true, }, - "tags": tagsSchema(), + "tags": tagsSchema(), + "tags_all": tagsSchemaComputed(), }, + + CustomizeDiff: SetTagsDiff, } } @@ -336,7 +339,8 @@ func resourceAwsRedshiftClusterImport( func resourceAwsRedshiftClusterCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).redshiftconn - tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().RedshiftTags() + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig + tags := defaultTagsConfig.MergeTags(keyvaluetags.New(d.Get("tags").(map[string]interface{}))) if v, ok := d.GetOk("snapshot_identifier"); ok { restoreOpts := &redshift.RestoreFromClusterSnapshotInput{ @@ -427,7 +431,7 @@ func resourceAwsRedshiftClusterCreate(d *schema.ResourceData, meta interface{}) AllowVersionUpgrade: aws.Bool(d.Get("allow_version_upgrade").(bool)), PubliclyAccessible: aws.Bool(d.Get("publicly_accessible").(bool)), AutomatedSnapshotRetentionPeriod: aws.Int64(int64(d.Get("automated_snapshot_retention_period").(int))), - Tags: tags, + Tags: tags.IgnoreAws().RedshiftTags(), } if v := d.Get("number_of_nodes").(int); v > 1 { @@ -523,6 +527,7 @@ func resourceAwsRedshiftClusterCreate(d *schema.ResourceData, meta interface{}) func resourceAwsRedshiftClusterRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).redshiftconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig log.Printf("[INFO] Reading Redshift Cluster Information: %s", d.Id()) @@ -620,8 +625,15 @@ func resourceAwsRedshiftClusterRead(d *schema.ResourceData, meta interface{}) er d.Set("cluster_public_key", rsc.ClusterPublicKey) d.Set("cluster_revision_number", rsc.ClusterRevisionNumber) - if err := d.Set("tags", keyvaluetags.RedshiftKeyValueTags(rsc.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { - return fmt.Errorf("error setting tags: %s", err) + tags := keyvaluetags.RedshiftKeyValueTags(rsc.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig) + + //lintignore:AWSR002 + if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { + return fmt.Errorf("error setting tags: %w", err) + } + + if err := d.Set("tags_all", tags.Map()); err != nil { + return fmt.Errorf("error setting tags_all: %w", err) } d.Set("snapshot_copy", flattenRedshiftSnapshotCopy(rsc.ClusterSnapshotCopyStatus)) @@ -646,8 +658,8 @@ func resourceAwsRedshiftClusterRead(d *schema.ResourceData, meta interface{}) er func resourceAwsRedshiftClusterUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).redshiftconn - if d.HasChange("tags") { - o, n := d.GetChange("tags") + if d.HasChange("tags_all") { + o, n := d.GetChange("tags_all") if err := keyvaluetags.RedshiftUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { return fmt.Errorf("error updating Redshift Cluster (%s) tags: %s", d.Get("arn").(string), err) diff --git a/aws/resource_aws_redshift_event_subscription.go b/aws/resource_aws_redshift_event_subscription.go index 2442039b904..ca8fac6ea60 100644 --- a/aws/resource_aws_redshift_event_subscription.go +++ b/aws/resource_aws_redshift_event_subscription.go @@ -75,13 +75,18 @@ func resourceAwsRedshiftEventSubscription() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "tags": tagsSchema(), + "tags": tagsSchema(), + "tags_all": tagsSchemaComputed(), }, + + CustomizeDiff: SetTagsDiff, } } func resourceAwsRedshiftEventSubscriptionCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).redshiftconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig + tags := defaultTagsConfig.MergeTags(keyvaluetags.New(d.Get("tags").(map[string]interface{}))) request := &redshift.CreateEventSubscriptionInput{ SubscriptionName: aws.String(d.Get("name").(string)), @@ -91,7 +96,7 @@ func resourceAwsRedshiftEventSubscriptionCreate(d *schema.ResourceData, meta int SourceType: aws.String(d.Get("source_type").(string)), Severity: aws.String(d.Get("severity").(string)), EventCategories: expandStringSet(d.Get("event_categories").(*schema.Set)), - Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().RedshiftTags(), + Tags: tags.IgnoreAws().RedshiftTags(), } log.Println("[DEBUG] Create Redshift Event Subscription:", request) @@ -108,6 +113,7 @@ func resourceAwsRedshiftEventSubscriptionCreate(d *schema.ResourceData, meta int func resourceAwsRedshiftEventSubscriptionRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).redshiftconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig arn := arn.ARN{ @@ -157,8 +163,15 @@ func resourceAwsRedshiftEventSubscriptionRead(d *schema.ResourceData, meta inter if err := d.Set("customer_aws_id", sub.CustomerAwsId); err != nil { return err } - if err := d.Set("tags", keyvaluetags.RedshiftKeyValueTags(sub.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { - return fmt.Errorf("error setting tags: %s", err) + tags := keyvaluetags.RedshiftKeyValueTags(sub.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig) + + //lintignore:AWSR002 + if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { + return fmt.Errorf("error setting tags: %w", err) + } + + if err := d.Set("tags_all", tags.Map()); err != nil { + return fmt.Errorf("error setting tags_all: %w", err) } return nil @@ -205,8 +218,8 @@ func resourceAwsRedshiftEventSubscriptionUpdate(d *schema.ResourceData, meta int return fmt.Errorf("Modifying Redshift Event Subscription %s failed: %s", d.Id(), err) } - if d.HasChange("tags") { - o, n := d.GetChange("tags") + if d.HasChange("tags_all") { + o, n := d.GetChange("tags_all") if err := keyvaluetags.RedshiftUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { return fmt.Errorf("error updating Redshift Event Subscription (%s) tags: %s", d.Get("arn").(string), err) diff --git a/aws/resource_aws_redshift_parameter_group.go b/aws/resource_aws_redshift_parameter_group.go index 5943ded27d0..d8bcd1ac29b 100644 --- a/aws/resource_aws_redshift_parameter_group.go +++ b/aws/resource_aws_redshift_parameter_group.go @@ -77,19 +77,24 @@ func resourceAwsRedshiftParameterGroup() *schema.Resource { Set: resourceAwsRedshiftParameterHash, }, - "tags": tagsSchema(), + "tags": tagsSchema(), + "tags_all": tagsSchemaComputed(), }, + + CustomizeDiff: SetTagsDiff, } } func resourceAwsRedshiftParameterGroupCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).redshiftconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig + tags := defaultTagsConfig.MergeTags(keyvaluetags.New(d.Get("tags").(map[string]interface{}))) createOpts := redshift.CreateClusterParameterGroupInput{ ParameterGroupName: aws.String(d.Get("name").(string)), ParameterGroupFamily: aws.String(d.Get("family").(string)), Description: aws.String(d.Get("description").(string)), - Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().RedshiftTags(), + Tags: tags.IgnoreAws().RedshiftTags(), } log.Printf("[DEBUG] Create Redshift Parameter Group: %#v", createOpts) @@ -118,6 +123,7 @@ func resourceAwsRedshiftParameterGroupCreate(d *schema.ResourceData, meta interf func resourceAwsRedshiftParameterGroupRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).redshiftconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig describeOpts := redshift.DescribeClusterParameterGroupsInput{ @@ -148,8 +154,15 @@ func resourceAwsRedshiftParameterGroupRead(d *schema.ResourceData, meta interfac d.Set("name", describeResp.ParameterGroups[0].ParameterGroupName) d.Set("family", describeResp.ParameterGroups[0].ParameterGroupFamily) d.Set("description", describeResp.ParameterGroups[0].Description) - if err := d.Set("tags", keyvaluetags.RedshiftKeyValueTags(describeResp.ParameterGroups[0].Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { - return fmt.Errorf("error setting tags: %s", err) + tags := keyvaluetags.RedshiftKeyValueTags(describeResp.ParameterGroups[0].Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig) + + //lintignore:AWSR002 + if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { + return fmt.Errorf("error setting tags: %w", err) + } + + if err := d.Set("tags_all", tags.Map()); err != nil { + return fmt.Errorf("error setting tags_all: %w", err) } describeParametersOpts := redshift.DescribeClusterParametersInput{ @@ -198,8 +211,8 @@ func resourceAwsRedshiftParameterGroupUpdate(d *schema.ResourceData, meta interf } } - if d.HasChange("tags") { - o, n := d.GetChange("tags") + if d.HasChange("tags_all") { + o, n := d.GetChange("tags_all") if err := keyvaluetags.RedshiftUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { return fmt.Errorf("error updating Redshift Parameter Group (%s) tags: %s", d.Get("arn").(string), err) diff --git a/aws/resource_aws_redshift_snapshot_copy_grant.go b/aws/resource_aws_redshift_snapshot_copy_grant.go index 36a5297a23c..25bbbe9e550 100644 --- a/aws/resource_aws_redshift_snapshot_copy_grant.go +++ b/aws/resource_aws_redshift_snapshot_copy_grant.go @@ -40,13 +40,18 @@ func resourceAwsRedshiftSnapshotCopyGrant() *schema.Resource { ForceNew: true, Computed: true, }, - "tags": tagsSchema(), + "tags": tagsSchema(), + "tags_all": tagsSchemaComputed(), }, + + CustomizeDiff: SetTagsDiff, } } func resourceAwsRedshiftSnapshotCopyGrantCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).redshiftconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig + tags := defaultTagsConfig.MergeTags(keyvaluetags.New(d.Get("tags").(map[string]interface{}))) grantName := d.Get("snapshot_copy_grant_name").(string) @@ -58,7 +63,7 @@ func resourceAwsRedshiftSnapshotCopyGrantCreate(d *schema.ResourceData, meta int input.KmsKeyId = aws.String(v.(string)) } - input.Tags = keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().RedshiftTags() + input.Tags = tags.IgnoreAws().RedshiftTags() log.Printf("[DEBUG]: Adding new Redshift SnapshotCopyGrant: %s", input) @@ -99,6 +104,7 @@ func resourceAwsRedshiftSnapshotCopyGrantCreate(d *schema.ResourceData, meta int func resourceAwsRedshiftSnapshotCopyGrantRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).redshiftconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig grantName := d.Id() @@ -127,8 +133,15 @@ func resourceAwsRedshiftSnapshotCopyGrantRead(d *schema.ResourceData, meta inter d.Set("kms_key_id", grant.KmsKeyId) d.Set("snapshot_copy_grant_name", grant.SnapshotCopyGrantName) - if err := d.Set("tags", keyvaluetags.RedshiftKeyValueTags(grant.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { - return fmt.Errorf("error setting tags: %s", err) + tags := keyvaluetags.RedshiftKeyValueTags(grant.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig) + + //lintignore:AWSR002 + if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { + return fmt.Errorf("error setting tags: %w", err) + } + + if err := d.Set("tags_all", tags.Map()); err != nil { + return fmt.Errorf("error setting tags_all: %w", err) } return nil @@ -137,8 +150,8 @@ func resourceAwsRedshiftSnapshotCopyGrantRead(d *schema.ResourceData, meta inter func resourceAwsRedshiftSnapshotCopyGrantUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).redshiftconn - if d.HasChange("tags") { - o, n := d.GetChange("tags") + if d.HasChange("tags_all") { + o, n := d.GetChange("tags_all") if err := keyvaluetags.RedshiftUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { return fmt.Errorf("error updating Redshift Snapshot Copy Grant (%s) tags: %s", d.Get("arn").(string), err) diff --git a/aws/resource_aws_redshift_snapshot_schedule.go b/aws/resource_aws_redshift_snapshot_schedule.go index f4c7bb9c028..04103353433 100644 --- a/aws/resource_aws_redshift_snapshot_schedule.go +++ b/aws/resource_aws_redshift_snapshot_schedule.go @@ -57,15 +57,20 @@ func resourceAwsRedshiftSnapshotSchedule() *schema.Resource { Optional: true, Default: false, }, - "tags": tagsSchema(), + "tags": tagsSchema(), + "tags_all": tagsSchemaComputed(), }, + + CustomizeDiff: SetTagsDiff, } } func resourceAwsRedshiftSnapshotScheduleCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).redshiftconn - tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().RedshiftTags() + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig + tags := defaultTagsConfig.MergeTags(keyvaluetags.New(d.Get("tags").(map[string]interface{}))) + var identifier string if v, ok := d.GetOk("identifier"); ok { identifier = v.(string) @@ -79,7 +84,7 @@ func resourceAwsRedshiftSnapshotScheduleCreate(d *schema.ResourceData, meta inte createOpts := &redshift.CreateSnapshotScheduleInput{ ScheduleIdentifier: aws.String(identifier), ScheduleDefinitions: expandStringSet(d.Get("definitions").(*schema.Set)), - Tags: tags, + Tags: tags.IgnoreAws().RedshiftTags(), } if attr, ok := d.GetOk("description"); ok { createOpts.ScheduleDescription = aws.String(attr.(string)) @@ -97,6 +102,7 @@ func resourceAwsRedshiftSnapshotScheduleCreate(d *schema.ResourceData, meta inte func resourceAwsRedshiftSnapshotScheduleRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).redshiftconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig descOpts := &redshift.DescribeSnapshotSchedulesInput{ @@ -121,8 +127,15 @@ func resourceAwsRedshiftSnapshotScheduleRead(d *schema.ResourceData, meta interf return fmt.Errorf("Error setting definitions: %s", err) } - if err := d.Set("tags", keyvaluetags.RedshiftKeyValueTags(snapshotSchedule.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { - return fmt.Errorf("error setting tags: %s", err) + tags := keyvaluetags.RedshiftKeyValueTags(snapshotSchedule.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig) + + //lintignore:AWSR002 + if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { + return fmt.Errorf("error setting tags: %w", err) + } + + if err := d.Set("tags_all", tags.Map()); err != nil { + return fmt.Errorf("error setting tags_all: %w", err) } arn := arn.ARN{ @@ -141,8 +154,8 @@ func resourceAwsRedshiftSnapshotScheduleRead(d *schema.ResourceData, meta interf func resourceAwsRedshiftSnapshotScheduleUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).redshiftconn - if d.HasChange("tags") { - o, n := d.GetChange("tags") + if d.HasChange("tags_all") { + o, n := d.GetChange("tags_all") if err := keyvaluetags.RedshiftUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { return fmt.Errorf("error updating Redshift Snapshot Schedule (%s) tags: %s", d.Get("arn").(string), err) diff --git a/aws/resource_aws_redshift_subnet_group.go b/aws/resource_aws_redshift_subnet_group.go index 29d82694469..0fc103fdb6e 100644 --- a/aws/resource_aws_redshift_subnet_group.go +++ b/aws/resource_aws_redshift_subnet_group.go @@ -53,26 +53,30 @@ func resourceAwsRedshiftSubnetGroup() *schema.Resource { Set: schema.HashString, }, - "tags": tagsSchema(), + "tags": tagsSchema(), + "tags_all": tagsSchemaComputed(), }, + + CustomizeDiff: SetTagsDiff, } } func resourceAwsRedshiftSubnetGroupCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).redshiftconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig + tags := defaultTagsConfig.MergeTags(keyvaluetags.New(d.Get("tags").(map[string]interface{}))) subnetIdsSet := d.Get("subnet_ids").(*schema.Set) subnetIds := make([]*string, subnetIdsSet.Len()) for i, subnetId := range subnetIdsSet.List() { subnetIds[i] = aws.String(subnetId.(string)) } - tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().RedshiftTags() createOpts := redshift.CreateClusterSubnetGroupInput{ ClusterSubnetGroupName: aws.String(d.Get("name").(string)), Description: aws.String(d.Get("description").(string)), SubnetIds: subnetIds, - Tags: tags, + Tags: tags.IgnoreAws().RedshiftTags(), } log.Printf("[DEBUG] Create Redshift Subnet Group: %#v", createOpts) @@ -88,6 +92,7 @@ func resourceAwsRedshiftSubnetGroupCreate(d *schema.ResourceData, meta interface func resourceAwsRedshiftSubnetGroupRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).redshiftconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig describeOpts := redshift.DescribeClusterSubnetGroupsInput{ @@ -111,8 +116,15 @@ func resourceAwsRedshiftSubnetGroupRead(d *schema.ResourceData, meta interface{} d.Set("name", d.Id()) d.Set("description", describeResp.ClusterSubnetGroups[0].Description) d.Set("subnet_ids", subnetIdsToSlice(describeResp.ClusterSubnetGroups[0].Subnets)) - if err := d.Set("tags", keyvaluetags.RedshiftKeyValueTags(describeResp.ClusterSubnetGroups[0].Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { - return fmt.Errorf("error setting tags: %s", err) + tags := keyvaluetags.RedshiftKeyValueTags(describeResp.ClusterSubnetGroups[0].Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig) + + //lintignore:AWSR002 + if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { + return fmt.Errorf("error setting tags: %w", err) + } + + if err := d.Set("tags_all", tags.Map()); err != nil { + return fmt.Errorf("error setting tags_all: %w", err) } arn := arn.ARN{ @@ -131,8 +143,8 @@ func resourceAwsRedshiftSubnetGroupRead(d *schema.ResourceData, meta interface{} func resourceAwsRedshiftSubnetGroupUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).redshiftconn - if d.HasChange("tags") { - o, n := d.GetChange("tags") + if d.HasChange("tags_all") { + o, n := d.GetChange("tags_all") if err := keyvaluetags.RedshiftUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { return fmt.Errorf("error updating Redshift Subnet Group (%s) tags: %s", d.Get("arn").(string), err) diff --git a/aws/resource_aws_resourcegroups_group.go b/aws/resource_aws_resourcegroups_group.go index b00ffd3db15..0648550ee82 100644 --- a/aws/resource_aws_resourcegroups_group.go +++ b/aws/resource_aws_resourcegroups_group.go @@ -62,8 +62,11 @@ func resourceAwsResourceGroupsGroup() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "tags": tagsSchema(), + "tags": tagsSchema(), + "tags_all": tagsSchemaComputed(), }, + + CustomizeDiff: SetTagsDiff, } } @@ -78,12 +81,14 @@ func extractResourceGroupResourceQuery(resourceQueryList []interface{}) *resourc func resourceAwsResourceGroupsGroupCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).resourcegroupsconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig + tags := defaultTagsConfig.MergeTags(keyvaluetags.New(d.Get("tags").(map[string]interface{}))) input := resourcegroups.CreateGroupInput{ Description: aws.String(d.Get("description").(string)), Name: aws.String(d.Get("name").(string)), ResourceQuery: extractResourceGroupResourceQuery(d.Get("resource_query").([]interface{})), - Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().ResourcegroupsTags(), + Tags: tags.IgnoreAws().ResourcegroupsTags(), } res, err := conn.CreateGroup(&input) @@ -98,6 +103,7 @@ func resourceAwsResourceGroupsGroupCreate(d *schema.ResourceData, meta interface func resourceAwsResourceGroupsGroupRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).resourcegroupsconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig g, err := conn.GetGroup(&resourcegroups.GetGroupInput{ @@ -138,8 +144,15 @@ func resourceAwsResourceGroupsGroupRead(d *schema.ResourceData, meta interface{} if err != nil { return fmt.Errorf("error listing tags for resource (%s): %s", arn, err) } - if err := d.Set("tags", tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { - return fmt.Errorf("error setting tags: %s", err) + tags = tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig) + + //lintignore:AWSR002 + if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { + return fmt.Errorf("error setting tags: %w", err) + } + + if err := d.Set("tags_all", tags.Map()); err != nil { + return fmt.Errorf("error setting tags_all: %w", err) } return nil @@ -172,8 +185,8 @@ func resourceAwsResourceGroupsGroupUpdate(d *schema.ResourceData, meta interface } } - if d.HasChange("tags") { - o, n := d.GetChange("tags") + if d.HasChange("tags_all") { + o, n := d.GetChange("tags_all") if err := keyvaluetags.ResourcegroupsUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { return fmt.Errorf("error updating tags: %s", err) } diff --git a/aws/resource_aws_route53_health_check.go b/aws/resource_aws_route53_health_check.go index 44b0c32adef..4b21211d650 100644 --- a/aws/resource_aws_route53_health_check.go +++ b/aws/resource_aws_route53_health_check.go @@ -153,8 +153,11 @@ func resourceAwsRoute53HealthCheck() *schema.Resource { Default: false, }, - "tags": tagsSchema(), + "tags": tagsSchema(), + "tags_all": tagsSchemaComputed(), }, + + CustomizeDiff: SetTagsDiff, } } @@ -227,8 +230,8 @@ func resourceAwsRoute53HealthCheckUpdate(d *schema.ResourceData, meta interface{ return err } - if d.HasChange("tags") { - o, n := d.GetChange("tags") + if d.HasChange("tags_all") { + o, n := d.GetChange("tags_all") if err := keyvaluetags.Route53UpdateTags(conn, d.Id(), route53.TagResourceTypeHealthcheck, o, n); err != nil { return fmt.Errorf("error updating Route53 Health Check (%s) tags: %s", d.Id(), err) @@ -240,6 +243,8 @@ func resourceAwsRoute53HealthCheckUpdate(d *schema.ResourceData, meta interface{ func resourceAwsRoute53HealthCheckCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).r53conn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig + tags := defaultTagsConfig.MergeTags(keyvaluetags.New(d.Get("tags").(map[string]interface{}))) healthConfig := &route53.HealthCheckConfig{ Type: aws.String(d.Get("type").(string)), @@ -341,7 +346,7 @@ func resourceAwsRoute53HealthCheckCreate(d *schema.ResourceData, meta interface{ d.SetId(aws.StringValue(resp.HealthCheck.Id)) - if err := keyvaluetags.Route53UpdateTags(conn, d.Id(), route53.TagResourceTypeHealthcheck, map[string]interface{}{}, d.Get("tags").(map[string]interface{})); err != nil { + if err := keyvaluetags.Route53UpdateTags(conn, d.Id(), route53.TagResourceTypeHealthcheck, nil, tags); err != nil { return fmt.Errorf("error setting Route53 Health Check (%s) tags: %s", d.Id(), err) } @@ -350,6 +355,7 @@ func resourceAwsRoute53HealthCheckCreate(d *schema.ResourceData, meta interface{ func resourceAwsRoute53HealthCheckRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).r53conn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig read, err := conn.GetHealthCheck(&route53.GetHealthCheckInput{HealthCheckId: aws.String(d.Id())}) @@ -400,8 +406,15 @@ func resourceAwsRoute53HealthCheckRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("error listing tags for Route53 Health Check (%s): %s", d.Id(), err) } - if err := d.Set("tags", tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { - return fmt.Errorf("error setting tags: %s", err) + tags = tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig) + + //lintignore:AWSR002 + if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { + return fmt.Errorf("error setting tags: %w", err) + } + + if err := d.Set("tags_all", tags.Map()); err != nil { + return fmt.Errorf("error setting tags_all: %w", err) } return nil diff --git a/aws/resource_aws_route53_resolver_endpoint.go b/aws/resource_aws_route53_resolver_endpoint.go index 33920babe0d..39bab7f2135 100644 --- a/aws/resource_aws_route53_resolver_endpoint.go +++ b/aws/resource_aws_route53_resolver_endpoint.go @@ -82,7 +82,8 @@ func resourceAwsRoute53ResolverEndpoint() *schema.Resource { ValidateFunc: validateRoute53ResolverName, }, - "tags": tagsSchema(), + "tags": tagsSchema(), + "tags_all": tagsSchemaComputed(), "arn": { Type: schema.TypeString, @@ -100,11 +101,15 @@ func resourceAwsRoute53ResolverEndpoint() *schema.Resource { Update: schema.DefaultTimeout(10 * time.Minute), Delete: schema.DefaultTimeout(10 * time.Minute), }, + + CustomizeDiff: SetTagsDiff, } } func resourceAwsRoute53ResolverEndpointCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).route53resolverconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig + tags := defaultTagsConfig.MergeTags(keyvaluetags.New(d.Get("tags").(map[string]interface{}))) req := &route53resolver.CreateResolverEndpointInput{ CreatorRequestId: aws.String(resource.PrefixedUniqueId("tf-r53-resolver-endpoint-")), @@ -116,7 +121,7 @@ func resourceAwsRoute53ResolverEndpointCreate(d *schema.ResourceData, meta inter req.Name = aws.String(v.(string)) } if v, ok := d.GetOk("tags"); ok && len(v.(map[string]interface{})) > 0 { - req.Tags = keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().Route53resolverTags() + req.Tags = tags.IgnoreAws().Route53resolverTags() } log.Printf("[DEBUG] Creating Route53 Resolver endpoint: %#v", req) @@ -139,6 +144,7 @@ func resourceAwsRoute53ResolverEndpointCreate(d *schema.ResourceData, meta inter func resourceAwsRoute53ResolverEndpointRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).route53resolverconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig epRaw, state, err := route53ResolverEndpointRefresh(conn, d.Id())() @@ -187,8 +193,15 @@ func resourceAwsRoute53ResolverEndpointRead(d *schema.ResourceData, meta interfa return fmt.Errorf("error listing tags for Route53 Resolver endpoint (%s): %s", d.Get("arn").(string), err) } - if err := d.Set("tags", tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { - return fmt.Errorf("error setting tags: %s", err) + tags = tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig) + + //lintignore:AWSR002 + if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { + return fmt.Errorf("error setting tags: %w", err) + } + + if err := d.Set("tags_all", tags.Map()); err != nil { + return fmt.Errorf("error setting tags_all: %w", err) } return nil @@ -260,8 +273,8 @@ func resourceAwsRoute53ResolverEndpointUpdate(d *schema.ResourceData, meta inter } } - if d.HasChange("tags") { - o, n := d.GetChange("tags") + if d.HasChange("tags_all") { + o, n := d.GetChange("tags_all") if err := keyvaluetags.Route53resolverUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { return fmt.Errorf("error updating Route53 Resolver endpoint (%s) tags: %s", d.Get("arn").(string), err) } diff --git a/aws/resource_aws_route53_resolver_firewall_rule_group.go b/aws/resource_aws_route53_resolver_firewall_rule_group.go index d454bfc9f1a..668d1b6a83e 100644 --- a/aws/resource_aws_route53_resolver_firewall_rule_group.go +++ b/aws/resource_aws_route53_resolver_firewall_rule_group.go @@ -50,20 +50,25 @@ func resourceAwsRoute53ResolverFirewallRuleGroup() *schema.Resource { Computed: true, }, - "tags": tagsSchema(), + "tags": tagsSchema(), + "tags_all": tagsSchemaComputed(), }, + + CustomizeDiff: SetTagsDiff, } } func resourceAwsRoute53ResolverFirewallRuleGroupCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).route53resolverconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig + tags := defaultTagsConfig.MergeTags(keyvaluetags.New(d.Get("tags").(map[string]interface{}))) input := &route53resolver.CreateFirewallRuleGroupInput{ CreatorRequestId: aws.String(resource.PrefixedUniqueId("tf-r53-resolver-firewall-rule-group-")), Name: aws.String(d.Get("name").(string)), } if v, ok := d.GetOk("tags"); ok && len(v.(map[string]interface{})) > 0 { - input.Tags = keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().Route53resolverTags() + input.Tags = tags.IgnoreAws().Route53resolverTags() } log.Printf("[DEBUG] Creating Route 53 Resolver DNS Firewall rule group: %#v", input) @@ -79,6 +84,7 @@ func resourceAwsRoute53ResolverFirewallRuleGroupCreate(d *schema.ResourceData, m func resourceAwsRoute53ResolverFirewallRuleGroupRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).route53resolverconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig ruleGroup, err := finder.FirewallRuleGroupByID(conn, d.Id()) @@ -111,18 +117,25 @@ func resourceAwsRoute53ResolverFirewallRuleGroupRead(d *schema.ResourceData, met return fmt.Errorf("error listing tags for Route53 Resolver DNS Firewall rule group (%s): %w", arn, err) } - if err := d.Set("tags", tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { + tags = tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig) + + //lintignore:AWSR002 + if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { return fmt.Errorf("error setting tags: %w", err) } + if err := d.Set("tags_all", tags.Map()); err != nil { + return fmt.Errorf("error setting tags_all: %w", err) + } + return nil } func resourceAwsRoute53ResolverFirewallRuleGroupUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).route53resolverconn - if d.HasChange("tags") { - o, n := d.GetChange("tags") + if d.HasChange("tags_all") { + o, n := d.GetChange("tags_all") if err := keyvaluetags.Route53resolverUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { return fmt.Errorf("error updating Route53 Resolver DNS Firewall rule group (%s) tags: %w", d.Get("arn").(string), err) } diff --git a/aws/resource_aws_route53_resolver_query_log_config.go b/aws/resource_aws_route53_resolver_query_log_config.go index 0fba3e0dbab..6604179e341 100644 --- a/aws/resource_aws_route53_resolver_query_log_config.go +++ b/aws/resource_aws_route53_resolver_query_log_config.go @@ -53,13 +53,18 @@ func resourceAwsRoute53ResolverQueryLogConfig() *schema.Resource { Computed: true, }, - "tags": tagsSchema(), + "tags": tagsSchema(), + "tags_all": tagsSchemaComputed(), }, + + CustomizeDiff: SetTagsDiff, } } func resourceAwsRoute53ResolverQueryLogConfigCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).route53resolverconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig + tags := defaultTagsConfig.MergeTags(keyvaluetags.New(d.Get("tags").(map[string]interface{}))) input := &route53resolver.CreateResolverQueryLogConfigInput{ CreatorRequestId: aws.String(resource.PrefixedUniqueId("tf-r53-resolver-query-log-config-")), @@ -67,7 +72,7 @@ func resourceAwsRoute53ResolverQueryLogConfigCreate(d *schema.ResourceData, meta Name: aws.String(d.Get("name").(string)), } if v, ok := d.GetOk("tags"); ok && len(v.(map[string]interface{})) > 0 { - input.Tags = keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().Route53resolverTags() + input.Tags = tags.IgnoreAws().Route53resolverTags() } log.Printf("[DEBUG] Creating Route53 Resolver Query Log Config: %s", input) @@ -90,6 +95,7 @@ func resourceAwsRoute53ResolverQueryLogConfigCreate(d *schema.ResourceData, meta func resourceAwsRoute53ResolverQueryLogConfigRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).route53resolverconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig queryLogConfig, err := finder.ResolverQueryLogConfigByID(conn, d.Id()) @@ -122,18 +128,25 @@ func resourceAwsRoute53ResolverQueryLogConfigRead(d *schema.ResourceData, meta i return fmt.Errorf("error listing tags for Route53 Resolver Query Log Config (%s): %w", arn, err) } - if err := d.Set("tags", tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { + tags = tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig) + + //lintignore:AWSR002 + if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { return fmt.Errorf("error setting tags: %w", err) } + if err := d.Set("tags_all", tags.Map()); err != nil { + return fmt.Errorf("error setting tags_all: %w", err) + } + return nil } func resourceAwsRoute53ResolverQueryLogConfigUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).route53resolverconn - if d.HasChange("tags") { - o, n := d.GetChange("tags") + if d.HasChange("tags_all") { + o, n := d.GetChange("tags_all") if err := keyvaluetags.Route53resolverUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { return fmt.Errorf("error updating Route53 Resolver Query Log Config (%s) tags: %s", d.Get("arn").(string), err) } diff --git a/aws/resource_aws_route53_resolver_rule.go b/aws/resource_aws_route53_resolver_rule.go index 0f17d1a34d2..7402764fd18 100644 --- a/aws/resource_aws_route53_resolver_rule.go +++ b/aws/resource_aws_route53_resolver_rule.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/route53resolver" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" @@ -22,11 +23,14 @@ const ( func resourceAwsRoute53ResolverRule() *schema.Resource { return &schema.Resource{ - Create: resourceAwsRoute53ResolverRuleCreate, - Read: resourceAwsRoute53ResolverRuleRead, - Update: resourceAwsRoute53ResolverRuleUpdate, - Delete: resourceAwsRoute53ResolverRuleDelete, - CustomizeDiff: resourceAwsRoute53ResolverRuleCustomizeDiff, + Create: resourceAwsRoute53ResolverRuleCreate, + Read: resourceAwsRoute53ResolverRuleRead, + Update: resourceAwsRoute53ResolverRuleUpdate, + Delete: resourceAwsRoute53ResolverRuleDelete, + CustomizeDiff: customdiff.Sequence( + resourceAwsRoute53ResolverRuleCustomizeDiff, + SetTagsDiff, + ), Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -89,7 +93,8 @@ func resourceAwsRoute53ResolverRule() *schema.Resource { Set: route53ResolverRuleHashTargetIp, }, - "tags": tagsSchema(), + "tags": tagsSchema(), + "tags_all": tagsSchemaComputed(), "arn": { Type: schema.TypeString, @@ -111,6 +116,8 @@ func resourceAwsRoute53ResolverRule() *schema.Resource { func resourceAwsRoute53ResolverRuleCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).route53resolverconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig + tags := defaultTagsConfig.MergeTags(keyvaluetags.New(d.Get("tags").(map[string]interface{}))) req := &route53resolver.CreateResolverRuleInput{ CreatorRequestId: aws.String(resource.PrefixedUniqueId("tf-r53-resolver-rule-")), @@ -127,7 +134,7 @@ func resourceAwsRoute53ResolverRuleCreate(d *schema.ResourceData, meta interface req.TargetIps = expandRoute53ResolverRuleTargetIps(v.(*schema.Set)) } if v, ok := d.GetOk("tags"); ok && len(v.(map[string]interface{})) > 0 { - req.Tags = keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().Route53resolverTags() + req.Tags = tags.IgnoreAws().Route53resolverTags() } log.Printf("[DEBUG] Creating Route 53 Resolver rule: %s", req) @@ -150,6 +157,7 @@ func resourceAwsRoute53ResolverRuleCreate(d *schema.ResourceData, meta interface func resourceAwsRoute53ResolverRuleRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).route53resolverconn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig ruleRaw, state, err := route53ResolverRuleRefresh(conn, d.Id())() @@ -182,8 +190,15 @@ func resourceAwsRoute53ResolverRuleRead(d *schema.ResourceData, meta interface{} return fmt.Errorf("error listing tags for Route53 Resolver rule (%s): %s", d.Get("arn").(string), err) } - if err := d.Set("tags", tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { - return fmt.Errorf("error setting tags: %s", err) + tags = tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig) + + //lintignore:AWSR002 + if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { + return fmt.Errorf("error setting tags: %w", err) + } + + if err := d.Set("tags_all", tags.Map()); err != nil { + return fmt.Errorf("error setting tags_all: %w", err) } return nil @@ -221,8 +236,8 @@ func resourceAwsRoute53ResolverRuleUpdate(d *schema.ResourceData, meta interface } } - if d.HasChange("tags") { - o, n := d.GetChange("tags") + if d.HasChange("tags_all") { + o, n := d.GetChange("tags_all") if err := keyvaluetags.Route53resolverUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { return fmt.Errorf("error updating Route53 Resolver rule (%s) tags: %s", d.Get("arn").(string), err) } diff --git a/aws/resource_aws_route53_zone.go b/aws/resource_aws_route53_zone.go index 6ba07167395..1c69db5f436 100644 --- a/aws/resource_aws_route53_zone.go +++ b/aws/resource_aws_route53_zone.go @@ -87,7 +87,8 @@ func resourceAwsRoute53Zone() *schema.Resource { Computed: true, }, - "tags": tagsSchema(), + "tags": tagsSchema(), + "tags_all": tagsSchemaComputed(), "force_destroy": { Type: schema.TypeBool, @@ -95,11 +96,15 @@ func resourceAwsRoute53Zone() *schema.Resource { Default: false, }, }, + + CustomizeDiff: SetTagsDiff, } } func resourceAwsRoute53ZoneCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).r53conn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig + tags := defaultTagsConfig.MergeTags(keyvaluetags.New(d.Get("tags").(map[string]interface{}))) region := meta.(*AWSClient).region input := &route53.CreateHostedZoneInput{ @@ -138,7 +143,7 @@ func resourceAwsRoute53ZoneCreate(d *schema.ResourceData, meta interface{}) erro } } - if err := keyvaluetags.Route53UpdateTags(conn, d.Id(), route53.TagResourceTypeHostedzone, map[string]interface{}{}, d.Get("tags").(map[string]interface{})); err != nil { + if err := keyvaluetags.Route53UpdateTags(conn, d.Id(), route53.TagResourceTypeHostedzone, nil, tags); err != nil { return fmt.Errorf("error setting Route53 Zone (%s) tags: %s", d.Id(), err) } @@ -158,6 +163,7 @@ func resourceAwsRoute53ZoneCreate(d *schema.ResourceData, meta interface{}) erro func resourceAwsRoute53ZoneRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).r53conn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig input := &route53.GetHostedZoneInput{ @@ -226,8 +232,15 @@ func resourceAwsRoute53ZoneRead(d *schema.ResourceData, meta interface{}) error return fmt.Errorf("error listing tags for Route53 Hosted Zone (%s): %s", d.Id(), err) } - if err := d.Set("tags", tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { - return fmt.Errorf("error setting tags: %s", err) + tags = tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig) + + //lintignore:AWSR002 + if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { + return fmt.Errorf("error setting tags: %w", err) + } + + if err := d.Set("tags_all", tags.Map()); err != nil { + return fmt.Errorf("error setting tags_all: %w", err) } return nil @@ -250,8 +263,8 @@ func resourceAwsRoute53ZoneUpdate(d *schema.ResourceData, meta interface{}) erro } } - if d.HasChange("tags") { - o, n := d.GetChange("tags") + if d.HasChange("tags_all") { + o, n := d.GetChange("tags_all") if err := keyvaluetags.Route53UpdateTags(conn, d.Id(), route53.TagResourceTypeHostedzone, o, n); err != nil { return fmt.Errorf("error updating Route53 Zone (%s) tags: %s", d.Id(), err) diff --git a/aws/resource_aws_route_table.go b/aws/resource_aws_route_table.go index a4a3941b661..3469147c836 100644 --- a/aws/resource_aws_route_table.go +++ b/aws/resource_aws_route_table.go @@ -143,23 +143,28 @@ func resourceAwsRouteTable() *schema.Resource { }, Set: resourceAwsRouteTableHash, }, - "tags": tagsSchema(), + "tags": tagsSchema(), + "tags_all": tagsSchemaComputed(), "vpc_id": { Type: schema.TypeString, Required: true, ForceNew: true, }, }, + + CustomizeDiff: SetTagsDiff, } } func resourceAwsRouteTableCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig + tags := defaultTagsConfig.MergeTags(keyvaluetags.New(d.Get("tags").(map[string]interface{}))) // Create the routing table createOpts := &ec2.CreateRouteTableInput{ VpcId: aws.String(d.Get("vpc_id").(string)), - TagSpecifications: ec2TagSpecificationsFromMap(d.Get("tags").(map[string]interface{}), ec2.ResourceTypeRouteTable), + TagSpecifications: ec2TagSpecificationsFromKeyValueTags(tags, ec2.ResourceTypeRouteTable), } log.Printf("[DEBUG] RouteTable create config: %#v", createOpts) @@ -184,6 +189,7 @@ func resourceAwsRouteTableCreate(d *schema.ResourceData, meta interface{}) error func resourceAwsRouteTableRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig routeTable, err := finder.RouteTableByID(conn, d.Id()) @@ -273,10 +279,17 @@ func resourceAwsRouteTableRead(d *schema.ResourceData, meta interface{}) error { d.Set("route", route) // Tags - if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(routeTable.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { + tags := keyvaluetags.Ec2KeyValueTags(routeTable.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig) + + //lintignore:AWSR002 + if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { return fmt.Errorf("error setting tags: %w", err) } + if err := d.Set("tags_all", tags.Map()); err != nil { + return fmt.Errorf("error setting tags_all: %w", err) + } + ownerID := aws.StringValue(routeTable.OwnerId) arn := arn.ARN{ Partition: meta.(*AWSClient).partition, @@ -490,8 +503,8 @@ func resourceAwsRouteTableUpdate(d *schema.ResourceData, meta interface{}) error } } - if d.HasChange("tags") && !d.IsNewResource() { - o, n := d.GetChange("tags") + if d.HasChange("tags_all") && !d.IsNewResource() { + o, n := d.GetChange("tags_all") if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { return fmt.Errorf("error updating EC2 Route Table (%s) tags: %w", d.Id(), err) diff --git a/website/docs/r/ram_resource_share.markdown b/website/docs/r/ram_resource_share.markdown index 2e7c95021d6..9c1e79f7933 100644 --- a/website/docs/r/ram_resource_share.markdown +++ b/website/docs/r/ram_resource_share.markdown @@ -29,7 +29,7 @@ The following arguments are supported: * `name` - (Required) The name of the resource share. * `allow_external_principals` - (Optional) Indicates whether principals outside your organization can be associated with a resource share. -* `tags` - (Optional) A map of tags to assign to the resource share. +* `tags` - (Optional) A map of tags to assign to the resource share. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ## Attributes Reference @@ -37,6 +37,7 @@ In addition to all arguments above, the following attributes are exported: * `arn` - The Amazon Resource Name (ARN) of the resource share. * `id` - The Amazon Resource Name (ARN) of the resource share. +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). ## Import diff --git a/website/docs/r/rds_cluster.html.markdown b/website/docs/r/rds_cluster.html.markdown index 678a43c70b5..82bd7cb7d4c 100644 --- a/website/docs/r/rds_cluster.html.markdown +++ b/website/docs/r/rds_cluster.html.markdown @@ -131,7 +131,7 @@ The following arguments are supported: * `snapshot_identifier` - (Optional) Specifies whether or not to create this cluster from a snapshot. You can use either the name or ARN when specifying a DB cluster snapshot, or the ARN when specifying a DB snapshot. * `source_region` - (Optional) The source region for an encrypted replica DB cluster. * `storage_encrypted` - (Optional) Specifies whether the DB cluster is encrypted. The default is `false` for `provisioned` `engine_mode` and `true` for `serverless` `engine_mode`. When restoring an unencrypted `snapshot_identifier`, the `kms_key_id` argument must be provided to encrypt the restored cluster. Terraform will only perform drift detection if a configuration value is provided. -* `tags` - (Optional) A map of tags to assign to the DB cluster. +* `tags` - (Optional) A map of tags to assign to the DB cluster. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. * `vpc_security_group_ids` - (Optional) List of VPC security groups to associate with the Cluster ### S3 Import Options @@ -238,6 +238,7 @@ load-balanced across replicas * `storage_encrypted` - Specifies whether the DB cluster is encrypted * `replication_source_identifier` - ARN of the source DB cluster or DB instance if this DB cluster is created as a Read Replica. * `hosted_zone_id` - The Route53 Hosted Zone ID of the endpoint +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). [1]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.Replication.html [2]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html diff --git a/website/docs/r/rds_cluster_endpoint.html.markdown b/website/docs/r/rds_cluster_endpoint.html.markdown index dd9c5707527..56cb5cae002 100644 --- a/website/docs/r/rds_cluster_endpoint.html.markdown +++ b/website/docs/r/rds_cluster_endpoint.html.markdown @@ -87,7 +87,7 @@ The following arguments are supported: * `custom_endpoint_type` - (Required) The type of the endpoint. One of: READER , ANY . * `static_members` - (Optional) List of DB instance identifiers that are part of the custom endpoint group. Conflicts with `excluded_members`. * `excluded_members` - (Optional) List of DB instance identifiers that aren't part of the custom endpoint group. All other eligible instances are reachable through the custom endpoint. Only relevant if the list of static members is empty. Conflicts with `static_members`. -* `tags` - (Optional) Key-value map of resource tags +* `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ## Attributes Reference @@ -96,6 +96,7 @@ In addition to all arguments above, the following attributes are exported: * `arn` - Amazon Resource Name (ARN) of cluster * `id` - The RDS Cluster Endpoint Identifier * `endpoint` - A custom endpoint for the Aurora cluster +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). ## Import diff --git a/website/docs/r/rds_cluster_instance.html.markdown b/website/docs/r/rds_cluster_instance.html.markdown index 02d14991bd7..c906901c320 100644 --- a/website/docs/r/rds_cluster_instance.html.markdown +++ b/website/docs/r/rds_cluster_instance.html.markdown @@ -83,7 +83,7 @@ what IAM permissions are needed to allow Enhanced Monitoring for RDS Instances. * `performance_insights_kms_key_id` - (Optional) The ARN for the KMS key to encrypt Performance Insights data. When specifying `performance_insights_kms_key_id`, `performance_insights_enabled` needs to be set to true. * `copy_tags_to_snapshot` – (Optional, boolean) Indicates whether to copy all of the user-defined tags from the DB instance to snapshots of the DB instance. Default `false`. * `ca_cert_identifier` - (Optional) The identifier of the CA certificate for the DB instance. -* `tags` - (Optional) A map of tags to assign to the instance. +* `tags` - (Optional) A map of tags to assign to the instance. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ## Attributes Reference @@ -104,6 +104,7 @@ In addition to all arguments above, the following attributes are exported: * `dbi_resource_id` - The region-unique, immutable identifier for the DB instance. * `performance_insights_enabled` - Specifies whether Performance Insights is enabled or not. * `performance_insights_kms_key_id` - The ARN for the KMS encryption key used by Performance Insights. +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). [2]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html [3]: /docs/providers/aws/r/rds_cluster.html diff --git a/website/docs/r/rds_cluster_parameter_group.markdown b/website/docs/r/rds_cluster_parameter_group.markdown index 6e76b4bbcd8..8374edef856 100644 --- a/website/docs/r/rds_cluster_parameter_group.markdown +++ b/website/docs/r/rds_cluster_parameter_group.markdown @@ -42,7 +42,7 @@ The following arguments are supported: * `family` - (Required) The family of the DB cluster parameter group. * `description` - (Optional) The description of the DB cluster parameter group. Defaults to "Managed by Terraform". * `parameter` - (Optional) A list of DB parameters to apply. Note that parameters may differ from a family to an other. Full list of all parameters can be discovered via [`aws rds describe-db-cluster-parameters`](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-cluster-parameters.html) after initial creation of the group. -* `tags` - (Optional) A map of tags to assign to the resource. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. Parameter blocks support the following: @@ -58,7 +58,7 @@ In addition to all arguments above, the following attributes are exported: * `id` - The db cluster parameter group name. * `arn` - The ARN of the db cluster parameter group. - +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). ## Import diff --git a/website/docs/r/redshift_cluster.html.markdown b/website/docs/r/redshift_cluster.html.markdown index 026510da8ab..1a59fe1e32f 100644 --- a/website/docs/r/redshift_cluster.html.markdown +++ b/website/docs/r/redshift_cluster.html.markdown @@ -71,7 +71,7 @@ string. * `iam_roles` - (Optional) A list of IAM Role ARNs to associate with the cluster. A Maximum of 10 can be associated to the cluster at any time. * `logging` - (Optional) Logging, documented below. * `snapshot_copy` - (Optional) Configuration of automatic copy of snapshots from one region to another. Documented below. -* `tags` - (Optional) A map of tags to assign to the resource. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ### Timeouts @@ -121,6 +121,7 @@ In addition to all arguments above, the following attributes are exported: * `cluster_subnet_group_name` - The name of a cluster subnet group to be associated with this cluster * `cluster_public_key` - The public key for the cluster * `cluster_revision_number` - The specific revision number of the database in the cluster +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). ## Import diff --git a/website/docs/r/redshift_event_subscription.html.markdown b/website/docs/r/redshift_event_subscription.html.markdown index 80e2fd5f071..0dd79453cf1 100644 --- a/website/docs/r/redshift_event_subscription.html.markdown +++ b/website/docs/r/redshift_event_subscription.html.markdown @@ -57,7 +57,7 @@ The following arguments are supported: * `severity` - (Optional) The event severity to be published by the notification subscription. Valid options are `INFO` or `ERROR`. * `event_categories` - (Optional) A list of event categories for a SourceType that you want to subscribe to. See https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-event-notifications.html or run `aws redshift describe-event-categories`. * `enabled` - (Optional) A boolean flag to enable/disable the subscription. Defaults to true. -* `tags` - (Optional) A map of tags to assign to the resource. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ## Attributes Reference @@ -66,6 +66,7 @@ In addition to all arguments above, the following attributes are exported: * `arn` - Amazon Resource Name (ARN) of the Redshift event notification subscription * `id` - The name of the Redshift event notification subscription * `customer_aws_id` - The AWS customer account associated with the Redshift event notification subscription +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). ## Import diff --git a/website/docs/r/redshift_parameter_group.html.markdown b/website/docs/r/redshift_parameter_group.html.markdown index bb32df9f8ba..6b73376635d 100644 --- a/website/docs/r/redshift_parameter_group.html.markdown +++ b/website/docs/r/redshift_parameter_group.html.markdown @@ -47,7 +47,7 @@ Parameter blocks support the following: * `name` - (Required) The name of the Redshift parameter. * `value` - (Required) The value of the Redshift parameter. -* `tags` - (Optional) A map of tags to assign to the resource. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. You can read more about the parameters that Redshift supports in the [documentation](http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-parameter-groups.html) @@ -57,6 +57,7 @@ In addition to all arguments above, the following attributes are exported: * `arn` - Amazon Resource Name (ARN) of parameter group * `id` - The Redshift parameter group name. +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). ## Import diff --git a/website/docs/r/redshift_snapshot_copy_grant.html.markdown b/website/docs/r/redshift_snapshot_copy_grant.html.markdown index 91cf613b958..11ef0561db1 100644 --- a/website/docs/r/redshift_snapshot_copy_grant.html.markdown +++ b/website/docs/r/redshift_snapshot_copy_grant.html.markdown @@ -34,13 +34,14 @@ The following arguments are supported: * `snapshot_copy_grant_name` - (Required, Forces new resource) A friendly name for identifying the grant. * `kms_key_id` - (Optional, Forces new resource) The unique identifier for the customer master key (CMK) that the grant applies to. Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify a CMK in a different AWS account, you must use the key ARN. If not specified, the default key is used. -* `tags` - (Optional) A map of tags to assign to the resource. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ## Attributes Reference In addition to all arguments above, the following attributes are exported: * `arn` - Amazon Resource Name (ARN) of snapshot copy grant +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). ## Import diff --git a/website/docs/r/redshift_snapshot_schedule.html.markdown b/website/docs/r/redshift_snapshot_schedule.html.markdown index e69fdd14dde..575a871eae1 100644 --- a/website/docs/r/redshift_snapshot_schedule.html.markdown +++ b/website/docs/r/redshift_snapshot_schedule.html.markdown @@ -29,13 +29,14 @@ identifier beginning with the specified prefix. Conflicts with `identifier`. * `description` - (Optional) The description of the snapshot schedule. * `definitions` - (Optional) The definition of the snapshot schedule. The definition is made up of schedule expressions, for example `cron(30 12 *)` or `rate(12 hours)`. * `force_destroy` - (Optional) Whether to destroy all associated clusters with this snapshot schedule on deletion. Must be enabled and applied before attempting deletion. -* `tags` - (Optional) A map of tags to assign to the resource. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ## Attributes Reference In addition to all arguments above, the following attributes are exported: * `arn` - Amazon Resource Name (ARN) of the Redshift Snapshot Schedule. +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). ## Import diff --git a/website/docs/r/redshift_subnet_group.html.markdown b/website/docs/r/redshift_subnet_group.html.markdown index 1f42bd6db52..3a80245c81e 100644 --- a/website/docs/r/redshift_subnet_group.html.markdown +++ b/website/docs/r/redshift_subnet_group.html.markdown @@ -54,7 +54,7 @@ The following arguments are supported: * `name` - (Required) The name of the Redshift Subnet group. * `description` - (Optional) The description of the Redshift Subnet group. Defaults to "Managed by Terraform". * `subnet_ids` - (Required) An array of VPC subnet IDs. -* `tags` - (Optional) A map of tags to assign to the resource. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ## Attributes Reference @@ -62,6 +62,7 @@ In addition to all arguments above, the following attributes are exported: * `arn` - Amazon Resource Name (ARN) of the Redshift Subnet group name * `id` - The Redshift Subnet group ID. +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). ## Import diff --git a/website/docs/r/resourcegroups_group.html.markdown b/website/docs/r/resourcegroups_group.html.markdown index ed0fbfa8db4..1c7fbe9a8ba 100644 --- a/website/docs/r/resourcegroups_group.html.markdown +++ b/website/docs/r/resourcegroups_group.html.markdown @@ -41,7 +41,7 @@ The following arguments are supported: * `name` - (Required) The resource group's name. A resource group name can have a maximum of 127 characters, including letters, numbers, hyphens, dots, and underscores. The name cannot start with `AWS` or `aws`. * `description` - (Optional) A description of the resource group. * `resource_query` - (Required) A `resource_query` block. Resource queries are documented below. -* `tags` - (Optional) Key-value map of resource tags +* `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. An `resource_query` block supports the following arguments: @@ -53,6 +53,7 @@ An `resource_query` block supports the following arguments: In addition to all arguments above, the following attributes are exported: * `arn` - The ARN assigned by AWS for this resource group. +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). ## Import diff --git a/website/docs/r/route53_health_check.html.markdown b/website/docs/r/route53_health_check.html.markdown index 00e686bf9a0..2660954e8f5 100644 --- a/website/docs/r/route53_health_check.html.markdown +++ b/website/docs/r/route53_health_check.html.markdown @@ -110,15 +110,14 @@ The following arguments are supported: * `cloudwatch_alarm_region` - (Optional) The CloudWatchRegion that the CloudWatch alarm was created in. * `insufficient_data_health_status` - (Optional) The status of the health check when CloudWatch has insufficient data about the state of associated alarm. Valid values are `Healthy` , `Unhealthy` and `LastKnownStatus`. * `regions` - (Optional) A list of AWS regions that you want Amazon Route 53 health checkers to check the specified endpoint from. - -* `tags` - (Optional) A map of tags to assign to the health check. +* `tags` - (Optional) A map of tags to assign to the health check. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ## Attributes Reference In addition to all arguments above, the following attributes are exported: * `id` - The id of the health check - +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). ## Import diff --git a/website/docs/r/route53_resolver_endpoint.html.markdown b/website/docs/r/route53_resolver_endpoint.html.markdown index 85070935485..24c76521fc3 100644 --- a/website/docs/r/route53_resolver_endpoint.html.markdown +++ b/website/docs/r/route53_resolver_endpoint.html.markdown @@ -48,7 +48,7 @@ or `OUTBOUND` (resolver forwards DNS queries from the DNS service for a VPC to y to your network (for outbound endpoints) or on the way from your network to your VPCs (for inbound endpoints). Described below. * `security_group_ids` - (Required) The ID of one or more security groups that you want to use to control access to this VPC. * `name` - (Optional) The friendly name of the Route 53 Resolver endpoint. -* `tags` - (Optional) A map of tags to assign to the resource. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. The `ip_address` object supports the following: @@ -62,6 +62,7 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the Route 53 Resolver endpoint. * `arn` - The ARN of the Route 53 Resolver endpoint. * `host_vpc_id` - The ID of the VPC that you want to create the resolver endpoint in. +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). ## Timeouts diff --git a/website/docs/r/route53_resolver_firewall_rule_group.markdown b/website/docs/r/route53_resolver_firewall_rule_group.markdown index 3dd973fc3f0..36e21ca0e43 100644 --- a/website/docs/r/route53_resolver_firewall_rule_group.markdown +++ b/website/docs/r/route53_resolver_firewall_rule_group.markdown @@ -23,7 +23,7 @@ resource "aws_route53_resolver_firewall_rule_group" "example" { The following argument is supported: * `name` - (Required) A name that lets you identify the rule group, to manage and use it. -* `tags` - (Optional) A map of tags to assign to the resource. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ## Attributes Reference @@ -33,6 +33,7 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the rule group. * `owner_id` - The AWS account ID for the account that created the rule group. When a rule group is shared with your account, this is the account that has shared the rule group with you. * `share_status` - Whether the rule group is shared with other AWS accounts, or was shared with the current account by another AWS account. Sharing is configured through AWS Resource Access Manager (AWS RAM). Valid values: `NOT_SHARED`, `SHARED_BY_ME`, `SHARED_WITH_ME` +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). ## Import diff --git a/website/docs/r/route53_resolver_query_log_config.html.markdown b/website/docs/r/route53_resolver_query_log_config.html.markdown index 1c994e97490..e612fbf1479 100644 --- a/website/docs/r/route53_resolver_query_log_config.html.markdown +++ b/website/docs/r/route53_resolver_query_log_config.html.markdown @@ -30,7 +30,7 @@ The following arguments are supported: * `destination_arn` - (Required) The ARN of the resource that you want Route 53 Resolver to send query logs. You can send query logs to an [S3 bucket](s3_bucket.html), a [CloudWatch Logs log group](cloudwatch_log_group.html), or a [Kinesis Data Firehose delivery stream](kinesis_firehose_delivery_stream.html). * `name` - (Required) The name of the Route 53 Resolver query logging configuration. -* `tags` - (Optional) A map of tags to assign to the resource. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ## Attributes Reference @@ -42,6 +42,7 @@ In addition to all arguments above, the following attributes are exported: * `share_status` - An indication of whether the query logging configuration is shared with other AWS accounts, or was shared with the current account by another AWS account. Sharing is configured through AWS Resource Access Manager (AWS RAM). Values are `NOT_SHARED`, `SHARED_BY_ME` or `SHARED_WITH_ME` +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). ## Import diff --git a/website/docs/r/route53_resolver_rule.html.markdown b/website/docs/r/route53_resolver_rule.html.markdown index 7da51bd4378..3bb1749113e 100644 --- a/website/docs/r/route53_resolver_rule.html.markdown +++ b/website/docs/r/route53_resolver_rule.html.markdown @@ -51,7 +51,7 @@ The following arguments are supported: This argument should only be specified for `FORWARD` type rules. * `target_ip` - (Optional) Configuration block(s) indicating the IPs that you want Resolver to forward DNS queries to (documented below). This argument should only be specified for `FORWARD` type rules. -* `tags` - (Optional) A map of tags to assign to the resource. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. The `target_ip` object supports the following: @@ -67,6 +67,7 @@ In addition to all arguments above, the following attributes are exported: * `owner_id` - When a rule is shared with another AWS account, the account ID of the account that the rule is shared with. * `share_status` - Whether the rules is shared and, if so, whether the current account is sharing the rule with another account, or another account is sharing the rule with the current account. Values are `NOT_SHARED`, `SHARED_BY_ME` or `SHARED_WITH_ME` +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). ## Import diff --git a/website/docs/r/route53_zone.html.markdown b/website/docs/r/route53_zone.html.markdown index 8f6b9ee48a9..cd1dba60261 100644 --- a/website/docs/r/route53_zone.html.markdown +++ b/website/docs/r/route53_zone.html.markdown @@ -72,7 +72,7 @@ The following arguments are supported: * `comment` - (Optional) A comment for the hosted zone. Defaults to 'Managed by Terraform'. * `delegation_set_id` - (Optional) The ID of the reusable delegation set whose NS records you want to assign to the hosted zone. Conflicts with `vpc` as delegation sets can only be used for public zones. * `force_destroy` - (Optional) Whether to destroy all records (possibly managed outside of Terraform) in the zone when destroying the zone. -* `tags` - (Optional) A map of tags to assign to the zone. +* `tags` - (Optional) A map of tags to assign to the zone. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. * `vpc` - (Optional) Configuration block(s) specifying VPC(s) to associate with a private hosted zone. Conflicts with the `delegation_set_id` argument in this resource and any [`aws_route53_zone_association` resource](/docs/providers/aws/r/route53_zone_association.html) specifying the same zone ID. Detailed below. ### vpc Argument Reference @@ -87,6 +87,7 @@ In addition to all arguments above, the following attributes are exported: * `zone_id` - The Hosted Zone ID. This can be referenced by zone records. * `name_servers` - A list of name servers in associated (or default) delegation set. Find more about delegation sets in [AWS docs](https://docs.aws.amazon.com/Route53/latest/APIReference/actions-on-reusable-delegation-sets.html). +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). ## Import diff --git a/website/docs/r/route_table.html.markdown b/website/docs/r/route_table.html.markdown index c2a61864226..d3e9b4228b7 100644 --- a/website/docs/r/route_table.html.markdown +++ b/website/docs/r/route_table.html.markdown @@ -72,7 +72,7 @@ The following arguments are supported: * `vpc_id` - (Required) The VPC ID. * `route` - (Optional) A list of route objects. Their keys are documented below. This argument is processed in [attribute-as-blocks mode](https://www.terraform.io/docs/configuration/attr-as-blocks.html). This means that omitting this argument is interpreted as ignoring any existing routes. To remove all managed routes an empty list should be specified. See the example above. -* `tags` - (Optional) A map of tags to assign to the resource. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. * `propagating_vgws` - (Optional) A list of virtual gateways for propagation. ### route Argument Reference @@ -108,6 +108,7 @@ attribute once the route resource is created. * `id` - The ID of the routing table. * `arn` - The ARN of the route table. * `owner_id` - The ID of the AWS account that owns the route table. +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). ## Import