Class Key


  • public class Key
    extends com.pulumi.resources.CustomResource
    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. ## Example Usage ### Create a key ```java 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 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(Map.of("kty", "RSA")) .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} ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      Key​(java.lang.String name)  
      Key​(java.lang.String name, KeyArgs args)  
      Key​(java.lang.String name, KeyArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.util.Optional<KeyAttributesResponse>> attributes()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> curveName()  
      static Key get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> keyOps()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> keySize()  
      com.pulumi.core.Output<java.lang.String> keyUri()  
      com.pulumi.core.Output<java.lang.String> keyUriWithVersion()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> kty()  
      com.pulumi.core.Output<java.lang.String> location()  
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<java.util.Optional<KeyReleasePolicyResponse>> releasePolicy()  
      com.pulumi.core.Output<java.util.Optional<RotationPolicyResponse>> rotationPolicy()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tags()  
      com.pulumi.core.Output<java.lang.String> type()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Key

        public Key​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • Key

        public Key​(java.lang.String name,
                   KeyArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • Key

        public Key​(java.lang.String name,
                   KeyArgs args,
                   @Nullable
                   com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • attributes

        public com.pulumi.core.Output<java.util.Optional<KeyAttributesResponse>> attributes()
        Returns:
        The attributes of the key.
      • curveName

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> curveName()
        Returns:
        The elliptic curve name. For valid values, see JsonWebKeyCurveName.
      • keyOps

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> keyOps()
      • keySize

        public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> keySize()
        Returns:
        The key size in bits. For example: 2048, 3072, or 4096 for RSA.
      • keyUri

        public com.pulumi.core.Output<java.lang.String> keyUri()
        Returns:
        The URI to retrieve the current version of the key.
      • keyUriWithVersion

        public com.pulumi.core.Output<java.lang.String> keyUriWithVersion()
        Returns:
        The URI to retrieve the specific version of the key.
      • kty

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> kty()
        Returns:
        The type of the key. For valid values, see JsonWebKeyType.
      • location

        public com.pulumi.core.Output<java.lang.String> location()
        Returns:
        Azure location of the key vault resource.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        Name of the key vault resource.
      • releasePolicy

        public com.pulumi.core.Output<java.util.Optional<KeyReleasePolicyResponse>> releasePolicy()
        Returns:
        Key release policy in response. It will be used for both output and input. Omitted if empty
      • rotationPolicy

        public com.pulumi.core.Output<java.util.Optional<RotationPolicyResponse>> rotationPolicy()
        Returns:
        Key rotation policy in response. It will be used for both output and input. Omitted if empty
      • tags

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tags()
        Returns:
        Tags assigned to the key vault resource.
      • type

        public com.pulumi.core.Output<java.lang.String> type()
        Returns:
        Resource type of the key vault resource.
      • get

        public static Key get​(java.lang.String name,
                              com.pulumi.core.Output<java.lang.String> id,
                              @Nullable
                              com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        options - Optional settings to control the behavior of the CustomResource.