Example Built-In Policy Initiative Assignment fails
thecomalley opened this issue · comments
Chris O'Malley commented
Issue Template
I'm getting the below issue when running the example: Built-In Policy Initiative Assignment
Prerequisites
- I am running the latest version
- I checked the documentation and found no answer
- I checked to make sure that this issue has not already been filed
Context
- Module Version: 2.6.1
- Terraform Version: v1.2.9
- AzureRM Provider Version: v3.21.1
data "azurerm_policy_set_definition" "cis_1_3_0" {
display_name = "CIS Microsoft Azure Foundations Benchmark v1.3.0"
}
module org_mg_cis_1_3_0_benchmark {
source = "gettek/policy-as-code/azurerm//modules/set_assignment"
initiative = data.azurerm_policy_set_definition.cis_1_3_0
assignment_scope = var.management_group_ids.core
assignment_parameters = {
"effect-b954148f-4c11-4c38-8221-be76711e194a-MicrosoftSql-servers-firewallRules-delete" = "Disabled"
}
}
Expected Behavior
Successful terraform plan
Current Behavior
Possible Solution
Failure Information (for bugs)
│ Error: Error in function call
│
│ on .terraform/modules/org_mg_cis_1_3_0_benchmark/modules/set_assignment/variables.tf line 144, in locals:
│ 144: role_definition_ids = var.skip_role_assignment == false ? coalescelist(var.role_definition_ids, try(var.initiative.role_definition_ids, [])) : []
│ ├────────────────
│ │ var.initiative is object with 12 attributes
│ │ var.role_definition_ids is empty list of string
│
│ Call to function "coalescelist" failed: no non-null arguments.