azure.core.ResourceGroupPolicyAssignment
Manages a Resource Group Policy Assignment.
Example Usage
using System.Collections.Generic;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
{
Location = "West Europe",
});
var exampleDefinition = new Azure.Policy.Definition("exampleDefinition", new()
{
PolicyType = "Custom",
Mode = "All",
DisplayName = "my-policy-definition",
PolicyRule = @" {
""if"": {
""not"": {
""field"": ""location"",
""equals"": ""westeurope""
}
},
""then"": {
""effect"": ""Deny""
}
}
",
});
var exampleResourceGroupPolicyAssignment = new Azure.Core.ResourceGroupPolicyAssignment("exampleResourceGroupPolicyAssignment", new()
{
ResourceGroupId = exampleResourceGroup.Id,
PolicyDefinitionId = exampleDefinition.Id,
Parameters = @" {
""tagName"": {
""value"": ""Business Unit""
},
""tagValue"": {
""value"": ""BU""
}
}
",
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/policy"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleDefinition, err := policy.NewDefinition(ctx, "exampleDefinition", &policy.DefinitionArgs{
PolicyType: pulumi.String("Custom"),
Mode: pulumi.String("All"),
DisplayName: pulumi.String("my-policy-definition"),
PolicyRule: pulumi.String(" {\n \"if\": {\n \"not\": {\n \"field\": \"location\",\n \"equals\": \"westeurope\"\n }\n },\n \"then\": {\n \"effect\": \"Deny\"\n }\n }\n"),
})
if err != nil {
return err
}
_, err = core.NewResourceGroupPolicyAssignment(ctx, "exampleResourceGroupPolicyAssignment", &core.ResourceGroupPolicyAssignmentArgs{
ResourceGroupId: exampleResourceGroup.ID(),
PolicyDefinitionId: exampleDefinition.ID(),
Parameters: pulumi.String(" {\n \"tagName\": {\n \"value\": \"Business Unit\"\n },\n \"tagValue\": {\n \"value\": \"BU\"\n }\n }\n"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.policy.Definition;
import com.pulumi.azure.policy.DefinitionArgs;
import com.pulumi.azure.core.ResourceGroupPolicyAssignment;
import com.pulumi.azure.core.ResourceGroupPolicyAssignmentArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var exampleDefinition = new Definition("exampleDefinition", DefinitionArgs.builder()
.policyType("Custom")
.mode("All")
.displayName("my-policy-definition")
.policyRule("""
{
"if": {
"not": {
"field": "location",
"equals": "westeurope"
}
},
"then": {
"effect": "Deny"
}
}
""")
.build());
var exampleResourceGroupPolicyAssignment = new ResourceGroupPolicyAssignment("exampleResourceGroupPolicyAssignment", ResourceGroupPolicyAssignmentArgs.builder()
.resourceGroupId(exampleResourceGroup.id())
.policyDefinitionId(exampleDefinition.id())
.parameters("""
{
"tagName": {
"value": "Business Unit"
},
"tagValue": {
"value": "BU"
}
}
""")
.build());
}
}
import pulumi
import pulumi_azure as azure
example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_definition = azure.policy.Definition("exampleDefinition",
policy_type="Custom",
mode="All",
display_name="my-policy-definition",
policy_rule=""" {
"if": {
"not": {
"field": "location",
"equals": "westeurope"
}
},
"then": {
"effect": "Deny"
}
}
""")
example_resource_group_policy_assignment = azure.core.ResourceGroupPolicyAssignment("exampleResourceGroupPolicyAssignment",
resource_group_id=example_resource_group.id,
policy_definition_id=example_definition.id,
parameters=""" {
"tagName": {
"value": "Business Unit"
},
"tagValue": {
"value": "BU"
}
}
""")
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleDefinition = new azure.policy.Definition("exampleDefinition", {
policyType: "Custom",
mode: "All",
displayName: "my-policy-definition",
policyRule: ` {
"if": {
"not": {
"field": "location",
"equals": "westeurope"
}
},
"then": {
"effect": "Deny"
}
}
`,
});
const exampleResourceGroupPolicyAssignment = new azure.core.ResourceGroupPolicyAssignment("exampleResourceGroupPolicyAssignment", {
resourceGroupId: exampleResourceGroup.id,
policyDefinitionId: exampleDefinition.id,
parameters: ` {
"tagName": {
"value": "Business Unit"
},
"tagValue": {
"value": "BU"
}
}
`,
});
resources:
exampleResourceGroup:
type: azure:core:ResourceGroup
properties:
location: West Europe
exampleDefinition:
type: azure:policy:Definition
properties:
policyType: Custom
mode: All
displayName: my-policy-definition
policyRule: |2
{
"if": {
"not": {
"field": "location",
"equals": "westeurope"
}
},
"then": {
"effect": "Deny"
}
}
exampleResourceGroupPolicyAssignment:
type: azure:core:ResourceGroupPolicyAssignment
properties:
resourceGroupId: ${exampleResourceGroup.id}
policyDefinitionId: ${exampleDefinition.id}
parameters: |2
{
"tagName": {
"value": "Business Unit"
},
"tagValue": {
"value": "BU"
}
}
Create ResourceGroupPolicyAssignment Resource
new ResourceGroupPolicyAssignment(name: string, args: ResourceGroupPolicyAssignmentArgs, opts?: CustomResourceOptions);
@overload
def ResourceGroupPolicyAssignment(resource_name: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
display_name: Optional[str] = None,
enforce: Optional[bool] = None,
identity: Optional[ResourceGroupPolicyAssignmentIdentityArgs] = None,
location: Optional[str] = None,
metadata: Optional[str] = None,
name: Optional[str] = None,
non_compliance_messages: Optional[Sequence[ResourceGroupPolicyAssignmentNonComplianceMessageArgs]] = None,
not_scopes: Optional[Sequence[str]] = None,
parameters: Optional[str] = None,
policy_definition_id: Optional[str] = None,
resource_group_id: Optional[str] = None)
@overload
def ResourceGroupPolicyAssignment(resource_name: str,
args: ResourceGroupPolicyAssignmentArgs,
opts: Optional[ResourceOptions] = None)
func NewResourceGroupPolicyAssignment(ctx *Context, name string, args ResourceGroupPolicyAssignmentArgs, opts ...ResourceOption) (*ResourceGroupPolicyAssignment, error)
public ResourceGroupPolicyAssignment(string name, ResourceGroupPolicyAssignmentArgs args, CustomResourceOptions? opts = null)
public ResourceGroupPolicyAssignment(String name, ResourceGroupPolicyAssignmentArgs args)
public ResourceGroupPolicyAssignment(String name, ResourceGroupPolicyAssignmentArgs args, CustomResourceOptions options)
type: azure:core:ResourceGroupPolicyAssignment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ResourceGroupPolicyAssignmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ResourceGroupPolicyAssignmentArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ResourceGroupPolicyAssignmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ResourceGroupPolicyAssignmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ResourceGroupPolicyAssignmentArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
ResourceGroupPolicyAssignment Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The ResourceGroupPolicyAssignment resource accepts the following input properties:
- Policy
Definition stringId The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
- Resource
Group stringId The ID of the Resource Group where this Policy Assignment should be created. Changing this forces a new Policy Assignment to be created.
- Description string
A description which should be used for this Policy Assignment.
- Display
Name string The Display Name for this Policy Assignment.
- Enforce bool
Specifies if this Policy should be enforced or not? Defaults to
true
.- Identity
Resource
Group Policy Assignment Identity Args An
identity
block as defined below.- Location string
The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
- Metadata string
A JSON mapping of any Metadata for this Policy.
- Name string
The name which should be used for this Policy Assignment. Changing this forces a new Policy Assignment to be created.
- Non
Compliance List<ResourceMessages Group Policy Assignment Non Compliance Message Args> One or more
non_compliance_message
blocks as defined below.- Not
Scopes List<string> Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
- Parameters string
A JSON mapping of any Parameters for this Policy.
- Policy
Definition stringId The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
- Resource
Group stringId The ID of the Resource Group where this Policy Assignment should be created. Changing this forces a new Policy Assignment to be created.
- Description string
A description which should be used for this Policy Assignment.
- Display
Name string The Display Name for this Policy Assignment.
- Enforce bool
Specifies if this Policy should be enforced or not? Defaults to
true
.- Identity
Resource
Group Policy Assignment Identity Args An
identity
block as defined below.- Location string
The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
- Metadata string
A JSON mapping of any Metadata for this Policy.
- Name string
The name which should be used for this Policy Assignment. Changing this forces a new Policy Assignment to be created.
- Non
Compliance []ResourceMessages Group Policy Assignment Non Compliance Message Args One or more
non_compliance_message
blocks as defined below.- Not
Scopes []string Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
- Parameters string
A JSON mapping of any Parameters for this Policy.
- policy
Definition StringId The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
- resource
Group StringId The ID of the Resource Group where this Policy Assignment should be created. Changing this forces a new Policy Assignment to be created.
- description String
A description which should be used for this Policy Assignment.
- display
Name String The Display Name for this Policy Assignment.
- enforce Boolean
Specifies if this Policy should be enforced or not? Defaults to
true
.- identity
Resource
Group Policy Assignment Identity Args An
identity
block as defined below.- location String
The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
- metadata String
A JSON mapping of any Metadata for this Policy.
- name String
The name which should be used for this Policy Assignment. Changing this forces a new Policy Assignment to be created.
- non
Compliance List<ResourceMessages Group Policy Assignment Non Compliance Message Args> One or more
non_compliance_message
blocks as defined below.- not
Scopes List<String> Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
- parameters String
A JSON mapping of any Parameters for this Policy.
- policy
Definition stringId The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
- resource
Group stringId The ID of the Resource Group where this Policy Assignment should be created. Changing this forces a new Policy Assignment to be created.
- description string
A description which should be used for this Policy Assignment.
- display
Name string The Display Name for this Policy Assignment.
- enforce boolean
Specifies if this Policy should be enforced or not? Defaults to
true
.- identity
Resource
Group Policy Assignment Identity Args An
identity
block as defined below.- location string
The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
- metadata string
A JSON mapping of any Metadata for this Policy.
- name string
The name which should be used for this Policy Assignment. Changing this forces a new Policy Assignment to be created.
- non
Compliance ResourceMessages Group Policy Assignment Non Compliance Message Args[] One or more
non_compliance_message
blocks as defined below.- not
Scopes string[] Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
- parameters string
A JSON mapping of any Parameters for this Policy.
- policy_
definition_ strid The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
- resource_
group_ strid The ID of the Resource Group where this Policy Assignment should be created. Changing this forces a new Policy Assignment to be created.
- description str
A description which should be used for this Policy Assignment.
- display_
name str The Display Name for this Policy Assignment.
- enforce bool
Specifies if this Policy should be enforced or not? Defaults to
true
.- identity
Resource
Group Policy Assignment Identity Args An
identity
block as defined below.- location str
The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
- metadata str
A JSON mapping of any Metadata for this Policy.
- name str
The name which should be used for this Policy Assignment. Changing this forces a new Policy Assignment to be created.
- non_
compliance_ Sequence[Resourcemessages Group Policy Assignment Non Compliance Message Args] One or more
non_compliance_message
blocks as defined below.- not_
scopes Sequence[str] Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
- parameters str
A JSON mapping of any Parameters for this Policy.
- policy
Definition StringId The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
- resource
Group StringId The ID of the Resource Group where this Policy Assignment should be created. Changing this forces a new Policy Assignment to be created.
- description String
A description which should be used for this Policy Assignment.
- display
Name String The Display Name for this Policy Assignment.
- enforce Boolean
Specifies if this Policy should be enforced or not? Defaults to
true
.- identity Property Map
An
identity
block as defined below.- location String
The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
- metadata String
A JSON mapping of any Metadata for this Policy.
- name String
The name which should be used for this Policy Assignment. Changing this forces a new Policy Assignment to be created.
- non
Compliance List<Property Map>Messages One or more
non_compliance_message
blocks as defined below.- not
Scopes List<String> Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
- parameters String
A JSON mapping of any Parameters for this Policy.
Outputs
All input properties are implicitly available as output properties. Additionally, the ResourceGroupPolicyAssignment resource produces the following output properties:
- Id string
The provider-assigned unique ID for this managed resource.
- Id string
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
- id string
The provider-assigned unique ID for this managed resource.
- id str
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
Look up Existing ResourceGroupPolicyAssignment Resource
Get an existing ResourceGroupPolicyAssignment resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ResourceGroupPolicyAssignmentState, opts?: CustomResourceOptions): ResourceGroupPolicyAssignment
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
display_name: Optional[str] = None,
enforce: Optional[bool] = None,
identity: Optional[ResourceGroupPolicyAssignmentIdentityArgs] = None,
location: Optional[str] = None,
metadata: Optional[str] = None,
name: Optional[str] = None,
non_compliance_messages: Optional[Sequence[ResourceGroupPolicyAssignmentNonComplianceMessageArgs]] = None,
not_scopes: Optional[Sequence[str]] = None,
parameters: Optional[str] = None,
policy_definition_id: Optional[str] = None,
resource_group_id: Optional[str] = None) -> ResourceGroupPolicyAssignment
func GetResourceGroupPolicyAssignment(ctx *Context, name string, id IDInput, state *ResourceGroupPolicyAssignmentState, opts ...ResourceOption) (*ResourceGroupPolicyAssignment, error)
public static ResourceGroupPolicyAssignment Get(string name, Input<string> id, ResourceGroupPolicyAssignmentState? state, CustomResourceOptions? opts = null)
public static ResourceGroupPolicyAssignment get(String name, Output<String> id, ResourceGroupPolicyAssignmentState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Description string
A description which should be used for this Policy Assignment.
- Display
Name string The Display Name for this Policy Assignment.
- Enforce bool
Specifies if this Policy should be enforced or not? Defaults to
true
.- Identity
Resource
Group Policy Assignment Identity Args An
identity
block as defined below.- Location string
The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
- Metadata string
A JSON mapping of any Metadata for this Policy.
- Name string
The name which should be used for this Policy Assignment. Changing this forces a new Policy Assignment to be created.
- Non
Compliance List<ResourceMessages Group Policy Assignment Non Compliance Message Args> One or more
non_compliance_message
blocks as defined below.- Not
Scopes List<string> Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
- Parameters string
A JSON mapping of any Parameters for this Policy.
- Policy
Definition stringId The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
- Resource
Group stringId The ID of the Resource Group where this Policy Assignment should be created. Changing this forces a new Policy Assignment to be created.
- Description string
A description which should be used for this Policy Assignment.
- Display
Name string The Display Name for this Policy Assignment.
- Enforce bool
Specifies if this Policy should be enforced or not? Defaults to
true
.- Identity
Resource
Group Policy Assignment Identity Args An
identity
block as defined below.- Location string
The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
- Metadata string
A JSON mapping of any Metadata for this Policy.
- Name string
The name which should be used for this Policy Assignment. Changing this forces a new Policy Assignment to be created.
- Non
Compliance []ResourceMessages Group Policy Assignment Non Compliance Message Args One or more
non_compliance_message
blocks as defined below.- Not
Scopes []string Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
- Parameters string
A JSON mapping of any Parameters for this Policy.
- Policy
Definition stringId The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
- Resource
Group stringId The ID of the Resource Group where this Policy Assignment should be created. Changing this forces a new Policy Assignment to be created.
- description String
A description which should be used for this Policy Assignment.
- display
Name String The Display Name for this Policy Assignment.
- enforce Boolean
Specifies if this Policy should be enforced or not? Defaults to
true
.- identity
Resource
Group Policy Assignment Identity Args An
identity
block as defined below.- location String
The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
- metadata String
A JSON mapping of any Metadata for this Policy.
- name String
The name which should be used for this Policy Assignment. Changing this forces a new Policy Assignment to be created.
- non
Compliance List<ResourceMessages Group Policy Assignment Non Compliance Message Args> One or more
non_compliance_message
blocks as defined below.- not
Scopes List<String> Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
- parameters String
A JSON mapping of any Parameters for this Policy.
- policy
Definition StringId The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
- resource
Group StringId The ID of the Resource Group where this Policy Assignment should be created. Changing this forces a new Policy Assignment to be created.
- description string
A description which should be used for this Policy Assignment.
- display
Name string The Display Name for this Policy Assignment.
- enforce boolean
Specifies if this Policy should be enforced or not? Defaults to
true
.- identity
Resource
Group Policy Assignment Identity Args An
identity
block as defined below.- location string
The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
- metadata string
A JSON mapping of any Metadata for this Policy.
- name string
The name which should be used for this Policy Assignment. Changing this forces a new Policy Assignment to be created.
- non
Compliance ResourceMessages Group Policy Assignment Non Compliance Message Args[] One or more
non_compliance_message
blocks as defined below.- not
Scopes string[] Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
- parameters string
A JSON mapping of any Parameters for this Policy.
- policy
Definition stringId The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
- resource
Group stringId The ID of the Resource Group where this Policy Assignment should be created. Changing this forces a new Policy Assignment to be created.
- description str
A description which should be used for this Policy Assignment.
- display_
name str The Display Name for this Policy Assignment.
- enforce bool
Specifies if this Policy should be enforced or not? Defaults to
true
.- identity
Resource
Group Policy Assignment Identity Args An
identity
block as defined below.- location str
The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
- metadata str
A JSON mapping of any Metadata for this Policy.
- name str
The name which should be used for this Policy Assignment. Changing this forces a new Policy Assignment to be created.
- non_
compliance_ Sequence[Resourcemessages Group Policy Assignment Non Compliance Message Args] One or more
non_compliance_message
blocks as defined below.- not_
scopes Sequence[str] Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
- parameters str
A JSON mapping of any Parameters for this Policy.
- policy_
definition_ strid The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
- resource_
group_ strid The ID of the Resource Group where this Policy Assignment should be created. Changing this forces a new Policy Assignment to be created.
- description String
A description which should be used for this Policy Assignment.
- display
Name String The Display Name for this Policy Assignment.
- enforce Boolean
Specifies if this Policy should be enforced or not? Defaults to
true
.- identity Property Map
An
identity
block as defined below.- location String
The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
- metadata String
A JSON mapping of any Metadata for this Policy.
- name String
The name which should be used for this Policy Assignment. Changing this forces a new Policy Assignment to be created.
- non
Compliance List<Property Map>Messages One or more
non_compliance_message
blocks as defined below.- not
Scopes List<String> Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
- parameters String
A JSON mapping of any Parameters for this Policy.
- policy
Definition StringId The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
- resource
Group StringId The ID of the Resource Group where this Policy Assignment should be created. Changing this forces a new Policy Assignment to be created.
Supporting Types
ResourceGroupPolicyAssignmentIdentity
- Type string
The Type of Managed Identity which should be added to this Policy Definition. Possible values are
SystemAssigned
andUserAssigned
.- Identity
Ids List<string> A list of User Managed Identity IDs which should be assigned to the Policy Definition.
- Principal
Id string The Principal ID of the Policy Assignment for this Resource Group.
- Tenant
Id string The Tenant ID of the Policy Assignment for this Resource Group.
- Type string
The Type of Managed Identity which should be added to this Policy Definition. Possible values are
SystemAssigned
andUserAssigned
.- Identity
Ids []string A list of User Managed Identity IDs which should be assigned to the Policy Definition.
- Principal
Id string The Principal ID of the Policy Assignment for this Resource Group.
- Tenant
Id string The Tenant ID of the Policy Assignment for this Resource Group.
- type String
The Type of Managed Identity which should be added to this Policy Definition. Possible values are
SystemAssigned
andUserAssigned
.- identity
Ids List<String> A list of User Managed Identity IDs which should be assigned to the Policy Definition.
- principal
Id String The Principal ID of the Policy Assignment for this Resource Group.
- tenant
Id String The Tenant ID of the Policy Assignment for this Resource Group.
- type string
The Type of Managed Identity which should be added to this Policy Definition. Possible values are
SystemAssigned
andUserAssigned
.- identity
Ids string[] A list of User Managed Identity IDs which should be assigned to the Policy Definition.
- principal
Id string The Principal ID of the Policy Assignment for this Resource Group.
- tenant
Id string The Tenant ID of the Policy Assignment for this Resource Group.
- type str
The Type of Managed Identity which should be added to this Policy Definition. Possible values are
SystemAssigned
andUserAssigned
.- identity_
ids Sequence[str] A list of User Managed Identity IDs which should be assigned to the Policy Definition.
- principal_
id str The Principal ID of the Policy Assignment for this Resource Group.
- tenant_
id str The Tenant ID of the Policy Assignment for this Resource Group.
- type String
The Type of Managed Identity which should be added to this Policy Definition. Possible values are
SystemAssigned
andUserAssigned
.- identity
Ids List<String> A list of User Managed Identity IDs which should be assigned to the Policy Definition.
- principal
Id String The Principal ID of the Policy Assignment for this Resource Group.
- tenant
Id String The Tenant ID of the Policy Assignment for this Resource Group.
ResourceGroupPolicyAssignmentNonComplianceMessage
- Content string
The non-compliance message text. When assigning policy sets (initiatives), unless
policy_definition_reference_id
is specified then this message will be the default for all policies.- Policy
Definition stringReference Id When assigning policy sets (initiatives), this is the ID of the policy definition that the non-compliance message applies to.
- Content string
The non-compliance message text. When assigning policy sets (initiatives), unless
policy_definition_reference_id
is specified then this message will be the default for all policies.- Policy
Definition stringReference Id When assigning policy sets (initiatives), this is the ID of the policy definition that the non-compliance message applies to.
- content String
The non-compliance message text. When assigning policy sets (initiatives), unless
policy_definition_reference_id
is specified then this message will be the default for all policies.- policy
Definition StringReference Id When assigning policy sets (initiatives), this is the ID of the policy definition that the non-compliance message applies to.
- content string
The non-compliance message text. When assigning policy sets (initiatives), unless
policy_definition_reference_id
is specified then this message will be the default for all policies.- policy
Definition stringReference Id When assigning policy sets (initiatives), this is the ID of the policy definition that the non-compliance message applies to.
- content str
The non-compliance message text. When assigning policy sets (initiatives), unless
policy_definition_reference_id
is specified then this message will be the default for all policies.- policy_
definition_ strreference_ id When assigning policy sets (initiatives), this is the ID of the policy definition that the non-compliance message applies to.
- content String
The non-compliance message text. When assigning policy sets (initiatives), unless
policy_definition_reference_id
is specified then this message will be the default for all policies.- policy
Definition StringReference Id When assigning policy sets (initiatives), this is the ID of the policy definition that the non-compliance message applies to.
Import
Resource Group Policy Assignments can be imported using the resource id
, e.g.
$ pulumi import azure:core/resourceGroupPolicyAssignment:ResourceGroupPolicyAssignment example /subscriptions/00000000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Authorization/policyAssignments/assignment1
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
azurerm
Terraform Provider.