-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Terraform v0.14.0 Panic with templatefile and sensitive variable #27253
Comments
Hi @DarkMukke, thanks for reporting this. Like you, I was unable to reproduce the bug with the configuration you gave. From reading the stack trace, I think this is most likely a case of doubly-marked variables: a This allowed me to reproduce the same crash with 0.14.0 and the following configuration. main.tf variable "password" {
type = string
sensitive = true
default = "password"
}
module "tmpl" {
source = "./tmpl"
password = var.password
} tmpl/main.tf variable "password" {
type = string
sensitive = true
}
resource "local_file" "test" {
filename = "${path.module}/test.txt"
content = templatefile("${path.module}/test.tpl", {
password = var.password
})
} tmpl/test.tpl ${password} Can you try upgrading to the 0.14.2 release and see if the issue is fixed for you? |
Spot on on the sensitive chain, i should have explained it better, it was a sensitive value in a wrapper module that was calling another module that also had the variable set as sensitive. Testing with v0.14.2 it works as expected. |
I'm on v0.14.3 and reproduced the error. I think it has to do with Given the file
and
I get the error:
|
@schnerring Thanks for your additional report. I believe that is a duplicate of #27336, which has a pending fix in the upstream library. |
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
It worked fine before i marked a variable as sensitive, not sure if the panic is related.
Terraform Version
Crash Output
But then running a separate test
test.tf
test.tpl
Works fine, so i don't get it.
When I remove the
sensitive = true
from the variable definition, it works fine.The text was updated successfully, but these errors were encountered: