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

com.pulumi.azurenative.keyvault.Key Maven / Gradle / Ivy

There is a newer version: 2.82.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.keyvault;

import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.keyvault.KeyArgs;
import com.pulumi.azurenative.keyvault.outputs.KeyAttributesResponse;
import com.pulumi.azurenative.keyvault.outputs.KeyReleasePolicyResponse;
import com.pulumi.azurenative.keyvault.outputs.RotationPolicyResponse;
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.Integer;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * The key resource.
 * Azure REST API version: 2023-02-01. Prior API version in Azure Native 1.x: 2019-09-01.
 * 
 * Other available API versions: 2023-07-01, 2024-04-01-preview.
 * 
 * ## Example Usage
 * ### Create a key
 * 
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.keyvault.Key;
 * import com.pulumi.azurenative.keyvault.KeyArgs;
 * import com.pulumi.azurenative.keyvault.inputs.KeyPropertiesArgs;
 * 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 key = new Key("key", KeyArgs.builder()
 *             .keyName("sample-key-name")
 *             .properties(KeyPropertiesArgs.builder()
 *                 .kty("RSA")
 *                 .build())
 *             .resourceGroupName("sample-group")
 *             .vaultName("sample-vault-name")
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* * ## Import * * An existing resource can be imported using its type token, name, and identifier, e.g. * * ```sh * $ pulumi import azure-native:keyvault:Key sample-key-name /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/keys/{keyName} * ``` * */ @ResourceType(type="azure-native:keyvault:Key") public class Key extends com.pulumi.resources.CustomResource { /** * The attributes of the key. * */ @Export(name="attributes", refs={KeyAttributesResponse.class}, tree="[0]") private Output attributes; /** * @return The attributes of the key. * */ public Output> attributes() { return Codegen.optional(this.attributes); } /** * The elliptic curve name. For valid values, see JsonWebKeyCurveName. * */ @Export(name="curveName", refs={String.class}, tree="[0]") private Output curveName; /** * @return The elliptic curve name. For valid values, see JsonWebKeyCurveName. * */ public Output> curveName() { return Codegen.optional(this.curveName); } @Export(name="keyOps", refs={List.class,String.class}, tree="[0,1]") private Output> keyOps; public Output>> keyOps() { return Codegen.optional(this.keyOps); } /** * The key size in bits. For example: 2048, 3072, or 4096 for RSA. * */ @Export(name="keySize", refs={Integer.class}, tree="[0]") private Output keySize; /** * @return The key size in bits. For example: 2048, 3072, or 4096 for RSA. * */ public Output> keySize() { return Codegen.optional(this.keySize); } /** * The URI to retrieve the current version of the key. * */ @Export(name="keyUri", refs={String.class}, tree="[0]") private Output keyUri; /** * @return The URI to retrieve the current version of the key. * */ public Output keyUri() { return this.keyUri; } /** * The URI to retrieve the specific version of the key. * */ @Export(name="keyUriWithVersion", refs={String.class}, tree="[0]") private Output keyUriWithVersion; /** * @return The URI to retrieve the specific version of the key. * */ public Output keyUriWithVersion() { return this.keyUriWithVersion; } /** * The type of the key. For valid values, see JsonWebKeyType. * */ @Export(name="kty", refs={String.class}, tree="[0]") private Output kty; /** * @return The type of the key. For valid values, see JsonWebKeyType. * */ public Output> kty() { return Codegen.optional(this.kty); } /** * Azure location of the key vault resource. * */ @Export(name="location", refs={String.class}, tree="[0]") private Output location; /** * @return Azure location of the key vault resource. * */ public Output location() { return this.location; } /** * Name of the key vault resource. * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return Name of the key vault resource. * */ public Output name() { return this.name; } /** * Key release policy in response. It will be used for both output and input. Omitted if empty * */ @Export(name="releasePolicy", refs={KeyReleasePolicyResponse.class}, tree="[0]") private Output releasePolicy; /** * @return Key release policy in response. It will be used for both output and input. Omitted if empty * */ public Output> releasePolicy() { return Codegen.optional(this.releasePolicy); } /** * Key rotation policy in response. It will be used for both output and input. Omitted if empty * */ @Export(name="rotationPolicy", refs={RotationPolicyResponse.class}, tree="[0]") private Output rotationPolicy; /** * @return Key rotation policy in response. It will be used for both output and input. Omitted if empty * */ public Output> rotationPolicy() { return Codegen.optional(this.rotationPolicy); } /** * Tags assigned to the key vault resource. * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return Tags assigned to the key vault resource. * */ public Output> tags() { return this.tags; } /** * Resource type of the key vault resource. * */ @Export(name="type", refs={String.class}, tree="[0]") private Output type; /** * @return Resource type of the key vault resource. * */ public Output type() { return this.type; } /** * * @param name The _unique_ name of the resulting resource. */ public Key(java.lang.String name) { this(name, KeyArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public Key(java.lang.String name, KeyArgs 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 Key(java.lang.String name, KeyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:keyvault:Key", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private Key(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:keyvault:Key", name, null, makeResourceOptions(options, id), false); } private static KeyArgs makeArgs(KeyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? KeyArgs.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:keyvault/v20190901:Key").build()), Output.of(Alias.builder().type("azure-native:keyvault/v20200401preview:Key").build()), Output.of(Alias.builder().type("azure-native:keyvault/v20210401preview:Key").build()), Output.of(Alias.builder().type("azure-native:keyvault/v20210601preview:Key").build()), Output.of(Alias.builder().type("azure-native:keyvault/v20211001:Key").build()), Output.of(Alias.builder().type("azure-native:keyvault/v20211101preview:Key").build()), Output.of(Alias.builder().type("azure-native:keyvault/v20220201preview:Key").build()), Output.of(Alias.builder().type("azure-native:keyvault/v20220701:Key").build()), Output.of(Alias.builder().type("azure-native:keyvault/v20221101:Key").build()), Output.of(Alias.builder().type("azure-native:keyvault/v20230201:Key").build()), Output.of(Alias.builder().type("azure-native:keyvault/v20230701:Key").build()), Output.of(Alias.builder().type("azure-native:keyvault/v20240401preview:Key").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 Key get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new Key(name, id, options); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy