gcp.secretmanager.getSecret
Explore with Pulumi AI
Use this data source to get information about a Secret Manager Secret
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var qa = Gcp.SecretManager.GetSecret.Invoke(new()
{
SecretId = "foobar",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/secretmanager"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := secretmanager.LookupSecret(ctx, &secretmanager.LookupSecretArgs{
SecretId: "foobar",
}, 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.GetSecretArgs;
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 qa = SecretmanagerFunctions.getSecret(GetSecretArgs.builder()
.secretId("foobar")
.build());
}
}
import pulumi
import pulumi_gcp as gcp
qa = gcp.secretmanager.get_secret(secret_id="foobar")
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const qa = gcp.secretmanager.getSecret({
secretId: "foobar",
});
variables:
qa:
fn::invoke:
Function: gcp:secretmanager:getSecret
Arguments:
secretId: foobar
Using getSecret
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 getSecret(args: GetSecretArgs, opts?: InvokeOptions): Promise<GetSecretResult>
function getSecretOutput(args: GetSecretOutputArgs, opts?: InvokeOptions): Output<GetSecretResult>
def get_secret(project: Optional[str] = None,
secret_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetSecretResult
def get_secret_output(project: Optional[pulumi.Input[str]] = None,
secret_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetSecretResult]
func LookupSecret(ctx *Context, args *LookupSecretArgs, opts ...InvokeOption) (*LookupSecretResult, error)
func LookupSecretOutput(ctx *Context, args *LookupSecretOutputArgs, opts ...InvokeOption) LookupSecretResultOutput
> Note: This function is named LookupSecret
in the Go SDK.
public static class GetSecret
{
public static Task<GetSecretResult> InvokeAsync(GetSecretArgs args, InvokeOptions? opts = null)
public static Output<GetSecretResult> Invoke(GetSecretInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetSecretResult> getSecret(GetSecretArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: gcp:secretmanager/getSecret:getSecret
arguments:
# arguments dictionary
The following arguments are supported:
getSecret Result
The following output properties are available:
- Annotations Dictionary<string, string>
- Create
Time string - Expire
Time string - Id string
The provider-assigned unique ID for this managed resource.
- Labels Dictionary<string, string>
- Name string
- Replications
List<Get
Secret Replication> - Rotations
List<Get
Secret Rotation> - Secret
Id string - Topics
List<Get
Secret Topic> - Ttl string
- Version
Aliases Dictionary<string, string> - Project string
- Annotations map[string]string
- Create
Time string - Expire
Time string - Id string
The provider-assigned unique ID for this managed resource.
- Labels map[string]string
- Name string
- Replications
[]Get
Secret Replication - Rotations
[]Get
Secret Rotation - Secret
Id string - Topics
[]Get
Secret Topic - Ttl string
- Version
Aliases map[string]string - Project string
- annotations Map<String,String>
- create
Time String - expire
Time String - id String
The provider-assigned unique ID for this managed resource.
- labels Map<String,String>
- name String
- replications
List<Get
Secret Replication> - rotations
List<Get
Secret Rotation> - secret
Id String - topics
List<Get
Secret Topic> - ttl String
- version
Aliases Map<String,String> - project String
- annotations {[key: string]: string}
- create
Time string - expire
Time string - id string
The provider-assigned unique ID for this managed resource.
- labels {[key: string]: string}
- name string
- replications
Get
Secret Replication[] - rotations
Get
Secret Rotation[] - secret
Id string - topics
Get
Secret Topic[] - ttl string
- version
Aliases {[key: string]: string} - project string
- annotations Mapping[str, str]
- create_
time str - expire_
time str - id str
The provider-assigned unique ID for this managed resource.
- labels Mapping[str, str]
- name str
- replications
Sequence[Get
Secret Replication] - rotations
Sequence[Get
Secret Rotation] - secret_
id str - topics
Sequence[Get
Secret Topic] - ttl str
- version_
aliases Mapping[str, str] - project str
- annotations Map<String>
- create
Time String - expire
Time String - id String
The provider-assigned unique ID for this managed resource.
- labels Map<String>
- name String
- replications List<Property Map>
- rotations List<Property Map>
- secret
Id String - topics List<Property Map>
- ttl String
- version
Aliases Map<String> - project String
Supporting Types
GetSecretReplication
GetSecretReplicationUserManaged
GetSecretReplicationUserManagedReplica
GetSecretReplicationUserManagedReplicaCustomerManagedEncryption
- Kms
Key stringName
- Kms
Key stringName
- kms
Key StringName
- kms
Key stringName
- kms_
key_ strname
- kms
Key StringName
GetSecretRotation
- Next
Rotation stringTime - Rotation
Period string
- Next
Rotation stringTime - Rotation
Period string
- next
Rotation StringTime - rotation
Period String
- next
Rotation stringTime - rotation
Period string
- next
Rotation StringTime - rotation
Period String
GetSecretTopic
- Name string
- Name string
- name String
- name string
- name str
- name String
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.