-
Notifications
You must be signed in to change notification settings - Fork 113
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
Add consul_config_entry datasource #318
Add consul_config_entry datasource #318
Conversation
I'm not updating the docs in this pull request as I will switch the whole provider to use terraform-plugin-docs in hashicorp#309. I will update the documentation after merging this PR. Closes hashicorp#317
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @remilapeyre
I have a question about the config entry id uniqueness in here.
return err | ||
} | ||
|
||
d.SetId(fmt.Sprintf("%s/%s", kind, name)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't id collide with other config entries with the same kind/name in other partitions/namespaces?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id
in Terraform resources or datasources is often unique but does not need to, when objects don't have a specific ID it can happen that they have the same of another.
For example Consul has this at https://github.com/hashicorp/terraform-provider-consul/blob/master/consul/resource_consul_keys.go#L188-L191 where all consul_keys
resources will have the same id
no matter the keys being set and another occurence of this in the Vault provider is at https://github.com/hashicorp/terraform-provider-vault/blob/main/vault/resource_generic_endpoint.go#L111 where multiple vault_generic_endpoint
resources can have the same id
despite being in different namespace.
Here because config entries do not have IDs and the user won't use it it does not matter what placeholder we use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
I'm not updating the docs in this pull request as I will switch the
whole provider to use terraform-plugin-docs in
#309. I will
update the documentation after merging this PR.
Closes #317