Skip to content

azurermManagementGroupPolicyExemption

Manages a Management Group Policy Exemption.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermManagementGroupExample =
  new azurerm.managementGroup.ManagementGroup(this, "example", {
    display_name: "Example MgmtGroup",
  });
const dataAzurermPolicySetDefinitionExample =
  new azurerm.dataAzurermPolicySetDefinition.DataAzurermPolicySetDefinition(
    this,
    "example_1",
    {
      display_name: "Audit machines with insecure password security settings",
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
dataAzurermPolicySetDefinitionExample.overrideLogicalId("example");
const azurermManagementGroupPolicyAssignmentExample =
  new azurerm.managementGroupPolicyAssignment.ManagementGroupPolicyAssignment(
    this,
    "example_2",
    {
      identity: [
        {
          type: "SystemAssigned",
        },
      ],
      location: "westus",
      management_group_id: azurermManagementGroupExample.id,
      name: "assignment1",
      policy_definition_id: dataAzurermPolicySetDefinitionExample.id,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermManagementGroupPolicyAssignmentExample.overrideLogicalId("example");
const azurermManagementGroupPolicyExemptionExample =
  new azurerm.managementGroupPolicyExemption.ManagementGroupPolicyExemption(
    this,
    "example_3",
    {
      exemption_category: "Mitigated",
      management_group_id: azurermManagementGroupExample.id,
      name: "exemption1",
      policy_assignment_id: azurermManagementGroupPolicyAssignmentExample.id,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermManagementGroupPolicyExemptionExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • name - (Required) The name of the Policy Exemption. Changing this forces a new resource to be created.

  • managementGroupId - (Required) The Management Group ID where the Policy Exemption should be applied. Changing this forces a new resource to be created.

  • exemptionCategory - (Required) The category of this policy exemption. Possible values are waiver and mitigated.

  • policyAssignmentId - (Required) The ID of the Policy Assignment to be exempted at the specified Scope.

  • description - (Optional) A description to use for this Policy Exemption.

  • displayName - (Optional) A friendly display name to use for this Policy Exemption.

  • expiresOn - (Optional) The expiration date and time in UTC ISO 8601 format of this policy exemption.

  • policyDefinitionReferenceIds - (Optional) The policy definition reference ID list when the associated policy assignment is an assignment of a policy set definition.

  • metadata - (Optional) The metadata for this policy exemption. This is a JSON string representing additional metadata that should be stored with the policy exemption.

Attributes Reference

The following attributes are exported:

  • id - The Policy Exemption id.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 30 minutes) Used when creating the Policy Exemption.
  • update - (Defaults to 30 minutes) Used when updating the Policy Exemption.
  • read - (Defaults to 5 minutes) Used when retrieving the Policy Exemption.
  • delete - (Defaults to 30 minutes) Used when deleting the Policy Exemption.

Import

Policy Exemptions can be imported using the resourceId, e.g.

terraform import azurerm_management_group_policy_exemption.exemption1  /providers/Microsoft.Management/managementGroups/group1/providers/Microsoft.Authorization/policyExemptions/exemption1