-
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
[Feature] Support Secret for consul_acl_token #289
Comments
Hi @sebastianreloaded, we decided against returning the secret id in The Kubernetes, JWT and OIDC authentication methods can be used to set up authentication and have applications connect to the Consul cluster without having to pass the secret ID around. The Consul backend of Vault can also be used to securely have application obtain Consul tokens. If you really want to get the secret ID in the Terraform code you can use Does this solve your issue? |
Hi @remilapeyre, i was talking about setting the secretID when creating a token, not returning the created token. |
Just wanted to add that this is also something we'd like to do, we might make a PR with the functionality if that would be helpful! |
This would be really helpful for us. The Consul API for token create supports setting a secret id in the API request, there's no reason the terraform provider shouldn't support the same attributes as the API. It's common for terraform to manage secret values (aws access keys), and it's left up to the user to ensure their state is secure. The option to specify a secret ID helps operators avoid the chicken/egg problem when spinning up a cluster. I get that there are other options mentioned for managing authentication, but not everyone will use those, which is why the API supports setting a secret id. Any chance this can be added to the roadmap @remilapeyre? 🙏 In the meantime, one workaround is to create these with
We pre-create the tokens and then store them in AWS SSM Parameter store. This makes bootstrapping the cluster much easier. |
Hey @remilapeyre 👋 Given the uses cases described above, could this feature be added to your roadmap? It should be a relatively small task: Add a |
The original reason for not storing However, its the accepted norm now that your Terraform state needs to be securely stored and access controlled because something sensitive will find it's way into the state. This eliminates the reason for not adding this. I think it needs to be revisited. It greatly simplifies automated provisioning if you can pre-generate the tokens (secret_id). |
After using the null_resource for a long time, i now compile my own version of the provider and use "dev_overrides" in .terraformrc. Has anyone better ideas? |
It would be helpful to support the SecretID when creating tokens, so i am not forced to use the command line:
consul acl token create -policy-name "$POLICYNAME" -description "Agent Token" -secret=$TOKENSECRET
Affected Resource(s)
References
terraform-provider-consul/vendor/github.com/hashicorp/consul/api/acl.go
Line 31 in e3c5fd4
terraform-provider-consul/vendor/github.com/hashicorp/consul/api/acl.go
Line 606 in e3c5fd4
The text was updated successfully, but these errors were encountered: