Skip to content

Fix types in variables

Compare
Choose a tag to compare
@bohdantverdyi bohdantverdyi released this 05 Oct 15:53
· 3 commits to master since this release
5a43408
Use type for variables (#25)

When working with Terragrunt we encountered an issue with variables that have no type set and are being used in a for-each loop. 

See here for the error:

│ Error: Invalid dynamic for_each value
│ 
│   on main.tf line 27, in resource "helm_release" "cert_manager":
│   27:     for_each = var.additional_set
│     ├────────────────
│     │ var.additional_set is "{\"serviceAccount\":{\"name\":\"serviceAccount.annotations.eks\\\\.amazonaws\\\\.com/role-arn\",\"value\":\"arn:aws:iam::XXXXXXX:role/some-role\"}}"
│ 
│ Cannot use a string value in for_each. An iterable collection is required.