Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Resource Group Policy Assignments can be imported using the `resource id`, e.g.
*
* ```sh
* $ pulumi import azure:core/resourceGroupPolicyAssignment:ResourceGroupPolicyAssignment example /subscriptions/00000000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Authorization/policyAssignments/assignment1
* ```
*
*/
@ResourceType(type="azure:core/resourceGroupPolicyAssignment:ResourceGroupPolicyAssignment")
public class ResourceGroupPolicyAssignment extends com.pulumi.resources.CustomResource {
/**
* A description which should be used for this Policy Assignment.
*
*/
@Export(name="description", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> description;
/**
* @return A description which should be used for this Policy Assignment.
*
*/
public Output> description() {
return Codegen.optional(this.description);
}
/**
* The Display Name for this Policy Assignment.
*
*/
@Export(name="displayName", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> displayName;
/**
* @return The Display Name for this Policy Assignment.
*
*/
public Output> displayName() {
return Codegen.optional(this.displayName);
}
/**
* Specifies if this Policy should be enforced or not? Defaults to `true`.
*
*/
@Export(name="enforce", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> enforce;
/**
* @return Specifies if this Policy should be enforced or not? Defaults to `true`.
*
*/
public Output> enforce() {
return Codegen.optional(this.enforce);
}
/**
* An `identity` block as defined below.
*
* > **Note:** The `location` field must also be specified when `identity` is specified.
*
*/
@Export(name="identity", refs={ResourceGroupPolicyAssignmentIdentity.class}, tree="[0]")
private Output* @Nullable */ ResourceGroupPolicyAssignmentIdentity> identity;
/**
* @return An `identity` block as defined below.
*
* > **Note:** The `location` field must also be specified when `identity` is specified.
*
*/
public Output> identity() {
return Codegen.optional(this.identity);
}
/**
* The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
*
*/
@Export(name="location", refs={String.class}, tree="[0]")
private Output location;
/**
* @return The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
*
*/
public Output location() {
return this.location;
}
/**
* A JSON mapping of any Metadata for this Policy.
*
*/
@Export(name="metadata", refs={String.class}, tree="[0]")
private Output metadata;
/**
* @return A JSON mapping of any Metadata for this Policy.
*
*/
public Output metadata() {
return this.metadata;
}
/**
* The name which should be used for this Policy Assignment. Changing this forces a new Policy Assignment to be created. Cannot exceed 64 characters in length.
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return The name which should be used for this Policy Assignment. Changing this forces a new Policy Assignment to be created. Cannot exceed 64 characters in length.
*
*/
public Output name() {
return this.name;
}
/**
* One or more `non_compliance_message` blocks as defined below.
*
*/
@Export(name="nonComplianceMessages", refs={List.class,ResourceGroupPolicyAssignmentNonComplianceMessage.class}, tree="[0,1]")
private Output* @Nullable */ List> nonComplianceMessages;
/**
* @return One or more `non_compliance_message` blocks as defined below.
*
*/
public Output>> nonComplianceMessages() {
return Codegen.optional(this.nonComplianceMessages);
}
/**
* Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
*
*/
@Export(name="notScopes", refs={List.class,String.class}, tree="[0,1]")
private Output* @Nullable */ List> notScopes;
/**
* @return Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
*
*/
public Output>> notScopes() {
return Codegen.optional(this.notScopes);
}
/**
* One or more `overrides` blocks as defined below. More detail about `overrides` and `resource_selectors` see [policy assignment structure](https://learn.microsoft.com/en-us/azure/governance/policy/concepts/assignment-structure#resource-selectors-preview)
*
*/
@Export(name="overrides", refs={List.class,ResourceGroupPolicyAssignmentOverride.class}, tree="[0,1]")
private Output* @Nullable */ List> overrides;
/**
* @return One or more `overrides` blocks as defined below. More detail about `overrides` and `resource_selectors` see [policy assignment structure](https://learn.microsoft.com/en-us/azure/governance/policy/concepts/assignment-structure#resource-selectors-preview)
*
*/
public Output>> overrides() {
return Codegen.optional(this.overrides);
}
/**
* A JSON mapping of any Parameters for this Policy.
*
*/
@Export(name="parameters", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> parameters;
/**
* @return A JSON mapping of any Parameters for this Policy.
*
*/
public Output> parameters() {
return Codegen.optional(this.parameters);
}
/**
* The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
*
*/
@Export(name="policyDefinitionId", refs={String.class}, tree="[0]")
private Output policyDefinitionId;
/**
* @return The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
*
*/
public Output policyDefinitionId() {
return this.policyDefinitionId;
}
/**
* The ID of the Resource Group where this Policy Assignment should be created. Changing this forces a new Policy Assignment to be created.
*
*/
@Export(name="resourceGroupId", refs={String.class}, tree="[0]")
private Output resourceGroupId;
/**
* @return The ID of the Resource Group where this Policy Assignment should be created. Changing this forces a new Policy Assignment to be created.
*
*/
public Output resourceGroupId() {
return this.resourceGroupId;
}
/**
* One or more `resource_selectors` blocks as defined below to filter polices by resource properties.
*
*/
@Export(name="resourceSelectors", refs={List.class,ResourceGroupPolicyAssignmentResourceSelector.class}, tree="[0,1]")
private Output* @Nullable */ List> resourceSelectors;
/**
* @return One or more `resource_selectors` blocks as defined below to filter polices by resource properties.
*
*/
public Output>> resourceSelectors() {
return Codegen.optional(this.resourceSelectors);
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public ResourceGroupPolicyAssignment(java.lang.String name) {
this(name, ResourceGroupPolicyAssignmentArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public ResourceGroupPolicyAssignment(java.lang.String name, ResourceGroupPolicyAssignmentArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public ResourceGroupPolicyAssignment(java.lang.String name, ResourceGroupPolicyAssignmentArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:core/resourceGroupPolicyAssignment:ResourceGroupPolicyAssignment", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private ResourceGroupPolicyAssignment(java.lang.String name, Output id, @Nullable ResourceGroupPolicyAssignmentState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:core/resourceGroupPolicyAssignment:ResourceGroupPolicyAssignment", name, state, makeResourceOptions(options, id), false);
}
private static ResourceGroupPolicyAssignmentArgs makeArgs(ResourceGroupPolicyAssignmentArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? ResourceGroupPolicyAssignmentArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host 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
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static ResourceGroupPolicyAssignment get(java.lang.String name, Output id, @Nullable ResourceGroupPolicyAssignmentState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new ResourceGroupPolicyAssignment(name, id, state, options);
}
}