generated from pulumi/pulumi-tf-provider-boilerplate
/
getSecretVersions.go
171 lines (149 loc) · 6.32 KB
/
getSecretVersions.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package kms
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// This data source provides a list of KMS Secret Versions in an Alibaba Cloud account according to the specified filters.
//
// > **NOTE:** Available in v1.88.0+.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-alicloud/sdk/go/alicloud/kms"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/rhysmdnz/pulumi-alicloud/sdk/go/alicloud/kms"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// kmsSecretVersionsDs, err := kms.GetSecretVersions(ctx, &kms.GetSecretVersionsArgs{
// EnableDetails: pulumi.BoolRef(true),
// SecretName: "secret_name",
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("firstSecretData", kmsSecretVersionsDs.Versions[0].SecretData)
// return nil
// })
// }
//
// ```
func GetSecretVersions(ctx *pulumi.Context, args *GetSecretVersionsArgs, opts ...pulumi.InvokeOption) (*GetSecretVersionsResult, error) {
opts = pkgInvokeDefaultOpts(opts)
var rv GetSecretVersionsResult
err := ctx.Invoke("alicloud:kms/getSecretVersions:getSecretVersions", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getSecretVersions.
type GetSecretVersionsArgs struct {
// Default to false and only output `secretName`, `versionId`, `versionStages`. Set it to true can output more details.
EnableDetails *bool `pulumi:"enableDetails"`
// A list of KMS Secret Version ids.
Ids []string `pulumi:"ids"`
// Specifies whether to return deprecated secret versions. Default to `false`.
IncludeDeprecated *string `pulumi:"includeDeprecated"`
OutputFile *string `pulumi:"outputFile"`
// The name of the secret.
SecretName string `pulumi:"secretName"`
// The stage of the secret version.
VersionStage *string `pulumi:"versionStage"`
}
// A collection of values returned by getSecretVersions.
type GetSecretVersionsResult struct {
EnableDetails *bool `pulumi:"enableDetails"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// A list of Kms Secret Version ids.
Ids []string `pulumi:"ids"`
IncludeDeprecated *string `pulumi:"includeDeprecated"`
OutputFile *string `pulumi:"outputFile"`
// The name of the secret.
SecretName string `pulumi:"secretName"`
VersionStage *string `pulumi:"versionStage"`
// A list of KMS Secret Versions. Each element contains the following attributes:
Versions []GetSecretVersionsVersion `pulumi:"versions"`
}
func GetSecretVersionsOutput(ctx *pulumi.Context, args GetSecretVersionsOutputArgs, opts ...pulumi.InvokeOption) GetSecretVersionsResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetSecretVersionsResult, error) {
args := v.(GetSecretVersionsArgs)
r, err := GetSecretVersions(ctx, &args, opts...)
var s GetSecretVersionsResult
if r != nil {
s = *r
}
return s, err
}).(GetSecretVersionsResultOutput)
}
// A collection of arguments for invoking getSecretVersions.
type GetSecretVersionsOutputArgs struct {
// Default to false and only output `secretName`, `versionId`, `versionStages`. Set it to true can output more details.
EnableDetails pulumi.BoolPtrInput `pulumi:"enableDetails"`
// A list of KMS Secret Version ids.
Ids pulumi.StringArrayInput `pulumi:"ids"`
// Specifies whether to return deprecated secret versions. Default to `false`.
IncludeDeprecated pulumi.StringPtrInput `pulumi:"includeDeprecated"`
OutputFile pulumi.StringPtrInput `pulumi:"outputFile"`
// The name of the secret.
SecretName pulumi.StringInput `pulumi:"secretName"`
// The stage of the secret version.
VersionStage pulumi.StringPtrInput `pulumi:"versionStage"`
}
func (GetSecretVersionsOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetSecretVersionsArgs)(nil)).Elem()
}
// A collection of values returned by getSecretVersions.
type GetSecretVersionsResultOutput struct{ *pulumi.OutputState }
func (GetSecretVersionsResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetSecretVersionsResult)(nil)).Elem()
}
func (o GetSecretVersionsResultOutput) ToGetSecretVersionsResultOutput() GetSecretVersionsResultOutput {
return o
}
func (o GetSecretVersionsResultOutput) ToGetSecretVersionsResultOutputWithContext(ctx context.Context) GetSecretVersionsResultOutput {
return o
}
func (o GetSecretVersionsResultOutput) EnableDetails() pulumi.BoolPtrOutput {
return o.ApplyT(func(v GetSecretVersionsResult) *bool { return v.EnableDetails }).(pulumi.BoolPtrOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetSecretVersionsResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetSecretVersionsResult) string { return v.Id }).(pulumi.StringOutput)
}
// A list of Kms Secret Version ids.
func (o GetSecretVersionsResultOutput) Ids() pulumi.StringArrayOutput {
return o.ApplyT(func(v GetSecretVersionsResult) []string { return v.Ids }).(pulumi.StringArrayOutput)
}
func (o GetSecretVersionsResultOutput) IncludeDeprecated() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetSecretVersionsResult) *string { return v.IncludeDeprecated }).(pulumi.StringPtrOutput)
}
func (o GetSecretVersionsResultOutput) OutputFile() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetSecretVersionsResult) *string { return v.OutputFile }).(pulumi.StringPtrOutput)
}
// The name of the secret.
func (o GetSecretVersionsResultOutput) SecretName() pulumi.StringOutput {
return o.ApplyT(func(v GetSecretVersionsResult) string { return v.SecretName }).(pulumi.StringOutput)
}
func (o GetSecretVersionsResultOutput) VersionStage() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetSecretVersionsResult) *string { return v.VersionStage }).(pulumi.StringPtrOutput)
}
// A list of KMS Secret Versions. Each element contains the following attributes:
func (o GetSecretVersionsResultOutput) Versions() GetSecretVersionsVersionArrayOutput {
return o.ApplyT(func(v GetSecretVersionsResult) []GetSecretVersionsVersion { return v.Versions }).(GetSecretVersionsVersionArrayOutput)
}
func init() {
pulumi.RegisterOutputType(GetSecretVersionsResultOutput{})
}