Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate data source tags_all attributes #31162

Merged
merged 5 commits into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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