-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
HMAC Key/ServiceAccount Key Data field is declared sensitive (but maybe should not be?) #8943
Comments
Is the declaration of As it is right now, creating a HMAC key or GCP serviceaccount via Terraform on this provider version is almost pointless because you cannot get the secret data to use it effectively. Admittedly for ServiceAccounts this actually might be fine, since you could use it via other means such as through Workflow Identity, but you would be unable to directly impersonate as that ServiceAccount unless you create a new key -- which defeats the object of using Terraform to create the ServiceAccount key in the first place, not to mention the infrastructure is now diverged from the Terraform definition. If I force Terraform to use a version of the provider from before |
Ah, I think I have a (probably better) way of getting the data rather than using the resource "local_file" "test_hmac_secret" {
sensitive_content = google_storage_hmac_key.test-sa-hmac-key.secret
filename = "test-sa.hmac_secret"
} This seems to work with the ServiceAccount secret key as well. So I will close this issue. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
0.15.0
Affected Resource(s)
Terraform Configuration Files
Debug Output
Available if required
Panic Output
N/A
Expected Behavior
HMAC key/ServiceAccount secret data output as per previous version
Actual Behavior
I used to use an older version of terraform (0.12.29) and when running this configuration on that version, I did not require the
sensitive
attribute on the secret key field.I used to use the
terraform output
command to obtain values of the resources terraform created during theapply
, including the secret value of the HMAC key as this is only available at the time of creation ( you cannot retrieve this information after the key is created ), and similarly with the ServiceAccount key -- you cannot retrieve the key data after you have created it.However, with the newer version of Terraform (which presumably also grabs a later version of the provider), this field is now declared as sensitive, meaning I have to use
sensitive = true
in order for theapply
to work. This also redacts the data on the output, and requesting the output of that field is no longer possible. Meaning I cannot use the HMAC key or ServiceAccount created by Terraform.Yes, I could create the key and ServiceAccount outside of Terraform, but that means the state of the infrastructure has diverged from what is declared in the terraform files.
So the question is, is there another way I can retrieve this information from within Terraform, if I cannot retrieve the data via the
terraform output
command?Steps to Reproduce
terraform plan -out tfplan
terraform apply tfplan
Important Factoids
N/A
References
The text was updated successfully, but these errors were encountered: