get Regional Secret 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")
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 main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/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
})
}
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
Return
A collection of values returned by getRegionalSecretVersion.
Parameters
A collection of arguments for invoking getRegionalSecretVersion.
Return
A collection of values returned by getRegionalSecretVersion.
Parameters
If set to 'true', the secret data is expected to be base64-encoded string.
Location of Secret Manager regional secret resource. It must be provided when the secret
field provided consists of only the name of the regional secret.
The project to get the secret version for. If it is not provided, the provider project is used.
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.
The version of the regional secret to get. If it is not provided, the latest version is retrieved.
See also
Return
A collection of values returned by getRegionalSecretVersion.
Parameters
Builder for com.pulumi.gcp.secretmanager.kotlin.inputs.GetRegionalSecretVersionPlainArgs.