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

oci.Secrets.getSecretbundle

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 Secretbundle resource in Oracle Cloud Infrastructure Secrets service.

    Gets a secret bundle that matches either the specified stage, label, or versionNumber parameter. If none of these parameters are provided, the bundle for the secret version marked as CURRENT will be returned.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testSecretbundle = oci.Secrets.getSecretbundle({
        secretId: testSecret.id,
        secretVersionName: testSecretVersion.name,
        stage: secretbundleStage,
        versionNumber: secretbundleVersionNumber,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_secretbundle = oci.Secrets.get_secretbundle(secret_id=test_secret["id"],
        secret_version_name=test_secret_version["name"],
        stage=secretbundle_stage,
        version_number=secretbundle_version_number)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/go/oci/Secrets"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := Secrets.GetSecretbundle(ctx, &secrets.GetSecretbundleArgs{
    			SecretId:          testSecret.Id,
    			SecretVersionName: pulumi.StringRef(testSecretVersion.Name),
    			Stage:             pulumi.StringRef(secretbundleStage),
    			VersionNumber:     pulumi.StringRef(secretbundleVersionNumber),
    		}, 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 testSecretbundle = Oci.Secrets.GetSecretbundle.Invoke(new()
        {
            SecretId = testSecret.Id,
            SecretVersionName = testSecretVersion.Name,
            Stage = secretbundleStage,
            VersionNumber = secretbundleVersionNumber,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.Secrets.SecretsFunctions;
    import com.pulumi.oci.Secrets.inputs.GetSecretbundleArgs;
    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 testSecretbundle = SecretsFunctions.getSecretbundle(GetSecretbundleArgs.builder()
                .secretId(testSecret.id())
                .secretVersionName(testSecretVersion.name())
                .stage(secretbundleStage)
                .versionNumber(secretbundleVersionNumber)
                .build());
    
        }
    }
    
    variables:
      testSecretbundle:
        fn::invoke:
          Function: oci:Secrets:getSecretbundle
          Arguments:
            secretId: ${testSecret.id}
            secretVersionName: ${testSecretVersion.name}
            stage: ${secretbundleStage}
            versionNumber: ${secretbundleVersionNumber}
    

    Using getSecretbundle

    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 getSecretbundle(args: GetSecretbundleArgs, opts?: InvokeOptions): Promise<GetSecretbundleResult>
    function getSecretbundleOutput(args: GetSecretbundleOutputArgs, opts?: InvokeOptions): Output<GetSecretbundleResult>
    def get_secretbundle(secret_id: Optional[str] = None,
                         secret_version_name: Optional[str] = None,
                         stage: Optional[str] = None,
                         version_number: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetSecretbundleResult
    def get_secretbundle_output(secret_id: Optional[pulumi.Input[str]] = None,
                         secret_version_name: Optional[pulumi.Input[str]] = None,
                         stage: Optional[pulumi.Input[str]] = None,
                         version_number: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetSecretbundleResult]
    func GetSecretbundle(ctx *Context, args *GetSecretbundleArgs, opts ...InvokeOption) (*GetSecretbundleResult, error)
    func GetSecretbundleOutput(ctx *Context, args *GetSecretbundleOutputArgs, opts ...InvokeOption) GetSecretbundleResultOutput

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

    public static class GetSecretbundle 
    {
        public static Task<GetSecretbundleResult> InvokeAsync(GetSecretbundleArgs args, InvokeOptions? opts = null)
        public static Output<GetSecretbundleResult> Invoke(GetSecretbundleInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSecretbundleResult> getSecretbundle(GetSecretbundleArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:Secrets/getSecretbundle:getSecretbundle
      arguments:
        # arguments dictionary

    The following arguments are supported:

    SecretId string
    The OCID of the secret.
    SecretVersionName string
    The name of the secret. (This might be referred to as the name of the secret version. Names are unique across the different versions of a secret.)
    Stage string
    The rotation state of the secret version.
    VersionNumber string
    The version number of the secret.
    SecretId string
    The OCID of the secret.
    SecretVersionName string
    The name of the secret. (This might be referred to as the name of the secret version. Names are unique across the different versions of a secret.)
    Stage string
    The rotation state of the secret version.
    VersionNumber string
    The version number of the secret.
    secretId String
    The OCID of the secret.
    secretVersionName String
    The name of the secret. (This might be referred to as the name of the secret version. Names are unique across the different versions of a secret.)
    stage String
    The rotation state of the secret version.
    versionNumber String
    The version number of the secret.
    secretId string
    The OCID of the secret.
    secretVersionName string
    The name of the secret. (This might be referred to as the name of the secret version. Names are unique across the different versions of a secret.)
    stage string
    The rotation state of the secret version.
    versionNumber string
    The version number of the secret.
    secret_id str
    The OCID of the secret.
    secret_version_name str
    The name of the secret. (This might be referred to as the name of the secret version. Names are unique across the different versions of a secret.)
    stage str
    The rotation state of the secret version.
    version_number str
    The version number of the secret.
    secretId String
    The OCID of the secret.
    secretVersionName String
    The name of the secret. (This might be referred to as the name of the secret version. Names are unique across the different versions of a secret.)
    stage String
    The rotation state of the secret version.
    versionNumber String
    The version number of the secret.

    getSecretbundle Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Metadata Dictionary<string, object>
    Customer-provided contextual metadata for the secret.
    SecretBundleContents List<GetSecretbundleSecretBundleContent>
    The contents of the secret.
    SecretId string
    The OCID of the secret.
    Stages List<string>
    A list of possible rotation states for the secret version.
    TimeCreated string
    The time when the secret bundle was created.
    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
    TimeOfExpiry string
    An optional property indicating when the secret version will expire, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    VersionName string
    The name of the secret version. Labels are unique across the different versions of a particular secret.
    VersionNumber string
    The version number of the secret.
    SecretVersionName string
    Stage string
    Id string
    The provider-assigned unique ID for this managed resource.
    Metadata map[string]interface{}
    Customer-provided contextual metadata for the secret.
    SecretBundleContents []GetSecretbundleSecretBundleContent
    The contents of the secret.
    SecretId string
    The OCID of the secret.
    Stages []string
    A list of possible rotation states for the secret version.
    TimeCreated string
    The time when the secret bundle was created.
    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
    TimeOfExpiry string
    An optional property indicating when the secret version will expire, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    VersionName string
    The name of the secret version. Labels are unique across the different versions of a particular secret.
    VersionNumber string
    The version number of the secret.
    SecretVersionName string
    Stage string
    id String
    The provider-assigned unique ID for this managed resource.
    metadata Map<String,Object>
    Customer-provided contextual metadata for the secret.
    secretBundleContents List<GetSecretbundleSecretBundleContent>
    The contents of the secret.
    secretId String
    The OCID of the secret.
    stages List<String>
    A list of possible rotation states for the secret version.
    timeCreated String
    The time when the secret bundle was created.
    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
    timeOfExpiry String
    An optional property indicating when the secret version will expire, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    versionName String
    The name of the secret version. Labels are unique across the different versions of a particular secret.
    versionNumber String
    The version number of the secret.
    secretVersionName String
    stage String
    id string
    The provider-assigned unique ID for this managed resource.
    metadata {[key: string]: any}
    Customer-provided contextual metadata for the secret.
    secretBundleContents GetSecretbundleSecretBundleContent[]
    The contents of the secret.
    secretId string
    The OCID of the secret.
    stages string[]
    A list of possible rotation states for the secret version.
    timeCreated string
    The time when the secret bundle was created.
    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
    timeOfExpiry string
    An optional property indicating when the secret version will expire, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    versionName string
    The name of the secret version. Labels are unique across the different versions of a particular secret.
    versionNumber string
    The version number of the secret.
    secretVersionName string
    stage string
    id str
    The provider-assigned unique ID for this managed resource.
    metadata Mapping[str, Any]
    Customer-provided contextual metadata for the secret.
    secret_bundle_contents Sequence[secrets.GetSecretbundleSecretBundleContent]
    The contents of the secret.
    secret_id str
    The OCID of the secret.
    stages Sequence[str]
    A list of possible rotation states for the secret version.
    time_created str
    The time when the secret bundle was created.
    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
    time_of_expiry str
    An optional property indicating when the secret version will expire, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    version_name str
    The name of the secret version. Labels are unique across the different versions of a particular secret.
    version_number str
    The version number of the secret.
    secret_version_name str
    stage str
    id String
    The provider-assigned unique ID for this managed resource.
    metadata Map<Any>
    Customer-provided contextual metadata for the secret.
    secretBundleContents List<Property Map>
    The contents of the secret.
    secretId String
    The OCID of the secret.
    stages List<String>
    A list of possible rotation states for the secret version.
    timeCreated String
    The time when the secret bundle was created.
    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
    timeOfExpiry String
    An optional property indicating when the secret version will expire, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    versionName String
    The name of the secret version. Labels are unique across the different versions of a particular secret.
    versionNumber String
    The version number of the secret.
    secretVersionName String
    stage String

    Supporting Types

    GetSecretbundleSecretBundleContent

    Content string
    The base64-encoded content of the secret.
    ContentType string
    The formatting type of the secret contents.
    Content string
    The base64-encoded content of the secret.
    ContentType string
    The formatting type of the secret contents.
    content String
    The base64-encoded content of the secret.
    contentType String
    The formatting type of the secret contents.
    content string
    The base64-encoded content of the secret.
    contentType string
    The formatting type of the secret contents.
    content str
    The base64-encoded content of the secret.
    content_type str
    The formatting type of the secret contents.
    content String
    The base64-encoded content of the secret.
    contentType String
    The formatting type of the secret contents.

    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