Google Cloud v8.23.0 published on Monday, Mar 24, 2025 by Pulumi
gcp.secretmanager.getSecrets
Explore with Pulumi AI
Use this data source to list the Secret Manager Secrets
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const secrets = gcp.secretmanager.getSecrets({});
import pulumi
import pulumi_gcp as gcp
secrets = gcp.secretmanager.get_secrets()
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.GetSecrets(ctx, &secretmanager.GetSecretsArgs{}, 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 secrets = Gcp.SecretManager.GetSecrets.Invoke();
});
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.GetSecretsArgs;
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 secrets = SecretmanagerFunctions.getSecrets();
}
}
variables:
secrets:
fn::invoke:
function: gcp:secretmanager:getSecrets
arguments: {}
Using getSecrets
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 getSecrets(args: GetSecretsArgs, opts?: InvokeOptions): Promise<GetSecretsResult>
function getSecretsOutput(args: GetSecretsOutputArgs, opts?: InvokeOptions): Output<GetSecretsResult>
def get_secrets(filter: Optional[str] = None,
project: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetSecretsResult
def get_secrets_output(filter: Optional[pulumi.Input[str]] = None,
project: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetSecretsResult]
func GetSecrets(ctx *Context, args *GetSecretsArgs, opts ...InvokeOption) (*GetSecretsResult, error)
func GetSecretsOutput(ctx *Context, args *GetSecretsOutputArgs, opts ...InvokeOption) GetSecretsResultOutput
> Note: This function is named GetSecrets
in the Go SDK.
public static class GetSecrets
{
public static Task<GetSecretsResult> InvokeAsync(GetSecretsArgs args, InvokeOptions? opts = null)
public static Output<GetSecretsResult> Invoke(GetSecretsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetSecretsResult> getSecrets(GetSecretsArgs args, InvokeOptions options)
public static Output<GetSecretsResult> getSecrets(GetSecretsArgs args, InvokeOptions options)
fn::invoke:
function: gcp:secretmanager/getSecrets:getSecrets
arguments:
# arguments dictionary
The following arguments are supported:
- Filter string
- Filter string, adhering to the rules in List-operation filtering. List only secrets matching the filter. If filter is empty, all secrets are listed.
- Project string
- The ID of the project.
- Filter string
- Filter string, adhering to the rules in List-operation filtering. List only secrets matching the filter. If filter is empty, all secrets are listed.
- Project string
- The ID of the project.
- filter String
- Filter string, adhering to the rules in List-operation filtering. List only secrets matching the filter. If filter is empty, all secrets are listed.
- project String
- The ID of the project.
- filter string
- Filter string, adhering to the rules in List-operation filtering. List only secrets matching the filter. If filter is empty, all secrets are listed.
- project string
- The ID of the project.
- filter str
- Filter string, adhering to the rules in List-operation filtering. List only secrets matching the filter. If filter is empty, all secrets are listed.
- project str
- The ID of the project.
- filter String
- Filter string, adhering to the rules in List-operation filtering. List only secrets matching the filter. If filter is empty, all secrets are listed.
- project String
- The ID of the project.
getSecrets Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Project string
- The ID of the project in which the resource belongs.
- Secrets
List<Get
Secrets Secret> - A list of secrets matching the filter. Structure is defined below.
- Filter string
- Id string
- The provider-assigned unique ID for this managed resource.
- Project string
- The ID of the project in which the resource belongs.
- Secrets
[]Get
Secrets Secret - A list of secrets matching the filter. Structure is defined below.
- Filter string
- id String
- The provider-assigned unique ID for this managed resource.
- project String
- The ID of the project in which the resource belongs.
- secrets
List<Get
Secrets Secret> - A list of secrets matching the filter. Structure is defined below.
- filter String
- id string
- The provider-assigned unique ID for this managed resource.
- project string
- The ID of the project in which the resource belongs.
- secrets
Get
Secrets Secret[] - A list of secrets matching the filter. Structure is defined below.
- filter string
- id str
- The provider-assigned unique ID for this managed resource.
- project str
- The ID of the project in which the resource belongs.
- secrets
Sequence[Get
Secrets Secret] - A list of secrets matching the filter. Structure is defined below.
- filter str
- id String
- The provider-assigned unique ID for this managed resource.
- project String
- The ID of the project in which the resource belongs.
- secrets List<Property Map>
- A list of secrets matching the filter. Structure is defined below.
- filter String
Supporting Types
GetSecretsSecret
- Annotations
This property is required. Dictionary<string, string> - Custom metadata about the secret.
- Create
Time This property is required. string - The time at which the Secret was created.
- Effective
Annotations This property is required. Dictionary<string, string> - Effective
Labels This property is required. Dictionary<string, string> - Expire
Time This property is required. string - Timestamp in UTC when the Secret is scheduled to expire.
- Labels
This property is required. Dictionary<string, string> - The labels assigned to this Secret.
- Name
This property is required. string - The resource name of the Pub/Sub topic that will be published to.
- Project
This property is required. string - The ID of the project.
- Pulumi
Labels This property is required. Dictionary<string, string> - The combination of labels configured directly on the resource and default labels configured on the provider.
- Replications
This property is required. List<GetSecrets Secret Replication> - The replication policy of the secret data attached to the Secret. Structure is documented below.
- Rotations
This property is required. List<GetSecrets Secret Rotation> - The rotation time and period for a Secret. Structure is documented below.
- Secret
Id This property is required. string - This must be unique within the project.
- Topics
This property is required. List<GetSecrets Secret Topic> - A list of up to 10 Pub/Sub topics to which messages are published when control plane operations are called on the secret or its versions. Structure is documented below.
- Ttl
This property is required. string - The TTL for the Secret. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s". Only one of 'ttl' or 'expire_time' can be provided.
- Version
Aliases This property is required. Dictionary<string, string> - Mapping from version alias to version name.
- Version
Destroy Ttl This property is required. string - The version destroy ttl for the secret version.
- Annotations
This property is required. map[string]string - Custom metadata about the secret.
- Create
Time This property is required. string - The time at which the Secret was created.
- Effective
Annotations This property is required. map[string]string - Effective
Labels This property is required. map[string]string - Expire
Time This property is required. string - Timestamp in UTC when the Secret is scheduled to expire.
- Labels
This property is required. map[string]string - The labels assigned to this Secret.
- Name
This property is required. string - The resource name of the Pub/Sub topic that will be published to.
- Project
This property is required. string - The ID of the project.
- Pulumi
Labels This property is required. map[string]string - The combination of labels configured directly on the resource and default labels configured on the provider.
- Replications
This property is required. []GetSecrets Secret Replication - The replication policy of the secret data attached to the Secret. Structure is documented below.
- Rotations
This property is required. []GetSecrets Secret Rotation - The rotation time and period for a Secret. Structure is documented below.
- Secret
Id This property is required. string - This must be unique within the project.
- Topics
This property is required. []GetSecrets Secret Topic - A list of up to 10 Pub/Sub topics to which messages are published when control plane operations are called on the secret or its versions. Structure is documented below.
- Ttl
This property is required. string - The TTL for the Secret. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s". Only one of 'ttl' or 'expire_time' can be provided.
- Version
Aliases This property is required. map[string]string - Mapping from version alias to version name.
- Version
Destroy Ttl This property is required. string - The version destroy ttl for the secret version.
- annotations
This property is required. Map<String,String> - Custom metadata about the secret.
- create
Time This property is required. String - The time at which the Secret was created.
- effective
Annotations This property is required. Map<String,String> - effective
Labels This property is required. Map<String,String> - expire
Time This property is required. String - Timestamp in UTC when the Secret is scheduled to expire.
- labels
This property is required. Map<String,String> - The labels assigned to this Secret.
- name
This property is required. String - The resource name of the Pub/Sub topic that will be published to.
- project
This property is required. String - The ID of the project.
- pulumi
Labels This property is required. Map<String,String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- replications
This property is required. List<GetSecrets Secret Replication> - The replication policy of the secret data attached to the Secret. Structure is documented below.
- rotations
This property is required. List<GetSecrets Secret Rotation> - The rotation time and period for a Secret. Structure is documented below.
- secret
Id This property is required. String - This must be unique within the project.
- topics
This property is required. List<GetSecrets Secret Topic> - A list of up to 10 Pub/Sub topics to which messages are published when control plane operations are called on the secret or its versions. Structure is documented below.
- ttl
This property is required. String - The TTL for the Secret. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s". Only one of 'ttl' or 'expire_time' can be provided.
- version
Aliases This property is required. Map<String,String> - Mapping from version alias to version name.
- version
Destroy Ttl This property is required. String - The version destroy ttl for the secret version.
- annotations
This property is required. {[key: string]: string} - Custom metadata about the secret.
- create
Time This property is required. string - The time at which the Secret was created.
- effective
Annotations This property is required. {[key: string]: string} - effective
Labels This property is required. {[key: string]: string} - expire
Time This property is required. string - Timestamp in UTC when the Secret is scheduled to expire.
- labels
This property is required. {[key: string]: string} - The labels assigned to this Secret.
- name
This property is required. string - The resource name of the Pub/Sub topic that will be published to.
- project
This property is required. string - The ID of the project.
- pulumi
Labels This property is required. {[key: string]: string} - The combination of labels configured directly on the resource and default labels configured on the provider.
- replications
This property is required. GetSecrets Secret Replication[] - The replication policy of the secret data attached to the Secret. Structure is documented below.
- rotations
This property is required. GetSecrets Secret Rotation[] - The rotation time and period for a Secret. Structure is documented below.
- secret
Id This property is required. string - This must be unique within the project.
- topics
This property is required. GetSecrets Secret Topic[] - A list of up to 10 Pub/Sub topics to which messages are published when control plane operations are called on the secret or its versions. Structure is documented below.
- ttl
This property is required. string - The TTL for the Secret. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s". Only one of 'ttl' or 'expire_time' can be provided.
- version
Aliases This property is required. {[key: string]: string} - Mapping from version alias to version name.
- version
Destroy Ttl This property is required. string - The version destroy ttl for the secret version.
- annotations
This property is required. Mapping[str, str] - Custom metadata about the secret.
- create_
time This property is required. str - The time at which the Secret was created.
- effective_
annotations This property is required. Mapping[str, str] - effective_
labels This property is required. Mapping[str, str] - expire_
time This property is required. str - Timestamp in UTC when the Secret is scheduled to expire.
- labels
This property is required. Mapping[str, str] - The labels assigned to this Secret.
- name
This property is required. str - The resource name of the Pub/Sub topic that will be published to.
- project
This property is required. str - The ID of the project.
- pulumi_
labels This property is required. Mapping[str, str] - The combination of labels configured directly on the resource and default labels configured on the provider.
- replications
This property is required. Sequence[GetSecrets Secret Replication] - The replication policy of the secret data attached to the Secret. Structure is documented below.
- rotations
This property is required. Sequence[GetSecrets Secret Rotation] - The rotation time and period for a Secret. Structure is documented below.
- secret_
id This property is required. str - This must be unique within the project.
- topics
This property is required. Sequence[GetSecrets Secret Topic] - A list of up to 10 Pub/Sub topics to which messages are published when control plane operations are called on the secret or its versions. Structure is documented below.
- ttl
This property is required. str - The TTL for the Secret. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s". Only one of 'ttl' or 'expire_time' can be provided.
- version_
aliases This property is required. Mapping[str, str] - Mapping from version alias to version name.
- version_
destroy_ ttl This property is required. str - The version destroy ttl for the secret version.
- annotations
This property is required. Map<String> - Custom metadata about the secret.
- create
Time This property is required. String - The time at which the Secret was created.
- effective
Annotations This property is required. Map<String> - effective
Labels This property is required. Map<String> - expire
Time This property is required. String - Timestamp in UTC when the Secret is scheduled to expire.
- labels
This property is required. Map<String> - The labels assigned to this Secret.
- name
This property is required. String - The resource name of the Pub/Sub topic that will be published to.
- project
This property is required. String - The ID of the project.
- pulumi
Labels This property is required. Map<String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- replications
This property is required. List<Property Map> - The replication policy of the secret data attached to the Secret. Structure is documented below.
- rotations
This property is required. List<Property Map> - The rotation time and period for a Secret. Structure is documented below.
- secret
Id This property is required. String - This must be unique within the project.
- topics
This property is required. List<Property Map> - A list of up to 10 Pub/Sub topics to which messages are published when control plane operations are called on the secret or its versions. Structure is documented below.
- ttl
This property is required. String - The TTL for the Secret. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s". Only one of 'ttl' or 'expire_time' can be provided.
- version
Aliases This property is required. Map<String> - Mapping from version alias to version name.
- version
Destroy Ttl This property is required. String - The version destroy ttl for the secret version.
GetSecretsSecretReplication
- Autos
This property is required. List<GetSecrets Secret Replication Auto> - The Secret will automatically be replicated without any restrictions. Structure is documented below.
- User
Manageds This property is required. List<GetSecrets Secret Replication User Managed> - The Secret will be replicated to the regions specified by the user. Structure is documented below.
- Autos
This property is required. []GetSecrets Secret Replication Auto - The Secret will automatically be replicated without any restrictions. Structure is documented below.
- User
Manageds This property is required. []GetSecrets Secret Replication User Managed - The Secret will be replicated to the regions specified by the user. Structure is documented below.
- autos
This property is required. List<GetSecrets Secret Replication Auto> - The Secret will automatically be replicated without any restrictions. Structure is documented below.
- user
Manageds This property is required. List<GetSecrets Secret Replication User Managed> - The Secret will be replicated to the regions specified by the user. Structure is documented below.
- autos
This property is required. GetSecrets Secret Replication Auto[] - The Secret will automatically be replicated without any restrictions. Structure is documented below.
- user
Manageds This property is required. GetSecrets Secret Replication User Managed[] - The Secret will be replicated to the regions specified by the user. Structure is documented below.
- autos
This property is required. Sequence[GetSecrets Secret Replication Auto] - The Secret will automatically be replicated without any restrictions. Structure is documented below.
- user_
manageds This property is required. Sequence[GetSecrets Secret Replication User Managed] - The Secret will be replicated to the regions specified by the user. Structure is documented below.
- autos
This property is required. List<Property Map> - The Secret will automatically be replicated without any restrictions. Structure is documented below.
- user
Manageds This property is required. List<Property Map> - The Secret will be replicated to the regions specified by the user. Structure is documented below.
GetSecretsSecretReplicationAuto
- Customer
Managed Encryptions This property is required. List<GetSecrets Secret Replication Auto Customer Managed Encryption> - Customer Managed Encryption for the secret. Structure is documented below.
- Customer
Managed Encryptions This property is required. []GetSecrets Secret Replication Auto Customer Managed Encryption - Customer Managed Encryption for the secret. Structure is documented below.
- customer
Managed Encryptions This property is required. List<GetSecrets Secret Replication Auto Customer Managed Encryption> - Customer Managed Encryption for the secret. Structure is documented below.
- customer
Managed Encryptions This property is required. GetSecrets Secret Replication Auto Customer Managed Encryption[] - Customer Managed Encryption for the secret. Structure is documented below.
- customer_
managed_ encryptions This property is required. Sequence[GetSecrets Secret Replication Auto Customer Managed Encryption] - Customer Managed Encryption for the secret. Structure is documented below.
- customer
Managed Encryptions This property is required. List<Property Map> - Customer Managed Encryption for the secret. Structure is documented below.
GetSecretsSecretReplicationAutoCustomerManagedEncryption
- Kms
Key Name This property is required. string - Describes the Cloud KMS encryption key that will be used to protect destination secret.
- Kms
Key Name This property is required. string - Describes the Cloud KMS encryption key that will be used to protect destination secret.
- kms
Key Name This property is required. String - Describes the Cloud KMS encryption key that will be used to protect destination secret.
- kms
Key Name This property is required. string - Describes the Cloud KMS encryption key that will be used to protect destination secret.
- kms_
key_ name This property is required. str - Describes the Cloud KMS encryption key that will be used to protect destination secret.
- kms
Key Name This property is required. String - Describes the Cloud KMS encryption key that will be used to protect destination secret.
GetSecretsSecretReplicationUserManaged
- Replicas
This property is required. List<GetSecrets Secret Replication User Managed Replica> - The list of Replicas for this Secret. Structure is documented below.
- Replicas
This property is required. []GetSecrets Secret Replication User Managed Replica - The list of Replicas for this Secret. Structure is documented below.
- replicas
This property is required. List<GetSecrets Secret Replication User Managed Replica> - The list of Replicas for this Secret. Structure is documented below.
- replicas
This property is required. GetSecrets Secret Replication User Managed Replica[] - The list of Replicas for this Secret. Structure is documented below.
- replicas
This property is required. Sequence[GetSecrets Secret Replication User Managed Replica] - The list of Replicas for this Secret. Structure is documented below.
- replicas
This property is required. List<Property Map> - The list of Replicas for this Secret. Structure is documented below.
GetSecretsSecretReplicationUserManagedReplica
- Customer
Managed Encryptions This property is required. List<GetSecrets Secret Replication User Managed Replica Customer Managed Encryption> - Customer Managed Encryption for the secret. Structure is documented below.
- Location
This property is required. string - The canonical IDs of the location to replicate data.
- Customer
Managed Encryptions This property is required. []GetSecrets Secret Replication User Managed Replica Customer Managed Encryption - Customer Managed Encryption for the secret. Structure is documented below.
- Location
This property is required. string - The canonical IDs of the location to replicate data.
- customer
Managed Encryptions This property is required. List<GetSecrets Secret Replication User Managed Replica Customer Managed Encryption> - Customer Managed Encryption for the secret. Structure is documented below.
- location
This property is required. String - The canonical IDs of the location to replicate data.
- customer
Managed Encryptions This property is required. GetSecrets Secret Replication User Managed Replica Customer Managed Encryption[] - Customer Managed Encryption for the secret. Structure is documented below.
- location
This property is required. string - The canonical IDs of the location to replicate data.
- customer_
managed_ encryptions This property is required. Sequence[GetSecrets Secret Replication User Managed Replica Customer Managed Encryption] - Customer Managed Encryption for the secret. Structure is documented below.
- location
This property is required. str - The canonical IDs of the location to replicate data.
- customer
Managed Encryptions This property is required. List<Property Map> - Customer Managed Encryption for the secret. Structure is documented below.
- location
This property is required. String - The canonical IDs of the location to replicate data.
GetSecretsSecretReplicationUserManagedReplicaCustomerManagedEncryption
- Kms
Key Name This property is required. string - Describes the Cloud KMS encryption key that will be used to protect destination secret.
- Kms
Key Name This property is required. string - Describes the Cloud KMS encryption key that will be used to protect destination secret.
- kms
Key Name This property is required. String - Describes the Cloud KMS encryption key that will be used to protect destination secret.
- kms
Key Name This property is required. string - Describes the Cloud KMS encryption key that will be used to protect destination secret.
- kms_
key_ name This property is required. str - Describes the Cloud KMS encryption key that will be used to protect destination secret.
- kms
Key Name This property is required. String - Describes the Cloud KMS encryption key that will be used to protect destination secret.
GetSecretsSecretRotation
- Next
Rotation Time This property is required. string - Timestamp in UTC at which the Secret is scheduled to rotate.
- Rotation
Period This property is required. string - The Duration between rotation notifications.
- Next
Rotation Time This property is required. string - Timestamp in UTC at which the Secret is scheduled to rotate.
- Rotation
Period This property is required. string - The Duration between rotation notifications.
- next
Rotation Time This property is required. String - Timestamp in UTC at which the Secret is scheduled to rotate.
- rotation
Period This property is required. String - The Duration between rotation notifications.
- next
Rotation Time This property is required. string - Timestamp in UTC at which the Secret is scheduled to rotate.
- rotation
Period This property is required. string - The Duration between rotation notifications.
- next_
rotation_ time This property is required. str - Timestamp in UTC at which the Secret is scheduled to rotate.
- rotation_
period This property is required. str - The Duration between rotation notifications.
- next
Rotation Time This property is required. String - Timestamp in UTC at which the Secret is scheduled to rotate.
- rotation
Period This property is required. String - The Duration between rotation notifications.
GetSecretsSecretTopic
- Name
This property is required. string - The resource name of the Pub/Sub topic that will be published to.
- Name
This property is required. string - The resource name of the Pub/Sub topic that will be published to.
- name
This property is required. String - The resource name of the Pub/Sub topic that will be published to.
- name
This property is required. string - The resource name of the Pub/Sub topic that will be published to.
- name
This property is required. str - The resource name of the Pub/Sub topic that will be published to.
- name
This property is required. String - The resource name of the Pub/Sub topic that will be published to.
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.