IssueRaiser

Entire local-exec command output suppressed with use of sensitive variable

Marking a variable as sensitive and referencing that variable in a local-exec provisioner command or in the environment block suppresses **all** lines of the command output. My use case (not shown in example TF): Ansible playbook called via a `null_resource` local-exec provisioner where values required by Ansible are passed via environment variables. As you might expect the Ansible output is crucial for troubleshooting issues and watching for timeouts, especially for complex config mgmt situations. I'd rather have the variable not marked as sensitive than lose the command output -- bummer. Perhaps Terraform could _just_ redact the value itself? Thank you TF Team! ### Terraform Version ``` Terraform v0.14.0 + provider registry.terraform.io/dmacvicar/libvirt v0.6.3 + provider registry.terraform.io/hashicorp/local v2.0.0 + provider registry.terraform.io/hashicorp/null v3.0.0 + provider registry.terraform.io/hashicorp/template v2.2.0 ``` ### Terraform Configuration Files ```terraform variable "foo" { type = string sensitive = true } # environment variable example resource "null_resource" "foobar" { triggers = { always_run = timestamp() } provisioner "local-exec" { command = "command-that-does-not-include-templated-reference-to-var-foo" environment = { FOO = var.foo } } } ``` ### Debug Output N/A? ### Crash Output N/A ### Expected Behavior As mentioned above, ideally the behavior is similar to CI platforms (Jenkins comes to m

Posted by marshallford on Dec 5, 2020, 5:31 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments

reliability (Other)

Entire local-exec command output suppressed with use of sensitive variable

marshallfordDec 5, 2020, 5:31 AM

Marking a variable as sensitive and referencing that variable in a local-exec provisioner command or in the environment block suppresses **all** lines of the command output. My use case (not shown in example TF): Ansible playbook called via a `null_resource` local-exec provisioner where values required by Ansible are passed via environment variables. As you might expect the Ansible output is crucial for troubleshooting issues and watching for timeouts, especially for complex config mgmt situations. I'd rather have the variable not marked as sensitive than lose the command output -- bummer. Perhaps Terraform could _just_ redact the value itself? Thank you TF Team! ### Terraform Version ``` Terraform v0.14.0 + provider registry.terraform.io/dmacvicar/libvirt v0.6.3 + provider registry.terraform.io/hashicorp/local v2.0.0 + provider registry.terraform.io/hashicorp/null v3.0.0 + provider registry.terraform.io/hashicorp/template v2.2.0 ``` ### Terraform Configuration Files ```terraform variable "foo" { type = string sensitive = true } # environment variable example resource "null_resource" "foobar" { triggers = { always_run = timestamp() } provisioner "local-exec" { command = "command-that-does-not-include-templated-reference-to-var-foo" environment = { FOO = var.foo } } } ``` ### Debug Output N/A? ### Crash Output N/A ### Expected Behavior As mentioned above, ideally the behavior is similar to CI platforms (Jenkins comes to m

Comments (0)

No comments yet. Start the discussion.

Comment on this issue