Skip to content

Commit

Permalink
Merge pull request #31162 from hashicorp/deprecate-data-source-tags_all
Browse files Browse the repository at this point in the history
Deprecate data source `tags_all` attributes
  • Loading branch information
ewbankkit authored May 4, 2023
2 parents fac7a01 + 35049df commit 9e11402
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .changelog/31162.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```release-note:note
data-source/aws_service_discovery_service: The `tags_all` attribute has been deprecated and will be removed in a future version
```

```release-note:note
data-source/aws_quicksight_data_set: The `tags_all` attribute has been deprecated and will be removed in a future version
```
12 changes: 12 additions & 0 deletions .ci/semgrep/tags/ds-tags-all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
rules:
- id: data-source-with-resource-read
languages: [go]
message: Data sources should not have a `tags_all` attribute
paths:
include:
- internal/service/**/*_data_source.go
patterns:
- pattern-either:
- pattern-regex: '"tags_all":\s*tftags.TagsSchemaComputed'
- pattern-regex: 'names\.AttrTagsAll:\s*tftags.TagsSchemaComputed'
severity: WARNING
10 changes: 8 additions & 2 deletions internal/service/quicksight/data_set_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,14 @@ func DataSourceDataSet() *schema.Resource {
},
},
},
"tags": tftags.TagsSchemaComputed(),
"tags_all": tftags.TagsSchemaComputed(),
"tags": tftags.TagsSchemaComputed(),
"tags_all": {
Type: schema.TypeMap,
Optional: true,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
Deprecated: `this attribute has been deprecated`,
},
},
}
}
Expand Down
10 changes: 8 additions & 2 deletions internal/service/servicediscovery/service_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,14 @@ func DataSourceService() *schema.Resource {
Type: schema.TypeString,
Required: true,
},
"tags": tftags.TagsSchema(),
"tags_all": tftags.TagsSchemaComputed(),
"tags": tftags.TagsSchema(),
"tags_all": {
Type: schema.TypeMap,
Optional: true,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
Deprecated: `this attribute has been deprecated`,
},
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion website/docs/d/service_discovery_service.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ In addition to all arguments above, the following attributes are exported:
* `health_check_config` - Complex type that contains settings for an optional health check. Only for Public DNS namespaces.
* `health_check_custom_config` - A complex type that contains settings for ECS managed health checks.
* `tags` - Map of tags to assign to the service. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level.
* `tags_all` - Map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block).
* `tags_all` - (**Deprecated**) Map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block).

### dns_config

Expand Down

0 comments on commit 9e11402

Please sign in to comment.