-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
count logic does not work, bug or docs issue? #18015
Comments
by the way, I am using the exact same code in an existing larger TF folder, and it works. Well, sometimes. That worksmodule "language_batch" {
source = "helpers/group-role-with-policies"
create_role = 1
team = "language"
name = "batch"
policies = [
#"${aws_iam_policy.language_batch_evaluation.arn}",
"1234",
]
assume_role_policy = "${data.aws_iam_policy_document.gen_assume_role_default.json}"
} That does notmodule "language_batch" {
source = "helpers/group-role-with-policies"
create_role = 1
team = "language"
name = "batch"
# THIS CHANGED ....
policies = [
"${aws_iam_policy.language_batch_evaluation.arn}",
#"1234",
]
assume_role_policy = "${data.aws_iam_policy_document.gen_assume_role_default.json}"
} final remarkIt is not the policy definition. Cause if I remove the " I am seriously confused and pretty annoyed, cause this super-weird and completely intransparent behavior cost me at least 2 hours, in which I could have reorganized our IAM permissions, etc. |
Hi @flypenguin, Sorry this is causing you trouble. The count issue here can be somewhat hard to decipher if you don't know what's going on. The value for This is a known shortcoming of the current HCL libraries, which we intend to handle in the next major release. We're tracking this in a number of open issues already, with #16712 being the most similar. |
edit I guess I understand now if I read #16712 ... that is so weird. I hope this is being fixed soon. it makes terraform so unpredictable. |
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
Attached as ZIP file. The relevant files are:
team-groups-policies.tf
helpers/group-role-with-policies/main.tf
The most relevant parts are:
... and ...
Debug Output
In ZIP archive, a file called "TRACE"
Crash Output
No crash.
Expected Behavior
It should have created a group with two policy attachments.
Actual Behavior
Error message:
* [...]: value of 'count' cannot be computed
Steps to Reproduce
terraform init
terraform plan
Additional Context
N/A
References
N/A
The text was updated successfully, but these errors were encountered: