# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
from ._inputs import *

__all__ = ['SecretV2Args', 'SecretV2']

@pulumi.input_type
class SecretV2Args:
    def __init__(__self__, *,
                 data_json: pulumi.Input[str],
                 mount: pulumi.Input[str],
                 cas: Optional[pulumi.Input[int]] = None,
                 custom_metadata: Optional[pulumi.Input['SecretV2CustomMetadataArgs']] = None,
                 delete_all_versions: Optional[pulumi.Input[bool]] = None,
                 disable_read: Optional[pulumi.Input[bool]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 namespace: Optional[pulumi.Input[str]] = None,
                 options: Optional[pulumi.Input[Mapping[str, Any]]] = None):
        """
        The set of arguments for constructing a SecretV2 resource.
        :param pulumi.Input[str] data_json: JSON-encoded string that will be
               written as the secret data at the given path.
        :param pulumi.Input[str] mount: Path where KV-V2 engine is mounted.
        :param pulumi.Input[int] cas: This flag is required if `cas_required` is set to true
               on either the secret or the engine's config. In order for a
               write operation to be successful, cas must be set to the current version
               of the secret.
        :param pulumi.Input['SecretV2CustomMetadataArgs'] custom_metadata: A nested block that allows configuring metadata for the
               KV secret. Refer to the
               Configuration Options for more info.
        :param pulumi.Input[bool] delete_all_versions: If set to true, permanently deletes all
               versions for the specified key.
        :param pulumi.Input[bool] disable_read: If set to true, disables reading secret from Vault;
               note: drift won't be detected.
        :param pulumi.Input[str] name: Full name of the secret. For a nested secret
               the name is the nested path excluding the mount and data
               prefix. For example, for a secret at `kvv2/data/foo/bar/baz`
               the name is `foo/bar/baz`.
        :param pulumi.Input[str] namespace: 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's configured [namespace](https://www.terraform.io/docs/providers/vault#namespace).
               *Available only for Vault Enterprise*.
        :param pulumi.Input[Mapping[str, Any]] options: An object that holds option settings.
        """
        pulumi.set(__self__, "data_json", data_json)
        pulumi.set(__self__, "mount", mount)
        if cas is not None:
            pulumi.set(__self__, "cas", cas)
        if custom_metadata is not None:
            pulumi.set(__self__, "custom_metadata", custom_metadata)
        if delete_all_versions is not None:
            pulumi.set(__self__, "delete_all_versions", delete_all_versions)
        if disable_read is not None:
            pulumi.set(__self__, "disable_read", disable_read)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if namespace is not None:
            pulumi.set(__self__, "namespace", namespace)
        if options is not None:
            pulumi.set(__self__, "options", options)

    @property
    @pulumi.getter(name="dataJson")
    def data_json(self) -> pulumi.Input[str]:
        """
        JSON-encoded string that will be
        written as the secret data at the given path.
        """
        return pulumi.get(self, "data_json")

    @data_json.setter
    def data_json(self, value: pulumi.Input[str]):
        pulumi.set(self, "data_json", value)

    @property
    @pulumi.getter
    def mount(self) -> pulumi.Input[str]:
        """
        Path where KV-V2 engine is mounted.
        """
        return pulumi.get(self, "mount")

    @mount.setter
    def mount(self, value: pulumi.Input[str]):
        pulumi.set(self, "mount", value)

    @property
    @pulumi.getter
    def cas(self) -> Optional[pulumi.Input[int]]:
        """
        This flag is required if `cas_required` is set to true
        on either the secret or the engine's config. In order for a
        write operation to be successful, cas must be set to the current version
        of the secret.
        """
        return pulumi.get(self, "cas")

    @cas.setter
    def cas(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "cas", value)

    @property
    @pulumi.getter(name="customMetadata")
    def custom_metadata(self) -> Optional[pulumi.Input['SecretV2CustomMetadataArgs']]:
        """
        A nested block that allows configuring metadata for the
        KV secret. Refer to the
        Configuration Options for more info.
        """
        return pulumi.get(self, "custom_metadata")

    @custom_metadata.setter
    def custom_metadata(self, value: Optional[pulumi.Input['SecretV2CustomMetadataArgs']]):
        pulumi.set(self, "custom_metadata", value)

    @property
    @pulumi.getter(name="deleteAllVersions")
    def delete_all_versions(self) -> Optional[pulumi.Input[bool]]:
        """
        If set to true, permanently deletes all
        versions for the specified key.
        """
        return pulumi.get(self, "delete_all_versions")

    @delete_all_versions.setter
    def delete_all_versions(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "delete_all_versions", value)

    @property
    @pulumi.getter(name="disableRead")
    def disable_read(self) -> Optional[pulumi.Input[bool]]:
        """
        If set to true, disables reading secret from Vault;
        note: drift won't be detected.
        """
        return pulumi.get(self, "disable_read")

    @disable_read.setter
    def disable_read(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "disable_read", value)

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        Full name of the secret. For a nested secret
        the name is the nested path excluding the mount and data
        prefix. For example, for a secret at `kvv2/data/foo/bar/baz`
        the name is `foo/bar/baz`.
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "name", value)

    @property
    @pulumi.getter
    def namespace(self) -> Optional[pulumi.Input[str]]:
        """
        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's configured [namespace](https://www.terraform.io/docs/providers/vault#namespace).
        *Available only for Vault Enterprise*.
        """
        return pulumi.get(self, "namespace")

    @namespace.setter
    def namespace(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "namespace", value)

    @property
    @pulumi.getter
    def options(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
        """
        An object that holds option settings.
        """
        return pulumi.get(self, "options")

    @options.setter
    def options(self, value: Optional[pulumi.Input[Mapping[str, Any]]]):
        pulumi.set(self, "options", value)


@pulumi.input_type
class _SecretV2State:
    def __init__(__self__, *,
                 cas: Optional[pulumi.Input[int]] = None,
                 custom_metadata: Optional[pulumi.Input['SecretV2CustomMetadataArgs']] = None,
                 data: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                 data_json: Optional[pulumi.Input[str]] = None,
                 delete_all_versions: Optional[pulumi.Input[bool]] = None,
                 disable_read: Optional[pulumi.Input[bool]] = None,
                 metadata: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                 mount: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 namespace: Optional[pulumi.Input[str]] = None,
                 options: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                 path: Optional[pulumi.Input[str]] = None):
        """
        Input properties used for looking up and filtering SecretV2 resources.
        :param pulumi.Input[int] cas: This flag is required if `cas_required` is set to true
               on either the secret or the engine's config. In order for a
               write operation to be successful, cas must be set to the current version
               of the secret.
        :param pulumi.Input['SecretV2CustomMetadataArgs'] custom_metadata: A nested block that allows configuring metadata for the
               KV secret. Refer to the
               Configuration Options for more info.
        :param pulumi.Input[Mapping[str, Any]] data: A mapping whose keys are the top-level data keys returned from
               Vault and whose values are the corresponding values. This map can only
               represent string data, so any non-string values returned from Vault are
               serialized as JSON.
        :param pulumi.Input[str] data_json: JSON-encoded string that will be
               written as the secret data at the given path.
        :param pulumi.Input[bool] delete_all_versions: If set to true, permanently deletes all
               versions for the specified key.
        :param pulumi.Input[bool] disable_read: If set to true, disables reading secret from Vault;
               note: drift won't be detected.
        :param pulumi.Input[Mapping[str, Any]] metadata: Metadata associated with this secret read from Vault.
        :param pulumi.Input[str] mount: Path where KV-V2 engine is mounted.
        :param pulumi.Input[str] name: Full name of the secret. For a nested secret
               the name is the nested path excluding the mount and data
               prefix. For example, for a secret at `kvv2/data/foo/bar/baz`
               the name is `foo/bar/baz`.
        :param pulumi.Input[str] namespace: 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's configured [namespace](https://www.terraform.io/docs/providers/vault#namespace).
               *Available only for Vault Enterprise*.
        :param pulumi.Input[Mapping[str, Any]] options: An object that holds option settings.
        :param pulumi.Input[str] path: Full path where the KV-V2 secret will be written.
        """
        if cas is not None:
            pulumi.set(__self__, "cas", cas)
        if custom_metadata is not None:
            pulumi.set(__self__, "custom_metadata", custom_metadata)
        if data is not None:
            pulumi.set(__self__, "data", data)
        if data_json is not None:
            pulumi.set(__self__, "data_json", data_json)
        if delete_all_versions is not None:
            pulumi.set(__self__, "delete_all_versions", delete_all_versions)
        if disable_read is not None:
            pulumi.set(__self__, "disable_read", disable_read)
        if metadata is not None:
            pulumi.set(__self__, "metadata", metadata)
        if mount is not None:
            pulumi.set(__self__, "mount", mount)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if namespace is not None:
            pulumi.set(__self__, "namespace", namespace)
        if options is not None:
            pulumi.set(__self__, "options", options)
        if path is not None:
            pulumi.set(__self__, "path", path)

    @property
    @pulumi.getter
    def cas(self) -> Optional[pulumi.Input[int]]:
        """
        This flag is required if `cas_required` is set to true
        on either the secret or the engine's config. In order for a
        write operation to be successful, cas must be set to the current version
        of the secret.
        """
        return pulumi.get(self, "cas")

    @cas.setter
    def cas(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "cas", value)

    @property
    @pulumi.getter(name="customMetadata")
    def custom_metadata(self) -> Optional[pulumi.Input['SecretV2CustomMetadataArgs']]:
        """
        A nested block that allows configuring metadata for the
        KV secret. Refer to the
        Configuration Options for more info.
        """
        return pulumi.get(self, "custom_metadata")

    @custom_metadata.setter
    def custom_metadata(self, value: Optional[pulumi.Input['SecretV2CustomMetadataArgs']]):
        pulumi.set(self, "custom_metadata", value)

    @property
    @pulumi.getter
    def data(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
        """
        A mapping whose keys are the top-level data keys returned from
        Vault and whose values are the corresponding values. This map can only
        represent string data, so any non-string values returned from Vault are
        serialized as JSON.
        """
        return pulumi.get(self, "data")

    @data.setter
    def data(self, value: Optional[pulumi.Input[Mapping[str, Any]]]):
        pulumi.set(self, "data", value)

    @property
    @pulumi.getter(name="dataJson")
    def data_json(self) -> Optional[pulumi.Input[str]]:
        """
        JSON-encoded string that will be
        written as the secret data at the given path.
        """
        return pulumi.get(self, "data_json")

    @data_json.setter
    def data_json(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "data_json", value)

    @property
    @pulumi.getter(name="deleteAllVersions")
    def delete_all_versions(self) -> Optional[pulumi.Input[bool]]:
        """
        If set to true, permanently deletes all
        versions for the specified key.
        """
        return pulumi.get(self, "delete_all_versions")

    @delete_all_versions.setter
    def delete_all_versions(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "delete_all_versions", value)

    @property
    @pulumi.getter(name="disableRead")
    def disable_read(self) -> Optional[pulumi.Input[bool]]:
        """
        If set to true, disables reading secret from Vault;
        note: drift won't be detected.
        """
        return pulumi.get(self, "disable_read")

    @disable_read.setter
    def disable_read(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "disable_read", value)

    @property
    @pulumi.getter
    def metadata(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
        """
        Metadata associated with this secret read from Vault.
        """
        return pulumi.get(self, "metadata")

    @metadata.setter
    def metadata(self, value: Optional[pulumi.Input[Mapping[str, Any]]]):
        pulumi.set(self, "metadata", value)

    @property
    @pulumi.getter
    def mount(self) -> Optional[pulumi.Input[str]]:
        """
        Path where KV-V2 engine is mounted.
        """
        return pulumi.get(self, "mount")

    @mount.setter
    def mount(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "mount", value)

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        Full name of the secret. For a nested secret
        the name is the nested path excluding the mount and data
        prefix. For example, for a secret at `kvv2/data/foo/bar/baz`
        the name is `foo/bar/baz`.
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "name", value)

    @property
    @pulumi.getter
    def namespace(self) -> Optional[pulumi.Input[str]]:
        """
        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's configured [namespace](https://www.terraform.io/docs/providers/vault#namespace).
        *Available only for Vault Enterprise*.
        """
        return pulumi.get(self, "namespace")

    @namespace.setter
    def namespace(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "namespace", value)

    @property
    @pulumi.getter
    def options(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
        """
        An object that holds option settings.
        """
        return pulumi.get(self, "options")

    @options.setter
    def options(self, value: Optional[pulumi.Input[Mapping[str, Any]]]):
        pulumi.set(self, "options", value)

    @property
    @pulumi.getter
    def path(self) -> Optional[pulumi.Input[str]]:
        """
        Full path where the KV-V2 secret will be written.
        """
        return pulumi.get(self, "path")

    @path.setter
    def path(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "path", value)


class SecretV2(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 cas: Optional[pulumi.Input[int]] = None,
                 custom_metadata: Optional[pulumi.Input[pulumi.InputType['SecretV2CustomMetadataArgs']]] = None,
                 data_json: Optional[pulumi.Input[str]] = None,
                 delete_all_versions: Optional[pulumi.Input[bool]] = None,
                 disable_read: Optional[pulumi.Input[bool]] = None,
                 mount: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 namespace: Optional[pulumi.Input[str]] = None,
                 options: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                 __props__=None):
        """
        Writes a KV-V2 secret to a given path in Vault.

        For more information on Vault's KV-V2 secret backend
        [see here](https://www.vaultproject.io/docs/secrets/kv/kv-v2).

        ## Example Usage

        ```python
        import pulumi
        import json
        import pulumi_vault as vault

        kvv2 = vault.Mount("kvv2",
            path="kvv2",
            type="kv",
            options={
                "version": "2",
            },
            description="KV Version 2 secret engine mount")
        example = vault.kv.SecretV2("example",
            mount=kvv2.path,
            cas=1,
            delete_all_versions=True,
            data_json=json.dumps({
                "zip": "zap",
                "foo": "bar",
            }),
            custom_metadata=vault.kv.SecretV2CustomMetadataArgs(
                max_versions=5,
                data={
                    "foo": "vault@example.com",
                    "bar": "12345",
                },
            ))
        ```
        ## Required Vault Capabilities

        Use of this resource requires the `create` or `update` capability
        (depending on whether the resource already exists) on the given path,
        the `delete` capability if the resource is removed from configuration,
        and the `read` capability for drift detection (by default).

        ### Custom Metadata Configuration Options

        * `max_versions` - (Optional) The number of versions to keep per key.

        * `cas_required` - (Optional) If true, all keys will require the cas
        parameter to be set on all write requests.

        * `delete_version_after` - (Optional) If set, specifies the length of time before
        a version is deleted. Accepts duration in integer seconds.

        * `data` - (Optional) A string to string map describing the secret.

        ## Import

        KV-V2 secrets can be imported using the `path`, e.g.

        ```sh
         $ pulumi import vault:kv/secretV2:SecretV2 example kvv2/data/secret
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[int] cas: This flag is required if `cas_required` is set to true
               on either the secret or the engine's config. In order for a
               write operation to be successful, cas must be set to the current version
               of the secret.
        :param pulumi.Input[pulumi.InputType['SecretV2CustomMetadataArgs']] custom_metadata: A nested block that allows configuring metadata for the
               KV secret. Refer to the
               Configuration Options for more info.
        :param pulumi.Input[str] data_json: JSON-encoded string that will be
               written as the secret data at the given path.
        :param pulumi.Input[bool] delete_all_versions: If set to true, permanently deletes all
               versions for the specified key.
        :param pulumi.Input[bool] disable_read: If set to true, disables reading secret from Vault;
               note: drift won't be detected.
        :param pulumi.Input[str] mount: Path where KV-V2 engine is mounted.
        :param pulumi.Input[str] name: Full name of the secret. For a nested secret
               the name is the nested path excluding the mount and data
               prefix. For example, for a secret at `kvv2/data/foo/bar/baz`
               the name is `foo/bar/baz`.
        :param pulumi.Input[str] namespace: 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's configured [namespace](https://www.terraform.io/docs/providers/vault#namespace).
               *Available only for Vault Enterprise*.
        :param pulumi.Input[Mapping[str, Any]] options: An object that holds option settings.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: SecretV2Args,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Writes a KV-V2 secret to a given path in Vault.

        For more information on Vault's KV-V2 secret backend
        [see here](https://www.vaultproject.io/docs/secrets/kv/kv-v2).

        ## Example Usage

        ```python
        import pulumi
        import json
        import pulumi_vault as vault

        kvv2 = vault.Mount("kvv2",
            path="kvv2",
            type="kv",
            options={
                "version": "2",
            },
            description="KV Version 2 secret engine mount")
        example = vault.kv.SecretV2("example",
            mount=kvv2.path,
            cas=1,
            delete_all_versions=True,
            data_json=json.dumps({
                "zip": "zap",
                "foo": "bar",
            }),
            custom_metadata=vault.kv.SecretV2CustomMetadataArgs(
                max_versions=5,
                data={
                    "foo": "vault@example.com",
                    "bar": "12345",
                },
            ))
        ```
        ## Required Vault Capabilities

        Use of this resource requires the `create` or `update` capability
        (depending on whether the resource already exists) on the given path,
        the `delete` capability if the resource is removed from configuration,
        and the `read` capability for drift detection (by default).

        ### Custom Metadata Configuration Options

        * `max_versions` - (Optional) The number of versions to keep per key.

        * `cas_required` - (Optional) If true, all keys will require the cas
        parameter to be set on all write requests.

        * `delete_version_after` - (Optional) If set, specifies the length of time before
        a version is deleted. Accepts duration in integer seconds.

        * `data` - (Optional) A string to string map describing the secret.

        ## Import

        KV-V2 secrets can be imported using the `path`, e.g.

        ```sh
         $ pulumi import vault:kv/secretV2:SecretV2 example kvv2/data/secret
        ```

        :param str resource_name: The name of the resource.
        :param SecretV2Args args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(SecretV2Args, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 cas: Optional[pulumi.Input[int]] = None,
                 custom_metadata: Optional[pulumi.Input[pulumi.InputType['SecretV2CustomMetadataArgs']]] = None,
                 data_json: Optional[pulumi.Input[str]] = None,
                 delete_all_versions: Optional[pulumi.Input[bool]] = None,
                 disable_read: Optional[pulumi.Input[bool]] = None,
                 mount: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 namespace: Optional[pulumi.Input[str]] = None,
                 options: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = SecretV2Args.__new__(SecretV2Args)

            __props__.__dict__["cas"] = cas
            __props__.__dict__["custom_metadata"] = custom_metadata
            if data_json is None and not opts.urn:
                raise TypeError("Missing required property 'data_json'")
            __props__.__dict__["data_json"] = None if data_json is None else pulumi.Output.secret(data_json)
            __props__.__dict__["delete_all_versions"] = delete_all_versions
            __props__.__dict__["disable_read"] = disable_read
            if mount is None and not opts.urn:
                raise TypeError("Missing required property 'mount'")
            __props__.__dict__["mount"] = mount
            __props__.__dict__["name"] = name
            __props__.__dict__["namespace"] = namespace
            __props__.__dict__["options"] = options
            __props__.__dict__["data"] = None
            __props__.__dict__["metadata"] = None
            __props__.__dict__["path"] = None
        secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["data", "dataJson"])
        opts = pulumi.ResourceOptions.merge(opts, secret_opts)
        super(SecretV2, __self__).__init__(
            'vault:kv/secretV2:SecretV2',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            cas: Optional[pulumi.Input[int]] = None,
            custom_metadata: Optional[pulumi.Input[pulumi.InputType['SecretV2CustomMetadataArgs']]] = None,
            data: Optional[pulumi.Input[Mapping[str, Any]]] = None,
            data_json: Optional[pulumi.Input[str]] = None,
            delete_all_versions: Optional[pulumi.Input[bool]] = None,
            disable_read: Optional[pulumi.Input[bool]] = None,
            metadata: Optional[pulumi.Input[Mapping[str, Any]]] = None,
            mount: Optional[pulumi.Input[str]] = None,
            name: Optional[pulumi.Input[str]] = None,
            namespace: Optional[pulumi.Input[str]] = None,
            options: Optional[pulumi.Input[Mapping[str, Any]]] = None,
            path: Optional[pulumi.Input[str]] = None) -> 'SecretV2':
        """
        Get an existing SecretV2 resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[int] cas: This flag is required if `cas_required` is set to true
               on either the secret or the engine's config. In order for a
               write operation to be successful, cas must be set to the current version
               of the secret.
        :param pulumi.Input[pulumi.InputType['SecretV2CustomMetadataArgs']] custom_metadata: A nested block that allows configuring metadata for the
               KV secret. Refer to the
               Configuration Options for more info.
        :param pulumi.Input[Mapping[str, Any]] data: A mapping whose keys are the top-level data keys returned from
               Vault and whose values are the corresponding values. This map can only
               represent string data, so any non-string values returned from Vault are
               serialized as JSON.
        :param pulumi.Input[str] data_json: JSON-encoded string that will be
               written as the secret data at the given path.
        :param pulumi.Input[bool] delete_all_versions: If set to true, permanently deletes all
               versions for the specified key.
        :param pulumi.Input[bool] disable_read: If set to true, disables reading secret from Vault;
               note: drift won't be detected.
        :param pulumi.Input[Mapping[str, Any]] metadata: Metadata associated with this secret read from Vault.
        :param pulumi.Input[str] mount: Path where KV-V2 engine is mounted.
        :param pulumi.Input[str] name: Full name of the secret. For a nested secret
               the name is the nested path excluding the mount and data
               prefix. For example, for a secret at `kvv2/data/foo/bar/baz`
               the name is `foo/bar/baz`.
        :param pulumi.Input[str] namespace: 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's configured [namespace](https://www.terraform.io/docs/providers/vault#namespace).
               *Available only for Vault Enterprise*.
        :param pulumi.Input[Mapping[str, Any]] options: An object that holds option settings.
        :param pulumi.Input[str] path: Full path where the KV-V2 secret will be written.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _SecretV2State.__new__(_SecretV2State)

        __props__.__dict__["cas"] = cas
        __props__.__dict__["custom_metadata"] = custom_metadata
        __props__.__dict__["data"] = data
        __props__.__dict__["data_json"] = data_json
        __props__.__dict__["delete_all_versions"] = delete_all_versions
        __props__.__dict__["disable_read"] = disable_read
        __props__.__dict__["metadata"] = metadata
        __props__.__dict__["mount"] = mount
        __props__.__dict__["name"] = name
        __props__.__dict__["namespace"] = namespace
        __props__.__dict__["options"] = options
        __props__.__dict__["path"] = path
        return SecretV2(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter
    def cas(self) -> pulumi.Output[Optional[int]]:
        """
        This flag is required if `cas_required` is set to true
        on either the secret or the engine's config. In order for a
        write operation to be successful, cas must be set to the current version
        of the secret.
        """
        return pulumi.get(self, "cas")

    @property
    @pulumi.getter(name="customMetadata")
    def custom_metadata(self) -> pulumi.Output['outputs.SecretV2CustomMetadata']:
        """
        A nested block that allows configuring metadata for the
        KV secret. Refer to the
        Configuration Options for more info.
        """
        return pulumi.get(self, "custom_metadata")

    @property
    @pulumi.getter
    def data(self) -> pulumi.Output[Mapping[str, Any]]:
        """
        A mapping whose keys are the top-level data keys returned from
        Vault and whose values are the corresponding values. This map can only
        represent string data, so any non-string values returned from Vault are
        serialized as JSON.
        """
        return pulumi.get(self, "data")

    @property
    @pulumi.getter(name="dataJson")
    def data_json(self) -> pulumi.Output[str]:
        """
        JSON-encoded string that will be
        written as the secret data at the given path.
        """
        return pulumi.get(self, "data_json")

    @property
    @pulumi.getter(name="deleteAllVersions")
    def delete_all_versions(self) -> pulumi.Output[Optional[bool]]:
        """
        If set to true, permanently deletes all
        versions for the specified key.
        """
        return pulumi.get(self, "delete_all_versions")

    @property
    @pulumi.getter(name="disableRead")
    def disable_read(self) -> pulumi.Output[Optional[bool]]:
        """
        If set to true, disables reading secret from Vault;
        note: drift won't be detected.
        """
        return pulumi.get(self, "disable_read")

    @property
    @pulumi.getter
    def metadata(self) -> pulumi.Output[Mapping[str, Any]]:
        """
        Metadata associated with this secret read from Vault.
        """
        return pulumi.get(self, "metadata")

    @property
    @pulumi.getter
    def mount(self) -> pulumi.Output[str]:
        """
        Path where KV-V2 engine is mounted.
        """
        return pulumi.get(self, "mount")

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[str]:
        """
        Full name of the secret. For a nested secret
        the name is the nested path excluding the mount and data
        prefix. For example, for a secret at `kvv2/data/foo/bar/baz`
        the name is `foo/bar/baz`.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter
    def namespace(self) -> pulumi.Output[Optional[str]]:
        """
        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's configured [namespace](https://www.terraform.io/docs/providers/vault#namespace).
        *Available only for Vault Enterprise*.
        """
        return pulumi.get(self, "namespace")

    @property
    @pulumi.getter
    def options(self) -> pulumi.Output[Optional[Mapping[str, Any]]]:
        """
        An object that holds option settings.
        """
        return pulumi.get(self, "options")

    @property
    @pulumi.getter
    def path(self) -> pulumi.Output[str]:
        """
        Full path where the KV-V2 secret will be written.
        """
        return pulumi.get(self, "path")

