Google Cloud (GCP) Classic
getSecretVersion
Get a Secret Manager secret’s version. For more information see the official documentation and API.
Example Usage
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var basic = Output.Create(Gcp.SecretManager.GetSecretVersion.InvokeAsync(new Gcp.SecretManager.GetSecretVersionArgs
{
Secret = "my-secret",
}));
}
}
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.LookupSecretVersion(ctx, &secretmanager.LookupSecretVersionArgs{
Secret: "my-secret",
}, nil)
if err != nil {
return err
}
return nil
})
}
package generated_program;
import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var basic = Output.of(SecretmanagerFunctions.getSecretVersion(GetSecretVersionArgs.builder()
.secret("my-secret")
.build()));
}
}
import pulumi
import pulumi_gcp as gcp
basic = gcp.secretmanager.get_secret_version(secret="my-secret")
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const basic = pulumi.output(gcp.secretmanager.getSecretVersion({
secret: "my-secret",
}));
variables:
basic:
Fn::Invoke:
Function: gcp:secretmanager:getSecretVersion
Arguments:
secret: my-secret
Using getSecretVersion
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 getSecretVersion(args: GetSecretVersionArgs, opts?: InvokeOptions): Promise<GetSecretVersionResult>
function getSecretVersionOutput(args: GetSecretVersionOutputArgs, opts?: InvokeOptions): Output<GetSecretVersionResult>
def get_secret_version(project: Optional[str] = None,
secret: Optional[str] = None,
version: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetSecretVersionResult
def get_secret_version_output(project: Optional[pulumi.Input[str]] = None,
secret: Optional[pulumi.Input[str]] = None,
version: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetSecretVersionResult]
func LookupSecretVersion(ctx *Context, args *LookupSecretVersionArgs, opts ...InvokeOption) (*LookupSecretVersionResult, error)
func LookupSecretVersionOutput(ctx *Context, args *LookupSecretVersionOutputArgs, opts ...InvokeOption) LookupSecretVersionResultOutput
> Note: This function is named LookupSecretVersion
in the Go SDK.
public static class GetSecretVersion
{
public static Task<GetSecretVersionResult> InvokeAsync(GetSecretVersionArgs args, InvokeOptions? opts = null)
public static Output<GetSecretVersionResult> Invoke(GetSecretVersionInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetSecretVersionResult> getSecretVersion(GetSecretVersionArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
Function: gcp:secretmanager/getSecretVersion:getSecretVersion
Arguments:
# Arguments dictionary
The following arguments are supported:
getSecretVersion Result
The following output properties are available:
- Create
Time string The time at which the Secret was created.
- Destroy
Time string The time at which the Secret was destroyed. Only present if state is DESTROYED.
- Enabled bool
True if the current state of the SecretVersion is enabled.
- Id string
The provider-assigned unique ID for this managed resource.
- Name string
The resource name of the SecretVersion. Format:
projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}
- Project string
- Secret string
- Secret
Data string The secret data. No larger than 64KiB.
- Version string
- Create
Time string The time at which the Secret was created.
- Destroy
Time string The time at which the Secret was destroyed. Only present if state is DESTROYED.
- Enabled bool
True if the current state of the SecretVersion is enabled.
- Id string
The provider-assigned unique ID for this managed resource.
- Name string
The resource name of the SecretVersion. Format:
projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}
- Project string
- Secret string
- Secret
Data string The secret data. No larger than 64KiB.
- Version string
- create
Time String The time at which the Secret was created.
- destroy
Time String The time at which the Secret was destroyed. Only present if state is DESTROYED.
- enabled Boolean
True if the current state of the SecretVersion is enabled.
- id String
The provider-assigned unique ID for this managed resource.
- name String
The resource name of the SecretVersion. Format:
projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}
- project String
- secret String
- secret
Data String The secret data. No larger than 64KiB.
- version String
- create
Time string The time at which the Secret was created.
- destroy
Time string The time at which the Secret was destroyed. Only present if state is DESTROYED.
- enabled boolean
True if the current state of the SecretVersion is enabled.
- id string
The provider-assigned unique ID for this managed resource.
- name string
The resource name of the SecretVersion. Format:
projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}
- project string
- secret string
- secret
Data string The secret data. No larger than 64KiB.
- version string
- create_
time str The time at which the Secret was created.
- destroy_
time str The time at which the Secret was destroyed. Only present if state is DESTROYED.
- enabled bool
True if the current state of the SecretVersion is enabled.
- id str
The provider-assigned unique ID for this managed resource.
- name str
The resource name of the SecretVersion. Format:
projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}
- project str
- secret str
- secret_
data str The secret data. No larger than 64KiB.
- version str
- create
Time String The time at which the Secret was created.
- destroy
Time String The time at which the Secret was destroyed. Only present if state is DESTROYED.
- enabled Boolean
True if the current state of the SecretVersion is enabled.
- id String
The provider-assigned unique ID for this managed resource.
- name String
The resource name of the SecretVersion. Format:
projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}
- project String
- secret String
- secret
Data String The secret data. No larger than 64KiB.
- version String
Package Details
- Repository
- https://github.com/pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
google-beta
Terraform Provider.