get Secret
Use this data source to get information about a Secret Manager Secret
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const qa = gcp.secretmanager.getSecret({
secretId: "foobar",
});
Content copied to clipboard
import pulumi
import pulumi_gcp as gcp
qa = gcp.secretmanager.get_secret(secret_id="foobar")
Content copied to clipboard
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",
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/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
})
}
Content copied to clipboard
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());
}
}
Content copied to clipboard
variables:
qa:
fn::invoke:
Function: gcp:secretmanager:getSecret
Arguments:
secretId: foobar
Content copied to clipboard
Return
A collection of values returned by getSecret.
Parameters
argument
A collection of arguments for invoking getSecret.
Return
A collection of values returned by getSecret.
Parameters
project
The ID of the project in which the resource belongs.
secret Id
The name of the secret.
See also
Return
A collection of values returned by getSecret.
Parameters
argument
Builder for com.pulumi.gcp.secretmanager.kotlin.inputs.GetSecretPlainArgs.