All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.management.GroupPolicyAssignmentArgs Maven / Gradle / Ivy

// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azure.management;

import com.pulumi.azure.management.inputs.GroupPolicyAssignmentIdentityArgs;
import com.pulumi.azure.management.inputs.GroupPolicyAssignmentNonComplianceMessageArgs;
import com.pulumi.azure.management.inputs.GroupPolicyAssignmentOverrideArgs;
import com.pulumi.azure.management.inputs.GroupPolicyAssignmentResourceSelectorArgs;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class GroupPolicyAssignmentArgs extends com.pulumi.resources.ResourceArgs {

    public static final GroupPolicyAssignmentArgs Empty = new GroupPolicyAssignmentArgs();

    /**
     * A description which should be used for this Policy Assignment.
     * 
     */
    @Import(name="description")
    private @Nullable Output description;

    /**
     * @return A description which should be used for this Policy Assignment.
     * 
     */
    public Optional> description() {
        return Optional.ofNullable(this.description);
    }

    /**
     * The Display Name for this Policy Assignment.
     * 
     */
    @Import(name="displayName")
    private @Nullable Output displayName;

    /**
     * @return The Display Name for this Policy Assignment.
     * 
     */
    public Optional> displayName() {
        return Optional.ofNullable(this.displayName);
    }

    /**
     * Specifies if this Policy should be enforced or not? Defaults to `true`.
     * 
     */
    @Import(name="enforce")
    private @Nullable Output enforce;

    /**
     * @return Specifies if this Policy should be enforced or not? Defaults to `true`.
     * 
     */
    public Optional> enforce() {
        return Optional.ofNullable(this.enforce);
    }

    /**
     * An `identity` block as defined below.
     * 
     * > **Note:** The `location` field must also be specified when `identity` is specified.
     * 
     */
    @Import(name="identity")
    private @Nullable Output identity;

    /**
     * @return An `identity` block as defined below.
     * 
     * > **Note:** The `location` field must also be specified when `identity` is specified.
     * 
     */
    public Optional> identity() {
        return Optional.ofNullable(this.identity);
    }

    /**
     * The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
     * 
     */
    @Import(name="location")
    private @Nullable Output location;

    /**
     * @return The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
     * 
     */
    public Optional> location() {
        return Optional.ofNullable(this.location);
    }

    /**
     * The ID of the Management Group. Changing this forces a new Policy Assignment to be created.
     * 
     */
    @Import(name="managementGroupId", required=true)
    private Output managementGroupId;

    /**
     * @return The ID of the Management Group. Changing this forces a new Policy Assignment to be created.
     * 
     */
    public Output managementGroupId() {
        return this.managementGroupId;
    }

    /**
     * A JSON mapping of any Metadata for this Policy.
     * 
     */
    @Import(name="metadata")
    private @Nullable Output metadata;

    /**
     * @return A JSON mapping of any Metadata for this Policy.
     * 
     */
    public Optional> metadata() {
        return Optional.ofNullable(this.metadata);
    }

    /**
     * The name which should be used for this Policy Assignment. Possible values must be between 3 and 24 characters in length. Changing this forces a new Policy Assignment to be created.
     * 
     */
    @Import(name="name")
    private @Nullable Output name;

    /**
     * @return The name which should be used for this Policy Assignment. Possible values must be between 3 and 24 characters in length. Changing this forces a new Policy Assignment to be created.
     * 
     */
    public Optional> name() {
        return Optional.ofNullable(this.name);
    }

    /**
     * One or more `non_compliance_message` blocks as defined below.
     * 
     */
    @Import(name="nonComplianceMessages")
    private @Nullable Output> nonComplianceMessages;

    /**
     * @return One or more `non_compliance_message` blocks as defined below.
     * 
     */
    public Optional>> nonComplianceMessages() {
        return Optional.ofNullable(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.
     * 
     */
    @Import(name="notScopes")
    private @Nullable Output> 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 Optional>> notScopes() {
        return Optional.ofNullable(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)
     * 
     */
    @Import(name="overrides")
    private @Nullable Output> 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 Optional>> overrides() {
        return Optional.ofNullable(this.overrides);
    }

    /**
     * A JSON mapping of any Parameters for this Policy.
     * 
     */
    @Import(name="parameters")
    private @Nullable Output parameters;

    /**
     * @return A JSON mapping of any Parameters for this Policy.
     * 
     */
    public Optional> parameters() {
        return Optional.ofNullable(this.parameters);
    }

    /**
     * The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
     * 
     */
    @Import(name="policyDefinitionId", required=true)
    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;
    }

    /**
     * One or more `resource_selectors` blocks as defined below to filter polices by resource properties.
     * 
     */
    @Import(name="resourceSelectors")
    private @Nullable Output> resourceSelectors;

    /**
     * @return One or more `resource_selectors` blocks as defined below to filter polices by resource properties.
     * 
     */
    public Optional>> resourceSelectors() {
        return Optional.ofNullable(this.resourceSelectors);
    }

    private GroupPolicyAssignmentArgs() {}

    private GroupPolicyAssignmentArgs(GroupPolicyAssignmentArgs $) {
        this.description = $.description;
        this.displayName = $.displayName;
        this.enforce = $.enforce;
        this.identity = $.identity;
        this.location = $.location;
        this.managementGroupId = $.managementGroupId;
        this.metadata = $.metadata;
        this.name = $.name;
        this.nonComplianceMessages = $.nonComplianceMessages;
        this.notScopes = $.notScopes;
        this.overrides = $.overrides;
        this.parameters = $.parameters;
        this.policyDefinitionId = $.policyDefinitionId;
        this.resourceSelectors = $.resourceSelectors;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(GroupPolicyAssignmentArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private GroupPolicyAssignmentArgs $;

        public Builder() {
            $ = new GroupPolicyAssignmentArgs();
        }

        public Builder(GroupPolicyAssignmentArgs defaults) {
            $ = new GroupPolicyAssignmentArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param description A description which should be used for this Policy Assignment.
         * 
         * @return builder
         * 
         */
        public Builder description(@Nullable Output description) {
            $.description = description;
            return this;
        }

        /**
         * @param description A description which should be used for this Policy Assignment.
         * 
         * @return builder
         * 
         */
        public Builder description(String description) {
            return description(Output.of(description));
        }

        /**
         * @param displayName The Display Name for this Policy Assignment.
         * 
         * @return builder
         * 
         */
        public Builder displayName(@Nullable Output displayName) {
            $.displayName = displayName;
            return this;
        }

        /**
         * @param displayName The Display Name for this Policy Assignment.
         * 
         * @return builder
         * 
         */
        public Builder displayName(String displayName) {
            return displayName(Output.of(displayName));
        }

        /**
         * @param enforce Specifies if this Policy should be enforced or not? Defaults to `true`.
         * 
         * @return builder
         * 
         */
        public Builder enforce(@Nullable Output enforce) {
            $.enforce = enforce;
            return this;
        }

        /**
         * @param enforce Specifies if this Policy should be enforced or not? Defaults to `true`.
         * 
         * @return builder
         * 
         */
        public Builder enforce(Boolean enforce) {
            return enforce(Output.of(enforce));
        }

        /**
         * @param identity An `identity` block as defined below.
         * 
         * > **Note:** The `location` field must also be specified when `identity` is specified.
         * 
         * @return builder
         * 
         */
        public Builder identity(@Nullable Output identity) {
            $.identity = identity;
            return this;
        }

        /**
         * @param identity An `identity` block as defined below.
         * 
         * > **Note:** The `location` field must also be specified when `identity` is specified.
         * 
         * @return builder
         * 
         */
        public Builder identity(GroupPolicyAssignmentIdentityArgs identity) {
            return identity(Output.of(identity));
        }

        /**
         * @param location The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
         * 
         * @return builder
         * 
         */
        public Builder location(@Nullable Output location) {
            $.location = location;
            return this;
        }

        /**
         * @param location The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
         * 
         * @return builder
         * 
         */
        public Builder location(String location) {
            return location(Output.of(location));
        }

        /**
         * @param managementGroupId The ID of the Management Group. Changing this forces a new Policy Assignment to be created.
         * 
         * @return builder
         * 
         */
        public Builder managementGroupId(Output managementGroupId) {
            $.managementGroupId = managementGroupId;
            return this;
        }

        /**
         * @param managementGroupId The ID of the Management Group. Changing this forces a new Policy Assignment to be created.
         * 
         * @return builder
         * 
         */
        public Builder managementGroupId(String managementGroupId) {
            return managementGroupId(Output.of(managementGroupId));
        }

        /**
         * @param metadata A JSON mapping of any Metadata for this Policy.
         * 
         * @return builder
         * 
         */
        public Builder metadata(@Nullable Output metadata) {
            $.metadata = metadata;
            return this;
        }

        /**
         * @param metadata A JSON mapping of any Metadata for this Policy.
         * 
         * @return builder
         * 
         */
        public Builder metadata(String metadata) {
            return metadata(Output.of(metadata));
        }

        /**
         * @param name The name which should be used for this Policy Assignment. Possible values must be between 3 and 24 characters in length. Changing this forces a new Policy Assignment to be created.
         * 
         * @return builder
         * 
         */
        public Builder name(@Nullable Output name) {
            $.name = name;
            return this;
        }

        /**
         * @param name The name which should be used for this Policy Assignment. Possible values must be between 3 and 24 characters in length. Changing this forces a new Policy Assignment to be created.
         * 
         * @return builder
         * 
         */
        public Builder name(String name) {
            return name(Output.of(name));
        }

        /**
         * @param nonComplianceMessages One or more `non_compliance_message` blocks as defined below.
         * 
         * @return builder
         * 
         */
        public Builder nonComplianceMessages(@Nullable Output> nonComplianceMessages) {
            $.nonComplianceMessages = nonComplianceMessages;
            return this;
        }

        /**
         * @param nonComplianceMessages One or more `non_compliance_message` blocks as defined below.
         * 
         * @return builder
         * 
         */
        public Builder nonComplianceMessages(List nonComplianceMessages) {
            return nonComplianceMessages(Output.of(nonComplianceMessages));
        }

        /**
         * @param nonComplianceMessages One or more `non_compliance_message` blocks as defined below.
         * 
         * @return builder
         * 
         */
        public Builder nonComplianceMessages(GroupPolicyAssignmentNonComplianceMessageArgs... nonComplianceMessages) {
            return nonComplianceMessages(List.of(nonComplianceMessages));
        }

        /**
         * @param notScopes Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
         * 
         * @return builder
         * 
         */
        public Builder notScopes(@Nullable Output> notScopes) {
            $.notScopes = notScopes;
            return this;
        }

        /**
         * @param notScopes Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
         * 
         * @return builder
         * 
         */
        public Builder notScopes(List notScopes) {
            return notScopes(Output.of(notScopes));
        }

        /**
         * @param notScopes Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
         * 
         * @return builder
         * 
         */
        public Builder notScopes(String... notScopes) {
            return notScopes(List.of(notScopes));
        }

        /**
         * @param overrides 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)
         * 
         * @return builder
         * 
         */
        public Builder overrides(@Nullable Output> overrides) {
            $.overrides = overrides;
            return this;
        }

        /**
         * @param overrides 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)
         * 
         * @return builder
         * 
         */
        public Builder overrides(List overrides) {
            return overrides(Output.of(overrides));
        }

        /**
         * @param overrides 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)
         * 
         * @return builder
         * 
         */
        public Builder overrides(GroupPolicyAssignmentOverrideArgs... overrides) {
            return overrides(List.of(overrides));
        }

        /**
         * @param parameters A JSON mapping of any Parameters for this Policy.
         * 
         * @return builder
         * 
         */
        public Builder parameters(@Nullable Output parameters) {
            $.parameters = parameters;
            return this;
        }

        /**
         * @param parameters A JSON mapping of any Parameters for this Policy.
         * 
         * @return builder
         * 
         */
        public Builder parameters(String parameters) {
            return parameters(Output.of(parameters));
        }

        /**
         * @param policyDefinitionId The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
         * 
         * @return builder
         * 
         */
        public Builder policyDefinitionId(Output policyDefinitionId) {
            $.policyDefinitionId = policyDefinitionId;
            return this;
        }

        /**
         * @param policyDefinitionId The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
         * 
         * @return builder
         * 
         */
        public Builder policyDefinitionId(String policyDefinitionId) {
            return policyDefinitionId(Output.of(policyDefinitionId));
        }

        /**
         * @param resourceSelectors One or more `resource_selectors` blocks as defined below to filter polices by resource properties.
         * 
         * @return builder
         * 
         */
        public Builder resourceSelectors(@Nullable Output> resourceSelectors) {
            $.resourceSelectors = resourceSelectors;
            return this;
        }

        /**
         * @param resourceSelectors One or more `resource_selectors` blocks as defined below to filter polices by resource properties.
         * 
         * @return builder
         * 
         */
        public Builder resourceSelectors(List resourceSelectors) {
            return resourceSelectors(Output.of(resourceSelectors));
        }

        /**
         * @param resourceSelectors One or more `resource_selectors` blocks as defined below to filter polices by resource properties.
         * 
         * @return builder
         * 
         */
        public Builder resourceSelectors(GroupPolicyAssignmentResourceSelectorArgs... resourceSelectors) {
            return resourceSelectors(List.of(resourceSelectors));
        }

        public GroupPolicyAssignmentArgs build() {
            if ($.managementGroupId == null) {
                throw new MissingRequiredPropertyException("GroupPolicyAssignmentArgs", "managementGroupId");
            }
            if ($.policyDefinitionId == null) {
                throw new MissingRequiredPropertyException("GroupPolicyAssignmentArgs", "policyDefinitionId");
            }
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy