// *** 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.vault.pkiSecret;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import com.pulumi.vault.Utilities;
import com.pulumi.vault.pkiSecret.SecretBackendKeyArgs;
import com.pulumi.vault.pkiSecret.inputs.SecretBackendKeyState;
import java.lang.Integer;
import java.lang.String;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Creates a key on a PKI Secret Backend for Vault.
 * 
 * ## Example Usage
 * 
 * ```java
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.vault.Mount;
 * import com.pulumi.vault.MountArgs;
 * import com.pulumi.vault.pkiSecret.SecretBackendKey;
 * import com.pulumi.vault.pkiSecret.SecretBackendKeyArgs;
 * 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 pki = new Mount(&#34;pki&#34;, MountArgs.builder()        
 *             .path(&#34;pki&#34;)
 *             .type(&#34;pki&#34;)
 *             .defaultLeaseTtlSeconds(3600)
 *             .maxLeaseTtlSeconds(86400)
 *             .build());
 * 
 *         var key = new SecretBackendKey(&#34;key&#34;, SecretBackendKeyArgs.builder()        
 *             .mount(pki.path())
 *             .type(&#34;exported&#34;)
 *             .keyName(&#34;example-key&#34;)
 *             .keyType(&#34;rsa&#34;)
 *             .keyBits(&#34;2048&#34;)
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * PKI secret backend key can be imported using the `id`, e.g.
 * 
 * ```sh
 *  $ pulumi import vault:pkiSecret/secretBackendKey:SecretBackendKey key pki/key/bf9b0d48-d0dd-652c-30be-77d04fc7e94d
 * ```
 * 
 */
@ResourceType(type="vault:pkiSecret/secretBackendKey:SecretBackendKey")
public class SecretBackendKey extends com.pulumi.resources.CustomResource {
    /**
     * The path the PKI secret backend is mounted at, with no leading or trailing `/`s.
     * 
     */
    @Export(name="backend", refs={String.class}, tree="[0]")
    private Output<String> backend;

    /**
     * @return The path the PKI secret backend is mounted at, with no leading or trailing `/`s.
     * 
     */
    public Output<String> backend() {
        return this.backend;
    }
    /**
     * Specifies the number of bits to use for the generated keys.
     * Allowed values are 0 (universal default); with `key_type=rsa`, allowed values are:
     * 2048 (default), 3072, or 4096; with `key_type=ec`, allowed values are: 224, 256 (default),
     * 384, or 521; ignored with `key_type=ed25519`.
     * 
     */
    @Export(name="keyBits", refs={Integer.class}, tree="[0]")
    private Output<Integer> keyBits;

    /**
     * @return Specifies the number of bits to use for the generated keys.
     * Allowed values are 0 (universal default); with `key_type=rsa`, allowed values are:
     * 2048 (default), 3072, or 4096; with `key_type=ec`, allowed values are: 224, 256 (default),
     * 384, or 521; ignored with `key_type=ed25519`.
     * 
     */
    public Output<Integer> keyBits() {
        return this.keyBits;
    }
    /**
     * ID of the generated key.
     * 
     */
    @Export(name="keyId", refs={String.class}, tree="[0]")
    private Output<String> keyId;

    /**
     * @return ID of the generated key.
     * 
     */
    public Output<String> keyId() {
        return this.keyId;
    }
    /**
     * When a new key is created with this request, optionally specifies the name for this.
     * The global ref `default` may not be used as a name.
     * 
     */
    @Export(name="keyName", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> keyName;

    /**
     * @return When a new key is created with this request, optionally specifies the name for this.
     * The global ref `default` may not be used as a name.
     * 
     */
    public Output<Optional<String>> keyName() {
        return Codegen.optional(this.keyName);
    }
    /**
     * Specifies the desired key type; must be `rsa`, `ed25519` or `ec`.
     * 
     */
    @Export(name="keyType", refs={String.class}, tree="[0]")
    private Output<String> keyType;

    /**
     * @return Specifies the desired key type; must be `rsa`, `ed25519` or `ec`.
     * 
     */
    public Output<String> keyType() {
        return this.keyType;
    }
    /**
     * The managed key&#39;s UUID.
     * 
     */
    @Export(name="managedKeyId", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> managedKeyId;

    /**
     * @return The managed key&#39;s UUID.
     * 
     */
    public Output<Optional<String>> managedKeyId() {
        return Codegen.optional(this.managedKeyId);
    }
    /**
     * The managed key&#39;s configured name.
     * 
     */
    @Export(name="managedKeyName", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> managedKeyName;

    /**
     * @return The managed key&#39;s configured name.
     * 
     */
    public Output<Optional<String>> managedKeyName() {
        return Codegen.optional(this.managedKeyName);
    }
    /**
     * The namespace to provision the resource in.
     * The value should not contain leading or trailing forward slashes.
     * The `namespace` is always relative to the provider&#39;s configured [namespace](https://www.terraform.io/docs/providers/vault#namespace).
     * *Available only for Vault Enterprise*.
     * 
     */
    @Export(name="namespace", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> namespace;

    /**
     * @return The namespace to provision the resource in.
     * The value should not contain leading or trailing forward slashes.
     * The `namespace` is always relative to the provider&#39;s configured [namespace](https://www.terraform.io/docs/providers/vault#namespace).
     * *Available only for Vault Enterprise*.
     * 
     */
    public Output<Optional<String>> namespace() {
        return Codegen.optional(this.namespace);
    }
    /**
     * Specifies the type of the key to create. Can be `exported`,`internal` or `kms`.
     * 
     */
    @Export(name="type", refs={String.class}, tree="[0]")
    private Output<String> type;

    /**
     * @return Specifies the type of the key to create. Can be `exported`,`internal` or `kms`.
     * 
     */
    public Output<String> type() {
        return this.type;
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public SecretBackendKey(String name) {
        this(name, SecretBackendKeyArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public SecretBackendKey(String name, SecretBackendKeyArgs 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 SecretBackendKey(String name, SecretBackendKeyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("vault:pkiSecret/secretBackendKey:SecretBackendKey", name, args == null ? SecretBackendKeyArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private SecretBackendKey(String name, Output<String> id, @Nullable SecretBackendKeyState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("vault:pkiSecret/secretBackendKey:SecretBackendKey", name, state, makeResourceOptions(options, id));
    }

    private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output<String> 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 SecretBackendKey get(String name, Output<String> id, @Nullable SecretBackendKeyState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new SecretBackendKey(name, id, state, options);
    }
}
