gettek / terraform-azurerm-policy-as-code

Terraform modules that simplify the workflow of custom and built-in Azure Policies
https://learn.microsoft.com/en-us/azure/governance/policy/concepts/policy-as-code
MIT License
147 stars 69 forks source link

Remediation issue #49

Closed Nikhleshk closed 1 year ago

Nikhleshk commented 2 years ago

│ Error: creating/updating /providers/Microsoft.Management/managementGroups/Platform-Pre-Production/providers/Microsoft.PolicyInsights/remediations/cdnendpointsworkflowdiagnosticsettingspolicydef-22-09-2022-08:32:39: remediations.RemediationsClient#RemediationsCreateOrUpdateAtManagementGroup: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="InvalidCreateRemediationRequest" Message="The request to create remediation 'cdnendpointsworkflowdiagnosticsettingspolicydef-22-09-2022-08:32:39' is invalid. The policy assignment '/providers/microsoft.management/managementgroups/platform-pre-production/providers/microsoft.authorization/policyassignments/resource-diagnostic-sett' assigns a policy set definition. Remediations must specify a single policy definition reference ID within the policy set definition." │ │ with module.org_mg_resource-diagnostic-settings-la-policySet_initiative.azurerm_management_group_policy_remediation.rem["CdnEndpointsWorkflowDiagnosticSettingsPolicyDef"], │ on ....\modules\set_assignment\main.tf line 121, in resource "azurerm_management_group_policy_remediation" "rem": │ 121: resource "azurerm_management_group_policy_remediation" "rem" {

Everything was going fine but suddenly from today getting this error. Not sure whats wrong

gettek commented 2 years ago

Hi @Nikhleshk, which version of the module are you using? The latest now uses policy_definition_reference_id in favour of policy_definition_id