Oracle Cloud Infrastructure v2.33.0 published on Thursday, May 1, 2025 by Pulumi
oci.Secrets.getSecretbundle
Explore with Pulumi AI
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/v2/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)
public static Output<GetSecretbundleResult> getSecretbundle(GetSecretbundleArgs args, InvokeOptions options)
fn::invoke:
  function: oci:Secrets/getSecretbundle:getSecretbundle
  arguments:
    # arguments dictionaryThe following arguments are supported:
- SecretId string
- The OCID of the secret.
- SecretVersion stringName 
- 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.
- SecretVersion stringName 
- 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.
- secretVersion StringName 
- 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.
- secretVersion stringName 
- 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_ strname 
- 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.
- secretVersion StringName 
- 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, string>
- Customer-provided contextual metadata for the secret.
- SecretBundle List<GetContents Secretbundle Secret Bundle Content> 
- 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.
- TimeOf stringDeletion 
- An optional property indicating when to delete the secret version, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
- TimeOf stringExpiry 
- 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.
- SecretVersion stringName 
- Stage string
- Id string
- The provider-assigned unique ID for this managed resource.
- Metadata map[string]string
- Customer-provided contextual metadata for the secret.
- SecretBundle []GetContents Secretbundle Secret Bundle Content 
- 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.
- TimeOf stringDeletion 
- An optional property indicating when to delete the secret version, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
- TimeOf stringExpiry 
- 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.
- SecretVersion stringName 
- Stage string
- id String
- The provider-assigned unique ID for this managed resource.
- metadata Map<String,String>
- Customer-provided contextual metadata for the secret.
- secretBundle List<GetContents Secretbundle Secret Bundle Content> 
- 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.
- timeOf StringDeletion 
- An optional property indicating when to delete the secret version, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
- timeOf StringExpiry 
- 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.
- secretVersion StringName 
- stage String
- id string
- The provider-assigned unique ID for this managed resource.
- metadata {[key: string]: string}
- Customer-provided contextual metadata for the secret.
- secretBundle GetContents Secretbundle Secret Bundle Content[] 
- 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.
- timeOf stringDeletion 
- An optional property indicating when to delete the secret version, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
- timeOf stringExpiry 
- 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.
- secretVersion stringName 
- stage string
- id str
- The provider-assigned unique ID for this managed resource.
- metadata Mapping[str, str]
- Customer-provided contextual metadata for the secret.
- secret_bundle_ Sequence[Getcontents Secretbundle Secret Bundle Content] 
- 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_ strdeletion 
- 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_ strexpiry 
- 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_ strname 
- stage str
- id String
- The provider-assigned unique ID for this managed resource.
- metadata Map<String>
- Customer-provided contextual metadata for the secret.
- secretBundle List<Property Map>Contents 
- 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.
- timeOf StringDeletion 
- An optional property indicating when to delete the secret version, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
- timeOf StringExpiry 
- 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.
- secretVersion StringName 
- 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 ociTerraform Provider.