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

com.pulumi.azurenative.compute.DiskEncryptionSet Maven / Gradle / Ivy

There is a newer version: 2.78.0
Show newest version
// *** 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.azurenative.compute;

import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.compute.DiskEncryptionSetArgs;
import com.pulumi.azurenative.compute.outputs.ApiErrorResponse;
import com.pulumi.azurenative.compute.outputs.EncryptionSetIdentityResponse;
import com.pulumi.azurenative.compute.outputs.KeyForDiskEncryptionSetResponse;
import com.pulumi.core.Alias;
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.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * disk encryption set resource.
 * Azure REST API version: 2022-07-02. Prior API version in Azure Native 1.x: 2020-12-01.
 * 
 * Other available API versions: 2020-06-30, 2023-01-02, 2023-04-02, 2023-10-02, 2024-03-02.
 * 
 * ## Example Usage
 * ### Create a disk encryption set with key vault from a different subscription.
 * 
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.compute.DiskEncryptionSet;
 * import com.pulumi.azurenative.compute.DiskEncryptionSetArgs;
 * import com.pulumi.azurenative.compute.inputs.KeyForDiskEncryptionSetArgs;
 * import com.pulumi.azurenative.compute.inputs.EncryptionSetIdentityArgs;
 * 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 diskEncryptionSet = new DiskEncryptionSet("diskEncryptionSet", DiskEncryptionSetArgs.builder()
 *             .activeKey(KeyForDiskEncryptionSetArgs.builder()
 *                 .keyUrl("https://myvaultdifferentsub.vault-int.azure-int.net/keys/{key}")
 *                 .build())
 *             .diskEncryptionSetName("myDiskEncryptionSet")
 *             .encryptionType("EncryptionAtRestWithCustomerKey")
 *             .identity(EncryptionSetIdentityArgs.builder()
 *                 .type("SystemAssigned")
 *                 .build())
 *             .location("West US")
 *             .resourceGroupName("myResourceGroup")
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* ### Create a disk encryption set. * *
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.compute.DiskEncryptionSet;
 * import com.pulumi.azurenative.compute.DiskEncryptionSetArgs;
 * import com.pulumi.azurenative.compute.inputs.KeyForDiskEncryptionSetArgs;
 * import com.pulumi.azurenative.compute.inputs.SourceVaultArgs;
 * import com.pulumi.azurenative.compute.inputs.EncryptionSetIdentityArgs;
 * 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 diskEncryptionSet = new DiskEncryptionSet("diskEncryptionSet", DiskEncryptionSetArgs.builder()
 *             .activeKey(KeyForDiskEncryptionSetArgs.builder()
 *                 .keyUrl("https://myvmvault.vault-int.azure-int.net/keys/{key}")
 *                 .sourceVault(SourceVaultArgs.builder()
 *                     .id("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault")
 *                     .build())
 *                 .build())
 *             .diskEncryptionSetName("myDiskEncryptionSet")
 *             .encryptionType("EncryptionAtRestWithCustomerKey")
 *             .identity(EncryptionSetIdentityArgs.builder()
 *                 .type("SystemAssigned")
 *                 .build())
 *             .location("West US")
 *             .resourceGroupName("myResourceGroup")
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* * ## Import * * An existing resource can be imported using its type token, name, and identifier, e.g. * * ```sh * $ pulumi import azure-native:compute:DiskEncryptionSet myDiskEncryptionSet /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName} * ``` * */ @ResourceType(type="azure-native:compute:DiskEncryptionSet") public class DiskEncryptionSet extends com.pulumi.resources.CustomResource { /** * The key vault key which is currently used by this disk encryption set. * */ @Export(name="activeKey", refs={KeyForDiskEncryptionSetResponse.class}, tree="[0]") private Output activeKey; /** * @return The key vault key which is currently used by this disk encryption set. * */ public Output> activeKey() { return Codegen.optional(this.activeKey); } /** * The error that was encountered during auto-key rotation. If an error is present, then auto-key rotation will not be attempted until the error on this disk encryption set is fixed. * */ @Export(name="autoKeyRotationError", refs={ApiErrorResponse.class}, tree="[0]") private Output autoKeyRotationError; /** * @return The error that was encountered during auto-key rotation. If an error is present, then auto-key rotation will not be attempted until the error on this disk encryption set is fixed. * */ public Output autoKeyRotationError() { return this.autoKeyRotationError; } /** * The type of key used to encrypt the data of the disk. * */ @Export(name="encryptionType", refs={String.class}, tree="[0]") private Output encryptionType; /** * @return The type of key used to encrypt the data of the disk. * */ public Output> encryptionType() { return Codegen.optional(this.encryptionType); } /** * Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the property. * */ @Export(name="federatedClientId", refs={String.class}, tree="[0]") private Output federatedClientId; /** * @return Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the property. * */ public Output> federatedClientId() { return Codegen.optional(this.federatedClientId); } /** * The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used to encrypt disks. * */ @Export(name="identity", refs={EncryptionSetIdentityResponse.class}, tree="[0]") private Output identity; /** * @return The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used to encrypt disks. * */ public Output> identity() { return Codegen.optional(this.identity); } /** * The time when the active key of this disk encryption set was updated. * */ @Export(name="lastKeyRotationTimestamp", refs={String.class}, tree="[0]") private Output lastKeyRotationTimestamp; /** * @return The time when the active key of this disk encryption set was updated. * */ public Output lastKeyRotationTimestamp() { return this.lastKeyRotationTimestamp; } /** * Resource location * */ @Export(name="location", refs={String.class}, tree="[0]") private Output location; /** * @return Resource location * */ public Output location() { return this.location; } /** * Resource name * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return Resource name * */ public Output name() { return this.name; } /** * A readonly collection of key vault keys previously used by this disk encryption set while a key rotation is in progress. It will be empty if there is no ongoing key rotation. * */ @Export(name="previousKeys", refs={List.class,KeyForDiskEncryptionSetResponse.class}, tree="[0,1]") private Output> previousKeys; /** * @return A readonly collection of key vault keys previously used by this disk encryption set while a key rotation is in progress. It will be empty if there is no ongoing key rotation. * */ public Output> previousKeys() { return this.previousKeys; } /** * The disk encryption set provisioning state. * */ @Export(name="provisioningState", refs={String.class}, tree="[0]") private Output provisioningState; /** * @return The disk encryption set provisioning state. * */ public Output provisioningState() { return this.provisioningState; } /** * Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. * */ @Export(name="rotationToLatestKeyVersionEnabled", refs={Boolean.class}, tree="[0]") private Output rotationToLatestKeyVersionEnabled; /** * @return Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. * */ public Output> rotationToLatestKeyVersionEnabled() { return Codegen.optional(this.rotationToLatestKeyVersionEnabled); } /** * Resource tags * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return Resource tags * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * Resource type * */ @Export(name="type", refs={String.class}, tree="[0]") private Output type; /** * @return Resource type * */ public Output type() { return this.type; } /** * * @param name The _unique_ name of the resulting resource. */ public DiskEncryptionSet(java.lang.String name) { this(name, DiskEncryptionSetArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public DiskEncryptionSet(java.lang.String name, DiskEncryptionSetArgs 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 DiskEncryptionSet(java.lang.String name, DiskEncryptionSetArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:compute:DiskEncryptionSet", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private DiskEncryptionSet(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:compute:DiskEncryptionSet", name, null, makeResourceOptions(options, id), false); } private static DiskEncryptionSetArgs makeArgs(DiskEncryptionSetArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? DiskEncryptionSetArgs.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()) .aliases(List.of( Output.of(Alias.builder().type("azure-native:compute/v20190701:DiskEncryptionSet").build()), Output.of(Alias.builder().type("azure-native:compute/v20191101:DiskEncryptionSet").build()), Output.of(Alias.builder().type("azure-native:compute/v20200501:DiskEncryptionSet").build()), Output.of(Alias.builder().type("azure-native:compute/v20200630:DiskEncryptionSet").build()), Output.of(Alias.builder().type("azure-native:compute/v20200930:DiskEncryptionSet").build()), Output.of(Alias.builder().type("azure-native:compute/v20201201:DiskEncryptionSet").build()), Output.of(Alias.builder().type("azure-native:compute/v20210401:DiskEncryptionSet").build()), Output.of(Alias.builder().type("azure-native:compute/v20210801:DiskEncryptionSet").build()), Output.of(Alias.builder().type("azure-native:compute/v20211201:DiskEncryptionSet").build()), Output.of(Alias.builder().type("azure-native:compute/v20220302:DiskEncryptionSet").build()), Output.of(Alias.builder().type("azure-native:compute/v20220702:DiskEncryptionSet").build()), Output.of(Alias.builder().type("azure-native:compute/v20230102:DiskEncryptionSet").build()), Output.of(Alias.builder().type("azure-native:compute/v20230402:DiskEncryptionSet").build()), Output.of(Alias.builder().type("azure-native:compute/v20231002:DiskEncryptionSet").build()), Output.of(Alias.builder().type("azure-native:compute/v20240302:DiskEncryptionSet").build()) )) .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 options Optional settings to control the behavior of the CustomResource. */ public static DiskEncryptionSet get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new DiskEncryptionSet(name, id, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy