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

com.pulumi.azure.core.ResourcePolicyExemption 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.core;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.core.ResourcePolicyExemptionArgs;
import com.pulumi.azure.core.inputs.ResourcePolicyExemptionState;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages a Resource Policy Exemption.
 * 
 * ## Example Usage
 * 
 * <!--Start PulumiCodeChooser -->
 * 
 * {@code
 * 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.network.VirtualNetwork;
 * import com.pulumi.azure.network.VirtualNetworkArgs;
 * import com.pulumi.azure.policy.PolicyFunctions;
 * import com.pulumi.azure.policy.inputs.GetPolicySetDefinitionArgs;
 * import com.pulumi.azure.core.ResourcePolicyAssignment;
 * import com.pulumi.azure.core.ResourcePolicyAssignmentArgs;
 * import com.pulumi.azure.core.inputs.ResourcePolicyAssignmentIdentityArgs;
 * import com.pulumi.azure.core.ResourcePolicyExemption;
 * import com.pulumi.azure.core.ResourcePolicyExemptionArgs;
 * 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()
 *             .name("group1")
 *             .location("westus")
 *             .build());
 * 
 *         var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
 *             .name("network1")
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .location(exampleResourceGroup.location())
 *             .addressSpaces("10.0.0.0/16")
 *             .build());
 * 
 *         final var example = PolicyFunctions.getPolicySetDefinition(GetPolicySetDefinitionArgs.builder()
 *             .displayName("Audit machines with insecure password security settings")
 *             .build());
 * 
 *         var exampleResourcePolicyAssignment = new ResourcePolicyAssignment("exampleResourcePolicyAssignment", ResourcePolicyAssignmentArgs.builder()
 *             .name("assignment1")
 *             .resourceId(exampleVirtualNetwork.id())
 *             .policyDefinitionId(example.applyValue(getPolicySetDefinitionResult -> getPolicySetDefinitionResult.id()))
 *             .location(exampleResourceGroup.location())
 *             .identity(ResourcePolicyAssignmentIdentityArgs.builder()
 *                 .type("SystemAssigned")
 *                 .build())
 *             .build());
 * 
 *         var exampleResourcePolicyExemption = new ResourcePolicyExemption("exampleResourcePolicyExemption", ResourcePolicyExemptionArgs.builder()
 *             .name("exemption1")
 *             .resourceId(exampleResourcePolicyAssignment.resourceId())
 *             .policyAssignmentId(exampleResourcePolicyAssignment.id())
 *             .exemptionCategory("Mitigated")
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Import * * Policy Exemptions can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:core/resourcePolicyExemption:ResourcePolicyExemption exemption1 /subscriptions/00000000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.Authorization/policyExemptions/exemption1 * ``` * */ @ResourceType(type="azure:core/resourcePolicyExemption:ResourcePolicyExemption") public class ResourcePolicyExemption extends com.pulumi.resources.CustomResource { /** * A description to use for this Policy Exemption. * */ @Export(name="description", refs={String.class}, tree="[0]") private Output description; /** * @return A description to use for this Policy Exemption. * */ public Output> description() { return Codegen.optional(this.description); } /** * A friendly display name to use for this Policy Exemption. * */ @Export(name="displayName", refs={String.class}, tree="[0]") private Output displayName; /** * @return A friendly display name to use for this Policy Exemption. * */ public Output> displayName() { return Codegen.optional(this.displayName); } /** * The category of this policy exemption. Possible values are `Waiver` and `Mitigated`. * */ @Export(name="exemptionCategory", refs={String.class}, tree="[0]") private Output exemptionCategory; /** * @return The category of this policy exemption. Possible values are `Waiver` and `Mitigated`. * */ public Output exemptionCategory() { return this.exemptionCategory; } /** * The expiration date and time in UTC ISO 8601 format of this policy exemption. * */ @Export(name="expiresOn", refs={String.class}, tree="[0]") private Output expiresOn; /** * @return The expiration date and time in UTC ISO 8601 format of this policy exemption. * */ public Output> expiresOn() { return Codegen.optional(this.expiresOn); } /** * The metadata for this policy exemption. This is a JSON string representing additional metadata that should be stored with the policy exemption. * */ @Export(name="metadata", refs={String.class}, tree="[0]") private Output metadata; /** * @return The metadata for this policy exemption. This is a JSON string representing additional metadata that should be stored with the policy exemption. * */ public Output metadata() { return this.metadata; } /** * The name of the Policy Exemption. Changing this forces a new resource to be created. * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return The name of the Policy Exemption. Changing this forces a new resource to be created. * */ public Output name() { return this.name; } /** * The ID of the Policy Assignment to be exempted at the specified Scope. Changing this forces a new resource to be created. * */ @Export(name="policyAssignmentId", refs={String.class}, tree="[0]") private Output policyAssignmentId; /** * @return The ID of the Policy Assignment to be exempted at the specified Scope. Changing this forces a new resource to be created. * */ public Output policyAssignmentId() { return this.policyAssignmentId; } /** * The policy definition reference ID list when the associated policy assignment is an assignment of a policy set definition. * */ @Export(name="policyDefinitionReferenceIds", refs={List.class,String.class}, tree="[0,1]") private Output> policyDefinitionReferenceIds; /** * @return The policy definition reference ID list when the associated policy assignment is an assignment of a policy set definition. * */ public Output>> policyDefinitionReferenceIds() { return Codegen.optional(this.policyDefinitionReferenceIds); } /** * The Resource ID where the Policy Exemption should be applied. Changing this forces a new resource to be created. * */ @Export(name="resourceId", refs={String.class}, tree="[0]") private Output resourceId; /** * @return The Resource ID where the Policy Exemption should be applied. Changing this forces a new resource to be created. * */ public Output resourceId() { return this.resourceId; } /** * * @param name The _unique_ name of the resulting resource. */ public ResourcePolicyExemption(java.lang.String name) { this(name, ResourcePolicyExemptionArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public ResourcePolicyExemption(java.lang.String name, ResourcePolicyExemptionArgs 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 ResourcePolicyExemption(java.lang.String name, ResourcePolicyExemptionArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:core/resourcePolicyExemption:ResourcePolicyExemption", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private ResourcePolicyExemption(java.lang.String name, Output id, @Nullable ResourcePolicyExemptionState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:core/resourcePolicyExemption:ResourcePolicyExemption", name, state, makeResourceOptions(options, id), false); } private static ResourcePolicyExemptionArgs makeArgs(ResourcePolicyExemptionArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? ResourcePolicyExemptionArgs.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 ResourcePolicyExemption get(java.lang.String name, Output id, @Nullable ResourcePolicyExemptionState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new ResourcePolicyExemption(name, id, state, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy