-
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 destroy error when referencing a random_id resource in a module's locals block #18424
Comments
@jbardin: is there any other information I can provide? I am wondering since this issue is currently blocking us in our project. Let me know if we can collaborate somehow! |
Hi @metmajer, Thanks for following up. There's nothing else we need here, this is related to some known edge cases with destroy time dependencies. It's likely to be the same root cause as #18026, but I'll leave this open until I can verify. Once we can unfreeze the master branch after the 0.12 work is complete we can work on resolving these. |
I'm having the same issue when trying to destroy. Error: Error applying plan:
1 error occurred:
* local.db_password: local.db_password: Resource 'random_id.uuid' does not have attribute 'hex' for variable 'random_id.uuid.hex'
Is there any workaround for it meanwhile ? |
@jbardin It still is failing with 0.11.14. |
Hello, This particular problem is no longer reproduced with Terraform 0.12. Users experiencing similar errors with 0.12 are not likely from the same root cause, and we ask that a new issue be opened in that case. Since there is no more planned development for 0.11, we are going to close out this issue. 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. |
Terraform Version
Terraform Configuration Files
Debug Output
See https://gist.github.com/metmajer/11063a52fb166a1d228fe115b637da91#file-terraform-destroy-log.
Expected Behavior
terraform destroy
should not complain about anil
reference inrandom_id
.Actual Behavior
In a newly initialized workspace,
terraform destroy
issues the following error:Steps to Reproduce
terraform init
terraform destroy
Additional Context
I could only reproduce the issue if
${random_id.random.hex}
is passed on to a module AND if the module references the passed-on variable in alocals
block. See${var.uuid}
in https://github.com/metmajer/terraform-aws-ec2/blob/master/main.tf.If https://github.com/metmajer/terraform-aws-ec2/blob/master/main.tf was changed to https://github.com/metmajer/terraform-aws-ec2/blob/no-locals/main.tf, the error does not occur.
It appears that I needed to
rm -rf terraform.tfstate* .terraform; terraform init
before validating that the error does not occur with https://github.com/metmajer/terraform-aws-ec2/blob/no-locals/main.tf. Otherwise, the error persisted.References
Related issues are:
The text was updated successfully, but these errors were encountered: