Hi there,
I have tried to use uuid() for generating a unique filename, what follows is a simplified example but it reproduces perfectly the issue
variable "filename" {}
resource "null_resource" "zip" {
provisioner "local-exec" {
command = "zip -r ${var.filename}.zip main.tf"
}
}
Invoking the module
module "zip1" {
source = "modules/example"
filename = "test-${uuid()}"
}
launching terraform with plan/apply, it hangs on indefinitely.
Terraform Version: 0.8.4 on El Capitan 10.11.6 and 0.8.5 on RHEL7
Hi @gurdulu, thanks for the issue!
It doesn't solve the issue, but I was able to workaround it by using the timestamp() interpolation function inside the local-exec provisioner.
Hi @grubernaut
Thank you for the tip.
I used a slightly different approach for being sure the value is different each time the module is invoked
resource "random_id" "random" {
keepers {
tm = "${timestamp()}"
}
byte_length = 8
}
and then using the hexadecimal output of the resource
filename = "file-${random_id.random.hex}"
Will be fixed by #11733. Thanks!
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.
Most helpful comment
Hi @grubernaut
Thank you for the tip.
I used a slightly different approach for being sure the value is different each time the module is invoked
and then using the hexadecimal output of the resource