-
Notifications
You must be signed in to change notification settings - Fork 70
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
Initiative fails for built-in policies without parameters #104
Comments
Hi, I have just checked the code and think that this line could solve our issues: Hoping for a quick fix. Thank you. |
I would also argue the need of using coalesce with first and third parameters set to |
|
Thanks for the link. The described workaround is needed when one has multiple variables that need to be coalesced and can all be null. In the current case, we have only one variable |
I've removed the coalesce as the formatting fixes released in 2.9.0 addressed previous issues around null attributes. NOTE: if you want to mix both built-ins and customs in a set, you will need to data "azurerm_policy_definition" "tst" {
for_each = toset([
"Audit VMs that do not use managed disks",
"Monitor missing Endpoint Protection in Azure Security Center",
])
display_name = each.key
}
module "initiative" {
source = "..//modules/initiative"
initiative_name = "test_initiative"
initiative_display_name = "Test Initiative"
initiative_description = "Description"
initiative_category = "Security"
initiative_version = "1.0.0"
management_group_id = data.azurerm_management_group.org.id
merge_effects = false
member_definitions = concat(
[for d in data.azurerm_policy_definition.tst: d],
[
module.configure_asc["auto_enroll_subscriptions"].definition,
module.configure_asc["auto_provision_log_analytics_agent_custom_workspace"].definition,
]
)
} |
Issue Template
Prerequisites
Context
Initiative creation is failing when some built-in policies are present in member definition list.
Expected Behavior
Initiative is deployed without errors.
Current Behavior
Possible Solution
Test
d.parameters
on empty string.Failure Information (for bugs)
A policy has parameters value set to
{}
. For some reason, it gets translated to empty string in terraform.Steps to Reproduce
The text was updated successfully, but these errors were encountered: