/
getSecretVersion.go
73 lines (68 loc) · 2.53 KB
/
getSecretVersion.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package secretmanager
import (
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Get a Secret Manager secret's version. For more information see the [official documentation](https://cloud.google.com/secret-manager/docs/) and [API](https://cloud.google.com/secret-manager/docs/reference/rest/v1/projects.secrets.versions).
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-gcp/sdk/v4/go/gcp/secretmanager"
// "github.com/pulumi/pulumi/sdk/v2/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
// })
// }
// ```
func LookupSecretVersion(ctx *pulumi.Context, args *LookupSecretVersionArgs, opts ...pulumi.InvokeOption) (*LookupSecretVersionResult, error) {
var rv LookupSecretVersionResult
err := ctx.Invoke("gcp:secretmanager/getSecretVersion:getSecretVersion", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getSecretVersion.
type LookupSecretVersionArgs struct {
// The project to get the secret version for. If it
// is not provided, the provider project is used.
Project *string `pulumi:"project"`
// The secret to get the secret version for.
Secret string `pulumi:"secret"`
// The version of the secret to get. If it
// is not provided, the latest version is retrieved.
Version *string `pulumi:"version"`
}
// A collection of values returned by getSecretVersion.
type LookupSecretVersionResult struct {
// The time at which the Secret was created.
CreateTime string `pulumi:"createTime"`
// The time at which the Secret was destroyed. Only present if state is DESTROYED.
DestroyTime string `pulumi:"destroyTime"`
// True if the current state of the SecretVersion is enabled.
Enabled bool `pulumi:"enabled"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The resource name of the SecretVersion. Format:
// `projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}`
Name string `pulumi:"name"`
Project string `pulumi:"project"`
Secret string `pulumi:"secret"`
// The secret data. No larger than 64KiB.
SecretData string `pulumi:"secretData"`
Version string `pulumi:"version"`
}