1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Vault
  5. getSecretVersion
Oracle Cloud Infrastructure v1.41.0 published on Wednesday, Jun 19, 2024 by Pulumi

oci.Vault.getSecretVersion

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.41.0 published on Wednesday, Jun 19, 2024 by Pulumi

    This data source provides details about a specific Secret Version resource in Oracle Cloud Infrastructure Vault service.

    Gets information about the specified version of a secret.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testSecretVersion = oci.Vault.getSecretVersion({
        secretId: testSecret.id,
        secretVersionNumber: secretVersionSecretVersionNumber,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_secret_version = oci.Vault.get_secret_version(secret_id=test_secret["id"],
        secret_version_number=secret_version_secret_version_number)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/go/oci/Vault"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := Vault.GetSecretVersion(ctx, &vault.GetSecretVersionArgs{
    			SecretId:            testSecret.Id,
    			SecretVersionNumber: secretVersionSecretVersionNumber,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testSecretVersion = Oci.Vault.GetSecretVersion.Invoke(new()
        {
            SecretId = testSecret.Id,
            SecretVersionNumber = secretVersionSecretVersionNumber,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.Vault.VaultFunctions;
    import com.pulumi.oci.Vault.inputs.GetSecretVersionArgs;
    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) {
            final var testSecretVersion = VaultFunctions.getSecretVersion(GetSecretVersionArgs.builder()
                .secretId(testSecret.id())
                .secretVersionNumber(secretVersionSecretVersionNumber)
                .build());
    
        }
    }
    
    variables:
      testSecretVersion:
        fn::invoke:
          Function: oci:Vault:getSecretVersion
          Arguments:
            secretId: ${testSecret.id}
            secretVersionNumber: ${secretVersionSecretVersionNumber}
    

    Using getSecretVersion

    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 getSecretVersion(args: GetSecretVersionArgs, opts?: InvokeOptions): Promise<GetSecretVersionResult>
    function getSecretVersionOutput(args: GetSecretVersionOutputArgs, opts?: InvokeOptions): Output<GetSecretVersionResult>
    def get_secret_version(secret_id: Optional[str] = None,
                           secret_version_number: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetSecretVersionResult
    def get_secret_version_output(secret_id: Optional[pulumi.Input[str]] = None,
                           secret_version_number: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetSecretVersionResult]
    func GetSecretVersion(ctx *Context, args *GetSecretVersionArgs, opts ...InvokeOption) (*GetSecretVersionResult, error)
    func GetSecretVersionOutput(ctx *Context, args *GetSecretVersionOutputArgs, opts ...InvokeOption) GetSecretVersionResultOutput

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

    public static class GetSecretVersion 
    {
        public static Task<GetSecretVersionResult> InvokeAsync(GetSecretVersionArgs args, InvokeOptions? opts = null)
        public static Output<GetSecretVersionResult> Invoke(GetSecretVersionInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSecretVersionResult> getSecretVersion(GetSecretVersionArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:Vault/getSecretVersion:getSecretVersion
      arguments:
        # arguments dictionary

    The following arguments are supported:

    SecretId string
    The OCID of the secret.
    SecretVersionNumber string
    The version number of the secret.
    SecretId string
    The OCID of the secret.
    SecretVersionNumber string
    The version number of the secret.
    secretId String
    The OCID of the secret.
    secretVersionNumber String
    The version number of the secret.
    secretId string
    The OCID of the secret.
    secretVersionNumber string
    The version number of the secret.
    secret_id str
    The OCID of the secret.
    secret_version_number str
    The version number of the secret.
    secretId String
    The OCID of the secret.
    secretVersionNumber String
    The version number of the secret.

    getSecretVersion Result

    The following output properties are available:

    ContentType string
    The content type of the secret version's secret contents.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the secret version. A name is unique across versions of a secret.
    SecretId string
    The OCID of the secret.
    SecretVersionNumber string
    Stages List<string>
    A list of possible rotation states for the secret version. A secret version marked CURRENT is currently in use. A secret version marked PENDING is staged and available for use, but has not been applied on the target system and, therefore, has not been rotated into current, active use. The secret most recently uploaded to a vault is always marked LATEST. (The first version of a secret is always marked as both CURRENT and LATEST.) A secret version marked PREVIOUS is the secret version that was most recently marked CURRENT, before the last secret version rotation. A secret version marked DEPRECATED is neither current, pending, nor the previous one in use. Only secret versions marked DEPRECATED can be scheduled for deletion.
    TimeCreated string
    A optional property indicating when the secret version was created, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    TimeOfCurrentVersionExpiry string
    An optional property indicating when the current secret version will expire, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    TimeOfDeletion string
    An optional property indicating when to delete the secret version, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    VersionNumber string
    The version number of the secret.
    ContentType string
    The content type of the secret version's secret contents.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the secret version. A name is unique across versions of a secret.
    SecretId string
    The OCID of the secret.
    SecretVersionNumber string
    Stages []string
    A list of possible rotation states for the secret version. A secret version marked CURRENT is currently in use. A secret version marked PENDING is staged and available for use, but has not been applied on the target system and, therefore, has not been rotated into current, active use. The secret most recently uploaded to a vault is always marked LATEST. (The first version of a secret is always marked as both CURRENT and LATEST.) A secret version marked PREVIOUS is the secret version that was most recently marked CURRENT, before the last secret version rotation. A secret version marked DEPRECATED is neither current, pending, nor the previous one in use. Only secret versions marked DEPRECATED can be scheduled for deletion.
    TimeCreated string
    A optional property indicating when the secret version was created, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    TimeOfCurrentVersionExpiry string
    An optional property indicating when the current secret version will expire, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    TimeOfDeletion string
    An optional property indicating when to delete the secret version, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    VersionNumber string
    The version number of the secret.
    contentType String
    The content type of the secret version's secret contents.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the secret version. A name is unique across versions of a secret.
    secretId String
    The OCID of the secret.
    secretVersionNumber String
    stages List<String>
    A list of possible rotation states for the secret version. A secret version marked CURRENT is currently in use. A secret version marked PENDING is staged and available for use, but has not been applied on the target system and, therefore, has not been rotated into current, active use. The secret most recently uploaded to a vault is always marked LATEST. (The first version of a secret is always marked as both CURRENT and LATEST.) A secret version marked PREVIOUS is the secret version that was most recently marked CURRENT, before the last secret version rotation. A secret version marked DEPRECATED is neither current, pending, nor the previous one in use. Only secret versions marked DEPRECATED can be scheduled for deletion.
    timeCreated String
    A optional property indicating when the secret version was created, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    timeOfCurrentVersionExpiry String
    An optional property indicating when the current secret version will expire, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    timeOfDeletion String
    An optional property indicating when to delete the secret version, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    versionNumber String
    The version number of the secret.
    contentType string
    The content type of the secret version's secret contents.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The name of the secret version. A name is unique across versions of a secret.
    secretId string
    The OCID of the secret.
    secretVersionNumber string
    stages string[]
    A list of possible rotation states for the secret version. A secret version marked CURRENT is currently in use. A secret version marked PENDING is staged and available for use, but has not been applied on the target system and, therefore, has not been rotated into current, active use. The secret most recently uploaded to a vault is always marked LATEST. (The first version of a secret is always marked as both CURRENT and LATEST.) A secret version marked PREVIOUS is the secret version that was most recently marked CURRENT, before the last secret version rotation. A secret version marked DEPRECATED is neither current, pending, nor the previous one in use. Only secret versions marked DEPRECATED can be scheduled for deletion.
    timeCreated string
    A optional property indicating when the secret version was created, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    timeOfCurrentVersionExpiry string
    An optional property indicating when the current secret version will expire, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    timeOfDeletion string
    An optional property indicating when to delete the secret version, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    versionNumber string
    The version number of the secret.
    content_type str
    The content type of the secret version's secret contents.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The name of the secret version. A name is unique across versions of a secret.
    secret_id str
    The OCID of the secret.
    secret_version_number str
    stages Sequence[str]
    A list of possible rotation states for the secret version. A secret version marked CURRENT is currently in use. A secret version marked PENDING is staged and available for use, but has not been applied on the target system and, therefore, has not been rotated into current, active use. The secret most recently uploaded to a vault is always marked LATEST. (The first version of a secret is always marked as both CURRENT and LATEST.) A secret version marked PREVIOUS is the secret version that was most recently marked CURRENT, before the last secret version rotation. A secret version marked DEPRECATED is neither current, pending, nor the previous one in use. Only secret versions marked DEPRECATED can be scheduled for deletion.
    time_created str
    A optional property indicating when the secret version was created, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    time_of_current_version_expiry str
    An optional property indicating when the current secret version will expire, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    time_of_deletion str
    An optional property indicating when to delete the secret version, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    version_number str
    The version number of the secret.
    contentType String
    The content type of the secret version's secret contents.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the secret version. A name is unique across versions of a secret.
    secretId String
    The OCID of the secret.
    secretVersionNumber String
    stages List<String>
    A list of possible rotation states for the secret version. A secret version marked CURRENT is currently in use. A secret version marked PENDING is staged and available for use, but has not been applied on the target system and, therefore, has not been rotated into current, active use. The secret most recently uploaded to a vault is always marked LATEST. (The first version of a secret is always marked as both CURRENT and LATEST.) A secret version marked PREVIOUS is the secret version that was most recently marked CURRENT, before the last secret version rotation. A secret version marked DEPRECATED is neither current, pending, nor the previous one in use. Only secret versions marked DEPRECATED can be scheduled for deletion.
    timeCreated String
    A optional property indicating when the secret version was created, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    timeOfCurrentVersionExpiry String
    An optional property indicating when the current secret version will expire, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    timeOfDeletion String
    An optional property indicating when to delete the secret version, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    versionNumber String
    The version number of the secret.

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v1.41.0 published on Wednesday, Jun 19, 2024 by Pulumi