Error: expanding JSON for policy_rule
: json: cannot unmarshal string into Go value of type map[string]interface {}
#109
Unanswered
rayaashokkumar321
asked this question in
Q&A
Replies: 2 comments 3 replies
-
Hi @rayaashokkumar321, appears you may be missing the opening curly bracket |
Beta Was this translation helpful? Give feedback.
2 replies
-
Here is the tf code, which is in 3 different files module "deploy_resource_diagnostic_setting" {
source = "..//modules/definition"
for_each = toset([
for p in fileset(path.module, "../policies/Monitoring-2/*.json") :
trimsuffix(basename(p), ".json")
])
policy_name = each.key
policy_category = "Monitoring"
management_group_id = "/providers/Microsoft.Management/managementGroups/mg-tp"
}
module "platform_diagnostics_initiative" {
source = "..//modules/initiative"
initiative_name = "platform_diagnostics_initiative"
initiative_display_name = "[Platform]: Diagnostics Settings Policy Initiative"
initiative_description = "Collection of policies that deploy resource and activity log forwarders to logging core resources"
initiative_category = "Monitoring"
merge_effects = false # will not merge "effect" parameters
management_group_id = "/providers/Microsoft.Management/managementGroups/mg-tp"
# Populate member_definitions with a for loop
member_definitions = [for mon in module.deploy_resource_diagnostic_setting : mon.definition]
}
module "org_mg_platform_diagnostics_initiative" {
source = "..//modules/set_assignment"
initiative = module.platform_diagnostics_initiative.initiative
assignment_scope = "/providers/Microsoft.Management/managementGroups/mg-tp"
# resource remediation options
re_evaluate_compliance = var.re_evaluate_compliance
skip_remediation = var.skip_remediation
skip_role_assignment = var.skip_role_assignment
# role_definition_ids = [data.azurerm_role_definition.contributor.id] # using explicit roles
# NOTE: You may omit parameters at assignment to use the definitions 'defaultValue'
assignment_parameters = {
# workspaceId = local.dummy_resource_ids.azurerm_log_analytics_workspace
# storageAccountId = local.dummy_resource_ids.azurerm_storage_account
# eventHubName = local.dummy_resource_ids.azurerm_eventhub_namespace
# eventHubAuthorizationRuleId = local.dummy_resource_ids.azurerm_eventhub_namespace_authorization_rule
metricsEnabled = "True"
logsEnabled = "True"
# effect_DeployApplicationGatewayDiagnosticSetting = "DeployIfNotExists"
# effect_DeployEventhubDiagnosticSetting = "DeployIfNotExists"
# effect_DeployFirewallDiagnosticSetting = "DeployIfNotExists"
# effect_DeployKeyvaultDiagnosticSetting = "AuditIfNotExists"
# effect_DeployLoadbalancerDiagnosticSetting = "AuditIfNotExists"
# effect_DeployNetworkInterfaceDiagnosticSetting = "AuditIfNotExists"
# effect_DeployNetworkSecurityGroupDiagnosticSetting = "AuditIfNotExists"
# effect_DeployPublicIpDiagnosticSetting = "AuditIfNotExists"
# effect_DeployStorageAccountDiagnosticSetting = "DeployIfNotExists"
# effect_DeploySubscriptionDiagnosticSetting = "DeployIfNotExists"
# effect_DeployVnetDiagnosticSetting = "AuditIfNotExists"
# effect_DeployVnetGatewayDiagnosticSetting = "AuditIfNotExists"
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi @gettek,
I am getting the error message mentioned in the subject because of the policy rule mentioned in modules/definition/main.tf, here is the policy json code I am trying to deploy, can you please help to resolve this?
Thanks, Gettek
Ashok
Beta Was this translation helpful? Give feedback.
All reactions