-
-
Notifications
You must be signed in to change notification settings - Fork 386
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
set k3s_token output to sensitive #1002
Conversation
To reduce the risk of accidentally exporting sensitive data that was intended to be only internal, Terraform requires that any root module output containing sensitive data be explicitly marked as sensitive, to confirm your intent. If you do intend to export this data, annotate the output value as sensitive by adding the following argument: sensitive = true
@aleksasiriski @ifeulner @M4t7e What do you folks think of this? I guess we had it sensitive before but somehow this was changed back to non sensitive. More context: If you attempt to use a sensitive output directly in another resource as an input parameter, Terraform will throw an error. This is because the type system now tracks sensitivity, and it prohibits using a sensitive value in a non-sensitive field. However, you can still use sensitive outputs programmatically via workarounds:
|
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.
@netzding My take on this is that we should let the user choose on that field being sensitve or not. Could you please create a boolean output_k3s_token_sensitive
with a default value of false. And also mention it along the other variables in kube.tf.example for reference.
There was some integration issue, yes. I think I marked it once as sensitive, but then some things break. |
The reason why I added this is because internally random_password.k3s_token.result is already considered sensitive and therefore in the current state you cannot use the module as root module (I use terragrunt to compose several terraform modules to my infrastructure). As an alternative if you want to keep the k3s_token non-sensitive you should do so explicitly by wrapping it with the nonsensitive function: Right now as a workaround I use the terragrunt overwrite function to overwrite the outputs.tf (For anyone who is facing the same issue) |
The sensitive flag cannot be set conditionally based on variables:
So the proposed flag does not make sense in my opinion as I don't see a way to properly switch between both behaviours. Don't know if the integration issues can be solved somehow and what in general you opinion is whether efforts should be made in general to set this to sensitive. |
@netzding Thanks for hanging in there. We will merge this PR to mark it as sensitive and bump the version and announce potentially breaking changes on that. Hopefully it will not affect many people. This seems like the cleanest way to proceed. |
To reduce the risk of accidentally exporting sensitive data that was intended to be only internal, Terraform requires that any root module output containing sensitive data be explicitly marked as sensitive, to confirm your intent.
If you do intend to export this data, annotate the output value as sensitive by adding the following argument:
sensitive = true