1. Packages
  2. HashiCorp Vault
  3. API Docs
  4. kv
  5. getSecretV2
HashiCorp Vault v5.20.0 published on Tuesday, Feb 20, 2024 by Pulumi

vault.kv.getSecretV2

Explore with Pulumi AI

vault logo
HashiCorp Vault v5.20.0 published on Tuesday, Feb 20, 2024 by Pulumi

    Required Vault Capabilities

    Use of this resource requires the read capability on the given path.

    Using getSecretV2

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getSecretV2(args: GetSecretV2Args, opts?: InvokeOptions): Promise<GetSecretV2Result>
    function getSecretV2Output(args: GetSecretV2OutputArgs, opts?: InvokeOptions): Output<GetSecretV2Result>
    def get_secret_v2(mount: Optional[str] = None,
                      name: Optional[str] = None,
                      namespace: Optional[str] = None,
                      version: Optional[int] = None,
                      opts: Optional[InvokeOptions] = None) -> GetSecretV2Result
    def get_secret_v2_output(mount: Optional[pulumi.Input[str]] = None,
                      name: Optional[pulumi.Input[str]] = None,
                      namespace: Optional[pulumi.Input[str]] = None,
                      version: Optional[pulumi.Input[int]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetSecretV2Result]
    func LookupSecretV2(ctx *Context, args *LookupSecretV2Args, opts ...InvokeOption) (*LookupSecretV2Result, error)
    func LookupSecretV2Output(ctx *Context, args *LookupSecretV2OutputArgs, opts ...InvokeOption) LookupSecretV2ResultOutput

    > Note: This function is named LookupSecretV2 in the Go SDK.

    public static class GetSecretV2 
    {
        public static Task<GetSecretV2Result> InvokeAsync(GetSecretV2Args args, InvokeOptions? opts = null)
        public static Output<GetSecretV2Result> Invoke(GetSecretV2InvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSecretV2Result> getSecretV2(GetSecretV2Args args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: vault:kv/getSecretV2:getSecretV2
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Mount string
    Path where KV-V2 engine is mounted.
    Name string
    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.
    Namespace string
    The namespace of the target resource. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    Version int
    Version of the secret to retrieve.
    Mount string
    Path where KV-V2 engine is mounted.
    Name string
    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.
    Namespace string
    The namespace of the target resource. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    Version int
    Version of the secret to retrieve.
    mount String
    Path where KV-V2 engine is mounted.
    name String
    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.
    namespace String
    The namespace of the target resource. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    version Integer
    Version of the secret to retrieve.
    mount string
    Path where KV-V2 engine is mounted.
    name string
    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.
    namespace string
    The namespace of the target resource. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    version number
    Version of the secret to retrieve.
    mount str
    Path where KV-V2 engine is mounted.
    name 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.
    namespace str
    The namespace of the target resource. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    version int
    Version of the secret to retrieve.
    mount String
    Path where KV-V2 engine is mounted.
    name String
    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.
    namespace String
    The namespace of the target resource. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    version Number
    Version of the secret to retrieve.

    getSecretV2 Result

    The following output properties are available:

    CreatedTime string
    Time at which secret was created.
    CustomMetadata Dictionary<string, object>
    Custom metadata for the secret.
    Data Dictionary<string, object>
    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.
    DataJson string
    JSON-encoded string that that is read as the secret data at the given path.
    DeletionTime string
    Deletion time for the secret.
    Destroyed bool
    Indicates whether the secret has been destroyed.
    Id string
    The provider-assigned unique ID for this managed resource.
    Mount string
    Name string
    Path string
    Full path where the KVV2 secret is written.
    Namespace string
    Version int
    CreatedTime string
    Time at which secret was created.
    CustomMetadata map[string]interface{}
    Custom metadata for the secret.
    Data map[string]interface{}
    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.
    DataJson string
    JSON-encoded string that that is read as the secret data at the given path.
    DeletionTime string
    Deletion time for the secret.
    Destroyed bool
    Indicates whether the secret has been destroyed.
    Id string
    The provider-assigned unique ID for this managed resource.
    Mount string
    Name string
    Path string
    Full path where the KVV2 secret is written.
    Namespace string
    Version int
    createdTime String
    Time at which secret was created.
    customMetadata Map<String,Object>
    Custom metadata for the secret.
    data Map<String,Object>
    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.
    dataJson String
    JSON-encoded string that that is read as the secret data at the given path.
    deletionTime String
    Deletion time for the secret.
    destroyed Boolean
    Indicates whether the secret has been destroyed.
    id String
    The provider-assigned unique ID for this managed resource.
    mount String
    name String
    path String
    Full path where the KVV2 secret is written.
    namespace String
    version Integer
    createdTime string
    Time at which secret was created.
    customMetadata {[key: string]: any}
    Custom metadata for the secret.
    data {[key: string]: 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.
    dataJson string
    JSON-encoded string that that is read as the secret data at the given path.
    deletionTime string
    Deletion time for the secret.
    destroyed boolean
    Indicates whether the secret has been destroyed.
    id string
    The provider-assigned unique ID for this managed resource.
    mount string
    name string
    path string
    Full path where the KVV2 secret is written.
    namespace string
    version number
    created_time str
    Time at which secret was created.
    custom_metadata Mapping[str, Any]
    Custom metadata for the secret.
    data 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.
    data_json str
    JSON-encoded string that that is read as the secret data at the given path.
    deletion_time str
    Deletion time for the secret.
    destroyed bool
    Indicates whether the secret has been destroyed.
    id str
    The provider-assigned unique ID for this managed resource.
    mount str
    name str
    path str
    Full path where the KVV2 secret is written.
    namespace str
    version int
    createdTime String
    Time at which secret was created.
    customMetadata Map<Any>
    Custom metadata for the secret.
    data Map<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.
    dataJson String
    JSON-encoded string that that is read as the secret data at the given path.
    deletionTime String
    Deletion time for the secret.
    destroyed Boolean
    Indicates whether the secret has been destroyed.
    id String
    The provider-assigned unique ID for this managed resource.
    mount String
    name String
    path String
    Full path where the KVV2 secret is written.
    namespace String
    version Number

    Package Details

    Repository
    Vault pulumi/pulumi-vault
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the vault Terraform Provider.
    vault logo
    HashiCorp Vault v5.20.0 published on Tuesday, Feb 20, 2024 by Pulumi