azurermResourceGroupPolicyExemption
Manages a Resource 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 azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
this,
"example",
{
location: "westus",
name: "resourceGroup1",
}
);
const dataAzurermPolicyDefinitionExample =
new azurerm.dataAzurermPolicyDefinition.DataAzurermPolicyDefinition(
this,
"example_1",
{
display_name: "Allowed locations",
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
dataAzurermPolicyDefinitionExample.overrideLogicalId("example");
const azurermResourceGroupPolicyAssignmentExample =
new azurerm.resourceGroupPolicyAssignment.ResourceGroupPolicyAssignment(
this,
"example_2",
{
name: "exampleAssignment",
parameters:
'${jsonencode({\n "listOfAllowedLocations" = {\n "value" = [azurerm_resource_group.example.location]\n }\n })}',
policy_definition_id: dataAzurermPolicyDefinitionExample.id,
resource_group_id: azurermResourceGroupExample.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.*/
azurermResourceGroupPolicyAssignmentExample.overrideLogicalId("example");
const azurermResourceGroupPolicyExemptionExample =
new azurerm.resourceGroupPolicyExemption.ResourceGroupPolicyExemption(
this,
"example_3",
{
exemption_category: "Mitigated",
name: "exampleExemption",
policy_assignment_id: azurermResourceGroupPolicyAssignmentExample.id,
resource_group_id: azurermResourceGroupExample.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.*/
azurermResourceGroupPolicyExemptionExample.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. -
resourceGroupId
- (Required) The Resource 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 arewaiver
andmitigated
. -
policyAssignmentId
- (Required) The ID of the Policy Assignment to be exempted at the specified Scope. Changing this forces a new resource to be created. -
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.