Viewing docs for Google Cloud v9.14.0
published on Tuesday, Mar 3, 2026 by Pulumi
published on Tuesday, Mar 3, 2026 by Pulumi
Viewing docs for Google Cloud v9.14.0
published on Tuesday, Mar 3, 2026 by Pulumi
published on Tuesday, Mar 3, 2026 by Pulumi
subcategory: “Secret Manager” description: |- Get a Secret Manager regional secret’s version.
Get the value and metadata from a Secret Manager regional secret version. For more information see the official documentation and API. If you don’t need the metadata (i.e., if you want to use a more limited role to access the regional secret version only), see also the gcp.secretmanager.getRegionalSecretVersionAccess datasource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const basic = gcp.secretmanager.getRegionalSecretVersion({
secret: "my-secret",
location: "us-central1",
});
import pulumi
import pulumi_gcp as gcp
basic = gcp.secretmanager.get_regional_secret_version(secret="my-secret",
location="us-central1")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/secretmanager"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := secretmanager.LookupRegionalSecretVersion(ctx, &secretmanager.LookupRegionalSecretVersionArgs{
Secret: "my-secret",
Location: pulumi.StringRef("us-central1"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var basic = Gcp.SecretManager.GetRegionalSecretVersion.Invoke(new()
{
Secret = "my-secret",
Location = "us-central1",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.secretmanager.SecretmanagerFunctions;
import com.pulumi.gcp.secretmanager.inputs.GetRegionalSecretVersionArgs;
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 basic = SecretmanagerFunctions.getRegionalSecretVersion(GetRegionalSecretVersionArgs.builder()
.secret("my-secret")
.location("us-central1")
.build());
}
}
variables:
basic:
fn::invoke:
function: gcp:secretmanager:getRegionalSecretVersion
arguments:
secret: my-secret
location: us-central1
Using getRegionalSecretVersion
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 getRegionalSecretVersion(args: GetRegionalSecretVersionArgs, opts?: InvokeOptions): Promise<GetRegionalSecretVersionResult>
function getRegionalSecretVersionOutput(args: GetRegionalSecretVersionOutputArgs, opts?: InvokeOptions): Output<GetRegionalSecretVersionResult>def get_regional_secret_version(is_secret_data_base64: Optional[bool] = None,
location: Optional[str] = None,
project: Optional[str] = None,
secret: Optional[str] = None,
version: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetRegionalSecretVersionResult
def get_regional_secret_version_output(is_secret_data_base64: Optional[pulumi.Input[bool]] = None,
location: Optional[pulumi.Input[str]] = None,
project: Optional[pulumi.Input[str]] = None,
secret: Optional[pulumi.Input[str]] = None,
version: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetRegionalSecretVersionResult]func LookupRegionalSecretVersion(ctx *Context, args *LookupRegionalSecretVersionArgs, opts ...InvokeOption) (*LookupRegionalSecretVersionResult, error)
func LookupRegionalSecretVersionOutput(ctx *Context, args *LookupRegionalSecretVersionOutputArgs, opts ...InvokeOption) LookupRegionalSecretVersionResultOutput> Note: This function is named LookupRegionalSecretVersion in the Go SDK.
public static class GetRegionalSecretVersion
{
public static Task<GetRegionalSecretVersionResult> InvokeAsync(GetRegionalSecretVersionArgs args, InvokeOptions? opts = null)
public static Output<GetRegionalSecretVersionResult> Invoke(GetRegionalSecretVersionInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetRegionalSecretVersionResult> getRegionalSecretVersion(GetRegionalSecretVersionArgs args, InvokeOptions options)
public static Output<GetRegionalSecretVersionResult> getRegionalSecretVersion(GetRegionalSecretVersionArgs args, InvokeOptions options)
fn::invoke:
function: gcp:secretmanager/getRegionalSecretVersion:getRegionalSecretVersion
arguments:
# arguments dictionaryThe following arguments are supported:
- Secret string
- The regional secret to get the secret version for.
This can be either the reference of the regional secret as in
projects/{{project}}/locations/{{location}}/secrets/{{secret_id}}or only the name of the regional secret as in{{secret_id}}. If only the name of the regional secret is provided, the location must also be provided. - Is
Secret boolData Base64 - If set to 'true', the secret data is expected to be base64-encoded string.
- Location string
- Location of Secret Manager regional secret resource.
It must be provided when the
secretfield provided consists of only the name of the regional secret. - Project string
- The project to get the secret version for. If it is not provided, the provider project is used.
- Version string
- The version of the regional secret to get. If it is not provided, the latest version is retrieved.
- Secret string
- The regional secret to get the secret version for.
This can be either the reference of the regional secret as in
projects/{{project}}/locations/{{location}}/secrets/{{secret_id}}or only the name of the regional secret as in{{secret_id}}. If only the name of the regional secret is provided, the location must also be provided. - Is
Secret boolData Base64 - If set to 'true', the secret data is expected to be base64-encoded string.
- Location string
- Location of Secret Manager regional secret resource.
It must be provided when the
secretfield provided consists of only the name of the regional secret. - Project string
- The project to get the secret version for. If it is not provided, the provider project is used.
- Version string
- The version of the regional secret to get. If it is not provided, the latest version is retrieved.
- secret String
- The regional secret to get the secret version for.
This can be either the reference of the regional secret as in
projects/{{project}}/locations/{{location}}/secrets/{{secret_id}}or only the name of the regional secret as in{{secret_id}}. If only the name of the regional secret is provided, the location must also be provided. - is
Secret BooleanData Base64 - If set to 'true', the secret data is expected to be base64-encoded string.
- location String
- Location of Secret Manager regional secret resource.
It must be provided when the
secretfield provided consists of only the name of the regional secret. - project String
- The project to get the secret version for. If it is not provided, the provider project is used.
- version String
- The version of the regional secret to get. If it is not provided, the latest version is retrieved.
- secret string
- The regional secret to get the secret version for.
This can be either the reference of the regional secret as in
projects/{{project}}/locations/{{location}}/secrets/{{secret_id}}or only the name of the regional secret as in{{secret_id}}. If only the name of the regional secret is provided, the location must also be provided. - is
Secret booleanData Base64 - If set to 'true', the secret data is expected to be base64-encoded string.
- location string
- Location of Secret Manager regional secret resource.
It must be provided when the
secretfield provided consists of only the name of the regional secret. - project string
- The project to get the secret version for. If it is not provided, the provider project is used.
- version string
- The version of the regional secret to get. If it is not provided, the latest version is retrieved.
- secret str
- The regional secret to get the secret version for.
This can be either the reference of the regional secret as in
projects/{{project}}/locations/{{location}}/secrets/{{secret_id}}or only the name of the regional secret as in{{secret_id}}. If only the name of the regional secret is provided, the location must also be provided. - is_
secret_ booldata_ base64 - If set to 'true', the secret data is expected to be base64-encoded string.
- location str
- Location of Secret Manager regional secret resource.
It must be provided when the
secretfield provided consists of only the name of the regional secret. - project str
- The project to get the secret version for. If it is not provided, the provider project is used.
- version str
- The version of the regional secret to get. If it is not provided, the latest version is retrieved.
- secret String
- The regional secret to get the secret version for.
This can be either the reference of the regional secret as in
projects/{{project}}/locations/{{location}}/secrets/{{secret_id}}or only the name of the regional secret as in{{secret_id}}. If only the name of the regional secret is provided, the location must also be provided. - is
Secret BooleanData Base64 - If set to 'true', the secret data is expected to be base64-encoded string.
- location String
- Location of Secret Manager regional secret resource.
It must be provided when the
secretfield provided consists of only the name of the regional secret. - project String
- The project to get the secret version for. If it is not provided, the provider project is used.
- version String
- The version of the regional secret to get. If it is not provided, the latest version is retrieved.
getRegionalSecretVersion Result
The following output properties are available:
- Create
Time string - The time at which the regional secret was created.
- Customer
Managed List<GetEncryptions Regional Secret Version Customer Managed Encryption> - The customer-managed encryption configuration of the regional secret. Structure is documented below.
- Destroy
Time string - The time at which the regional secret was destroyed. Only present if state is DESTROYED.
- Enabled bool
- True if the current state of the regional SecretVersion is enabled.
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- Name string
- The resource name of the regional SecretVersion. Format:
projects/{{project}}/locations/{{location}}/secrets/{{secret_id}}/versions/{{version}} - Project string
- Secret string
- Secret
Data string - The secret data. No larger than 64KiB.
- Version string
- Is
Secret boolData Base64
- Create
Time string - The time at which the regional secret was created.
- Customer
Managed []GetEncryptions Regional Secret Version Customer Managed Encryption - The customer-managed encryption configuration of the regional secret. Structure is documented below.
- Destroy
Time string - The time at which the regional secret was destroyed. Only present if state is DESTROYED.
- Enabled bool
- True if the current state of the regional SecretVersion is enabled.
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- Name string
- The resource name of the regional SecretVersion. Format:
projects/{{project}}/locations/{{location}}/secrets/{{secret_id}}/versions/{{version}} - Project string
- Secret string
- Secret
Data string - The secret data. No larger than 64KiB.
- Version string
- Is
Secret boolData Base64
- create
Time String - The time at which the regional secret was created.
- customer
Managed List<GetEncryptions Regional Secret Version Customer Managed Encryption> - The customer-managed encryption configuration of the regional secret. Structure is documented below.
- destroy
Time String - The time at which the regional secret was destroyed. Only present if state is DESTROYED.
- enabled Boolean
- True if the current state of the regional SecretVersion is enabled.
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- name String
- The resource name of the regional SecretVersion. Format:
projects/{{project}}/locations/{{location}}/secrets/{{secret_id}}/versions/{{version}} - project String
- secret String
- secret
Data String - The secret data. No larger than 64KiB.
- version String
- is
Secret BooleanData Base64
- create
Time string - The time at which the regional secret was created.
- customer
Managed GetEncryptions Regional Secret Version Customer Managed Encryption[] - The customer-managed encryption configuration of the regional secret. Structure is documented below.
- destroy
Time string - The time at which the regional secret was destroyed. Only present if state is DESTROYED.
- enabled boolean
- True if the current state of the regional SecretVersion is enabled.
- id string
- The provider-assigned unique ID for this managed resource.
- location string
- name string
- The resource name of the regional SecretVersion. Format:
projects/{{project}}/locations/{{location}}/secrets/{{secret_id}}/versions/{{version}} - project string
- secret string
- secret
Data string - The secret data. No larger than 64KiB.
- version string
- is
Secret booleanData Base64
- create_
time str - The time at which the regional secret was created.
- customer_
managed_ Sequence[Getencryptions Regional Secret Version Customer Managed Encryption] - The customer-managed encryption configuration of the regional secret. Structure is documented below.
- destroy_
time str - The time at which the regional secret was destroyed. Only present if state is DESTROYED.
- enabled bool
- True if the current state of the regional SecretVersion is enabled.
- id str
- The provider-assigned unique ID for this managed resource.
- location str
- name str
- The resource name of the regional SecretVersion. Format:
projects/{{project}}/locations/{{location}}/secrets/{{secret_id}}/versions/{{version}} - project str
- secret str
- secret_
data str - The secret data. No larger than 64KiB.
- version str
- is_
secret_ booldata_ base64
- create
Time String - The time at which the regional secret was created.
- customer
Managed List<Property Map>Encryptions - The customer-managed encryption configuration of the regional secret. Structure is documented below.
- destroy
Time String - The time at which the regional secret was destroyed. Only present if state is DESTROYED.
- enabled Boolean
- True if the current state of the regional SecretVersion is enabled.
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- name String
- The resource name of the regional SecretVersion. Format:
projects/{{project}}/locations/{{location}}/secrets/{{secret_id}}/versions/{{version}} - project String
- secret String
- secret
Data String - The secret data. No larger than 64KiB.
- version String
- is
Secret BooleanData Base64
Supporting Types
GetRegionalSecretVersionCustomerManagedEncryption
- Kms
Key stringVersion Name - The resource name of the Cloud KMS CryptoKey used to encrypt secret payloads.
- Kms
Key stringVersion Name - The resource name of the Cloud KMS CryptoKey used to encrypt secret payloads.
- kms
Key StringVersion Name - The resource name of the Cloud KMS CryptoKey used to encrypt secret payloads.
- kms
Key stringVersion Name - The resource name of the Cloud KMS CryptoKey used to encrypt secret payloads.
- kms_
key_ strversion_ name - The resource name of the Cloud KMS CryptoKey used to encrypt secret payloads.
- kms
Key StringVersion Name - The resource name of the Cloud KMS CryptoKey used to encrypt secret payloads.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-betaTerraform Provider.
Viewing docs for Google Cloud v9.14.0
published on Tuesday, Mar 3, 2026 by Pulumi
published on Tuesday, Mar 3, 2026 by Pulumi
