Terraform Version
$ terraform -v
Terraform v0.15.4
Terraform Configuration Files
module “policyset_definitions” {
source = “./modules/policyset-definitions”
depends_on = [module.policy_definitions]
policy_def_set_name = var.policy_def_set_name
policy_def_type = var.policy_def_type
policyset_definition_category = var.policyset_definition_category
custom_default_nsg_policies = [
{
policyID = module.policy_definitions.policy_defination_ids[index([module.policy_definitions.policy_defination_ids], [for i in [module.policy_definitions.policy_defination_ids]: i])]
}
]
}
Debug Output
│ on main.tf line 32, in module “policyset_definitions”:
│ 32: policyID = module.policy_definitions.policy_defination_ids[index((var.policy_name),[for i in var.policy_name: i])] #each.key)]
│ ├────────────────
│ │ var.policy_name is list of string with 13 elements
│
│ Call to function “index” failed: item not found.