1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. secretmanager
  5. getRegionalSecret
Google Cloud v8.25.1 published on Wednesday, Apr 9, 2025 by Pulumi

gcp.secretmanager.getRegionalSecret

Explore with Pulumi AI

Google Cloud v8.25.1 published on Wednesday, Apr 9, 2025 by Pulumi

Use this data source to get information about a Secret Manager Regional Secret

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const secretDatasource = gcp.secretmanager.getRegionalSecret({
    secretId: "secretname",
    location: "us-central1",
});
Copy
import pulumi
import pulumi_gcp as gcp

secret_datasource = gcp.secretmanager.get_regional_secret(secret_id="secretname",
    location="us-central1")
Copy
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.LookupRegionalSecret(ctx, &secretmanager.LookupRegionalSecretArgs{
			SecretId: "secretname",
			Location: "us-central1",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var secretDatasource = Gcp.SecretManager.GetRegionalSecret.Invoke(new()
    {
        SecretId = "secretname",
        Location = "us-central1",
    });

});
Copy
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.GetRegionalSecretArgs;
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 secretDatasource = SecretmanagerFunctions.getRegionalSecret(GetRegionalSecretArgs.builder()
            .secretId("secretname")
            .location("us-central1")
            .build());

    }
}
Copy
variables:
  secretDatasource:
    fn::invoke:
      function: gcp:secretmanager:getRegionalSecret
      arguments:
        secretId: secretname
        location: us-central1
Copy

Using getRegionalSecret

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 getRegionalSecret(args: GetRegionalSecretArgs, opts?: InvokeOptions): Promise<GetRegionalSecretResult>
function getRegionalSecretOutput(args: GetRegionalSecretOutputArgs, opts?: InvokeOptions): Output<GetRegionalSecretResult>
Copy
def get_regional_secret(location: Optional[str] = None,
                        project: Optional[str] = None,
                        secret_id: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetRegionalSecretResult
def get_regional_secret_output(location: Optional[pulumi.Input[str]] = None,
                        project: Optional[pulumi.Input[str]] = None,
                        secret_id: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetRegionalSecretResult]
Copy
func LookupRegionalSecret(ctx *Context, args *LookupRegionalSecretArgs, opts ...InvokeOption) (*LookupRegionalSecretResult, error)
func LookupRegionalSecretOutput(ctx *Context, args *LookupRegionalSecretOutputArgs, opts ...InvokeOption) LookupRegionalSecretResultOutput
Copy

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

public static class GetRegionalSecret 
{
    public static Task<GetRegionalSecretResult> InvokeAsync(GetRegionalSecretArgs args, InvokeOptions? opts = null)
    public static Output<GetRegionalSecretResult> Invoke(GetRegionalSecretInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetRegionalSecretResult> getRegionalSecret(GetRegionalSecretArgs args, InvokeOptions options)
public static Output<GetRegionalSecretResult> getRegionalSecret(GetRegionalSecretArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gcp:secretmanager/getRegionalSecret:getRegionalSecret
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Location This property is required. string
The location of the regional secret. eg us-central1
SecretId This property is required. string
The name of the regional secret.
Project string
The ID of the project in which the resource belongs.
Location This property is required. string
The location of the regional secret. eg us-central1
SecretId This property is required. string
The name of the regional secret.
Project string
The ID of the project in which the resource belongs.
location This property is required. String
The location of the regional secret. eg us-central1
secretId This property is required. String
The name of the regional secret.
project String
The ID of the project in which the resource belongs.
location This property is required. string
The location of the regional secret. eg us-central1
secretId This property is required. string
The name of the regional secret.
project string
The ID of the project in which the resource belongs.
location This property is required. str
The location of the regional secret. eg us-central1
secret_id This property is required. str
The name of the regional secret.
project str
The ID of the project in which the resource belongs.
location This property is required. String
The location of the regional secret. eg us-central1
secretId This property is required. String
The name of the regional secret.
project String
The ID of the project in which the resource belongs.

getRegionalSecret Result

The following output properties are available:

Annotations Dictionary<string, string>
CreateTime string
CustomerManagedEncryptions List<GetRegionalSecretCustomerManagedEncryption>
EffectiveAnnotations Dictionary<string, string>
EffectiveLabels Dictionary<string, string>
ExpireTime string
Id string
The provider-assigned unique ID for this managed resource.
Labels Dictionary<string, string>
Location string
Name string
PulumiLabels Dictionary<string, string>
Rotations List<GetRegionalSecretRotation>
SecretId string
Topics List<GetRegionalSecretTopic>
Ttl string
VersionAliases Dictionary<string, string>
VersionDestroyTtl string
Project string
Annotations map[string]string
CreateTime string
CustomerManagedEncryptions []GetRegionalSecretCustomerManagedEncryption
EffectiveAnnotations map[string]string
EffectiveLabels map[string]string
ExpireTime string
Id string
The provider-assigned unique ID for this managed resource.
Labels map[string]string
Location string
Name string
PulumiLabels map[string]string
Rotations []GetRegionalSecretRotation
SecretId string
Topics []GetRegionalSecretTopic
Ttl string
VersionAliases map[string]string
VersionDestroyTtl string
Project string
annotations Map<String,String>
createTime String
customerManagedEncryptions List<GetRegionalSecretCustomerManagedEncryption>
effectiveAnnotations Map<String,String>
effectiveLabels Map<String,String>
expireTime String
id String
The provider-assigned unique ID for this managed resource.
labels Map<String,String>
location String
name String
pulumiLabels Map<String,String>
rotations List<GetRegionalSecretRotation>
secretId String
topics List<GetRegionalSecretTopic>
ttl String
versionAliases Map<String,String>
versionDestroyTtl String
project String
annotations {[key: string]: string}
createTime string
customerManagedEncryptions GetRegionalSecretCustomerManagedEncryption[]
effectiveAnnotations {[key: string]: string}
effectiveLabels {[key: string]: string}
expireTime string
id string
The provider-assigned unique ID for this managed resource.
labels {[key: string]: string}
location string
name string
pulumiLabels {[key: string]: string}
rotations GetRegionalSecretRotation[]
secretId string
topics GetRegionalSecretTopic[]
ttl string
versionAliases {[key: string]: string}
versionDestroyTtl string
project string
annotations Map<String>
createTime String
customerManagedEncryptions List<Property Map>
effectiveAnnotations Map<String>
effectiveLabels Map<String>
expireTime String
id String
The provider-assigned unique ID for this managed resource.
labels Map<String>
location String
name String
pulumiLabels Map<String>
rotations List<Property Map>
secretId String
topics List<Property Map>
ttl String
versionAliases Map<String>
versionDestroyTtl String
project String

Supporting Types

GetRegionalSecretCustomerManagedEncryption

KmsKeyName This property is required. string
The resource name of the Cloud KMS CryptoKey used to encrypt secret payloads.
KmsKeyName This property is required. string
The resource name of the Cloud KMS CryptoKey used to encrypt secret payloads.
kmsKeyName This property is required. String
The resource name of the Cloud KMS CryptoKey used to encrypt secret payloads.
kmsKeyName This property is required. string
The resource name of the Cloud KMS CryptoKey used to encrypt secret payloads.
kms_key_name This property is required. str
The resource name of the Cloud KMS CryptoKey used to encrypt secret payloads.
kmsKeyName This property is required. String
The resource name of the Cloud KMS CryptoKey used to encrypt secret payloads.

GetRegionalSecretRotation

NextRotationTime This property is required. string
Timestamp in UTC at which the Secret is scheduled to rotate. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
RotationPeriod This property is required. string
The Duration between rotation notifications. Must be in seconds and at least 3600s (1h) and at most 3153600000s (100 years). If rotationPeriod is set, 'next_rotation_time' must be set. 'next_rotation_time' will be advanced by this period when the service automatically sends rotation notifications.
NextRotationTime This property is required. string
Timestamp in UTC at which the Secret is scheduled to rotate. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
RotationPeriod This property is required. string
The Duration between rotation notifications. Must be in seconds and at least 3600s (1h) and at most 3153600000s (100 years). If rotationPeriod is set, 'next_rotation_time' must be set. 'next_rotation_time' will be advanced by this period when the service automatically sends rotation notifications.
nextRotationTime This property is required. String
Timestamp in UTC at which the Secret is scheduled to rotate. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
rotationPeriod This property is required. String
The Duration between rotation notifications. Must be in seconds and at least 3600s (1h) and at most 3153600000s (100 years). If rotationPeriod is set, 'next_rotation_time' must be set. 'next_rotation_time' will be advanced by this period when the service automatically sends rotation notifications.
nextRotationTime This property is required. string
Timestamp in UTC at which the Secret is scheduled to rotate. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
rotationPeriod This property is required. string
The Duration between rotation notifications. Must be in seconds and at least 3600s (1h) and at most 3153600000s (100 years). If rotationPeriod is set, 'next_rotation_time' must be set. 'next_rotation_time' will be advanced by this period when the service automatically sends rotation notifications.
next_rotation_time This property is required. str
Timestamp in UTC at which the Secret is scheduled to rotate. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
rotation_period This property is required. str
The Duration between rotation notifications. Must be in seconds and at least 3600s (1h) and at most 3153600000s (100 years). If rotationPeriod is set, 'next_rotation_time' must be set. 'next_rotation_time' will be advanced by this period when the service automatically sends rotation notifications.
nextRotationTime This property is required. String
Timestamp in UTC at which the Secret is scheduled to rotate. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
rotationPeriod This property is required. String
The Duration between rotation notifications. Must be in seconds and at least 3600s (1h) and at most 3153600000s (100 years). If rotationPeriod is set, 'next_rotation_time' must be set. 'next_rotation_time' will be advanced by this period when the service automatically sends rotation notifications.

GetRegionalSecretTopic

Name This property is required. string
The resource name of the Pub/Sub topic that will be published to, in the following format: projects//topics/. For publication to succeed, the Secret Manager Service Agent service account must have pubsub.publisher permissions on the topic.
Name This property is required. string
The resource name of the Pub/Sub topic that will be published to, in the following format: projects//topics/. For publication to succeed, the Secret Manager Service Agent service account must have pubsub.publisher permissions on the topic.
name This property is required. String
The resource name of the Pub/Sub topic that will be published to, in the following format: projects//topics/. For publication to succeed, the Secret Manager Service Agent service account must have pubsub.publisher permissions on the topic.
name This property is required. string
The resource name of the Pub/Sub topic that will be published to, in the following format: projects//topics/. For publication to succeed, the Secret Manager Service Agent service account must have pubsub.publisher permissions on the topic.
name This property is required. str
The resource name of the Pub/Sub topic that will be published to, in the following format: projects//topics/. For publication to succeed, the Secret Manager Service Agent service account must have pubsub.publisher permissions on the topic.
name This property is required. String
The resource name of the Pub/Sub topic that will be published to, in the following format: projects//topics/. For publication to succeed, the Secret Manager Service Agent service account must have pubsub.publisher permissions on the topic.

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.
Google Cloud v8.25.1 published on Wednesday, Apr 9, 2025 by Pulumi