import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages a Policy Assignment to a Management Group. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * * const example = new azure.management.Group("example", {displayName: "Some Management Group"}); * const exampleDefinition = new azure.policy.Definition("example", { * name: "only-deploy-in-westeurope", * policyType: "Custom", * mode: "All", * displayName: "my-policy-definition", * managementGroupId: example.id, * policyRule: ` { * "if": { * "not": { * "field": "location", * "equals": "westeurope" * } * }, * "then": { * "effect": "Deny" * } * } * `, * }); * const exampleGroupPolicyAssignment = new azure.management.GroupPolicyAssignment("example", { * name: "example-policy", * policyDefinitionId: exampleDefinition.id, * managementGroupId: example.id, * }); * ``` * * ## API Providers * * * This resource uses the following Azure API Providers: * * * `Microsoft.Authorization` - 2022-06-01 * * ## Import * * Management Group Policy Assignments can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:management/groupPolicyAssignment:GroupPolicyAssignment example /providers/Microsoft.Management/managementGroups/group1/providers/Microsoft.Authorization/policyAssignments/assignment1 * ``` */ export declare class GroupPolicyAssignment extends pulumi.CustomResource { /** * Get an existing GroupPolicyAssignment resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: GroupPolicyAssignmentState, opts?: pulumi.CustomResourceOptions): GroupPolicyAssignment; /** * Returns true if the given object is an instance of GroupPolicyAssignment. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is GroupPolicyAssignment; /** * A description which should be used for this Policy Assignment. */ readonly description: pulumi.Output; /** * The Display Name for this Policy Assignment. */ readonly displayName: pulumi.Output; /** * Specifies if this Policy should be enforced or not? Defaults to `true`. */ readonly enforce: pulumi.Output; /** * An `identity` block as defined below. * * > **Note:** The `location` field must also be specified when `identity` is specified. */ readonly identity: pulumi.Output; /** * The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created. */ readonly location: pulumi.Output; /** * The ID of the Management Group. Changing this forces a new Policy Assignment to be created. */ readonly managementGroupId: pulumi.Output; /** * A JSON mapping of any Metadata for this Policy. */ readonly metadata: pulumi.Output; /** * The name which should be used for this Policy Assignment. Cannot exceed 24 characters in length. Changing this forces a new Policy Assignment to be created. */ readonly name: pulumi.Output; /** * One or more `nonComplianceMessage` blocks as defined below. */ readonly nonComplianceMessages: pulumi.Output; /** * Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy. */ readonly notScopes: pulumi.Output; /** * One or more `overrides` blocks as defined below. More detail about `overrides` and `resourceSelectors` see [policy assignment structure](https://learn.microsoft.com/en-us/azure/governance/policy/concepts/assignment-structure) */ readonly overrides: pulumi.Output; /** * A JSON mapping of any Parameters for this Policy. */ readonly parameters: pulumi.Output; /** * The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created. */ readonly policyDefinitionId: pulumi.Output; /** * One or more `resourceSelectors` blocks as defined below to filter polices by resource properties. */ readonly resourceSelectors: pulumi.Output; /** * Create a GroupPolicyAssignment resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: GroupPolicyAssignmentArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering GroupPolicyAssignment resources. */ export interface GroupPolicyAssignmentState { /** * A description which should be used for this Policy Assignment. */ description?: pulumi.Input; /** * The Display Name for this Policy Assignment. */ displayName?: pulumi.Input; /** * Specifies if this Policy should be enforced or not? Defaults to `true`. */ enforce?: pulumi.Input; /** * An `identity` block as defined below. * * > **Note:** The `location` field must also be specified when `identity` is specified. */ identity?: pulumi.Input; /** * The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created. */ location?: pulumi.Input; /** * The ID of the Management Group. Changing this forces a new Policy Assignment to be created. */ managementGroupId?: pulumi.Input; /** * A JSON mapping of any Metadata for this Policy. */ metadata?: pulumi.Input; /** * The name which should be used for this Policy Assignment. Cannot exceed 24 characters in length. Changing this forces a new Policy Assignment to be created. */ name?: pulumi.Input; /** * One or more `nonComplianceMessage` blocks as defined below. */ nonComplianceMessages?: pulumi.Input[]>; /** * Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy. */ notScopes?: pulumi.Input[]>; /** * One or more `overrides` blocks as defined below. More detail about `overrides` and `resourceSelectors` see [policy assignment structure](https://learn.microsoft.com/en-us/azure/governance/policy/concepts/assignment-structure) */ overrides?: pulumi.Input[]>; /** * A JSON mapping of any Parameters for this Policy. */ parameters?: pulumi.Input; /** * The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created. */ policyDefinitionId?: pulumi.Input; /** * One or more `resourceSelectors` blocks as defined below to filter polices by resource properties. */ resourceSelectors?: pulumi.Input[]>; } /** * The set of arguments for constructing a GroupPolicyAssignment resource. */ export interface GroupPolicyAssignmentArgs { /** * A description which should be used for this Policy Assignment. */ description?: pulumi.Input; /** * The Display Name for this Policy Assignment. */ displayName?: pulumi.Input; /** * Specifies if this Policy should be enforced or not? Defaults to `true`. */ enforce?: pulumi.Input; /** * An `identity` block as defined below. * * > **Note:** The `location` field must also be specified when `identity` is specified. */ identity?: pulumi.Input; /** * The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created. */ location?: pulumi.Input; /** * The ID of the Management Group. Changing this forces a new Policy Assignment to be created. */ managementGroupId: pulumi.Input; /** * A JSON mapping of any Metadata for this Policy. */ metadata?: pulumi.Input; /** * The name which should be used for this Policy Assignment. Cannot exceed 24 characters in length. Changing this forces a new Policy Assignment to be created. */ name?: pulumi.Input; /** * One or more `nonComplianceMessage` blocks as defined below. */ nonComplianceMessages?: pulumi.Input[]>; /** * Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy. */ notScopes?: pulumi.Input[]>; /** * One or more `overrides` blocks as defined below. More detail about `overrides` and `resourceSelectors` see [policy assignment structure](https://learn.microsoft.com/en-us/azure/governance/policy/concepts/assignment-structure) */ overrides?: pulumi.Input[]>; /** * A JSON mapping of any Parameters for this Policy. */ parameters?: pulumi.Input; /** * The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created. */ policyDefinitionId: pulumi.Input; /** * One or more `resourceSelectors` blocks as defined below to filter polices by resource properties. */ resourceSelectors?: pulumi.Input[]>; }