This repository has been archived by the owner on Aug 15, 2022. It is now read-only.
generated from pulumi/pulumi-tf-provider-boilerplate
/
secretVersion.go
288 lines (238 loc) · 13 KB
/
secretVersion.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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
// 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 ssm
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type SecretVersion struct {
pulumi.CustomResourceState
// The base64-encoded binary secret. secret_binary and secret_string must be set only one, and the maximum support is 4096
// bytes. When secret status is `Disabled`, this field will not update anymore.
SecretBinary pulumi.StringPtrOutput `pulumi:"secretBinary"`
// Name of secret which cannot be repeated in the same region. The maximum length is 128 bytes. The name can only contain
// English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
SecretName pulumi.StringOutput `pulumi:"secretName"`
// The string text of secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes.
// When secret status is `Disabled`, this field will not update anymore.
SecretString pulumi.StringPtrOutput `pulumi:"secretString"`
// Version of secret. The maximum length is 64 bytes. The version_id can only contain English letters, numbers, underscore
// and hyphen '-'. The first character must be a letter or number.
VersionId pulumi.StringOutput `pulumi:"versionId"`
}
// NewSecretVersion registers a new resource with the given unique name, arguments, and options.
func NewSecretVersion(ctx *pulumi.Context,
name string, args *SecretVersionArgs, opts ...pulumi.ResourceOption) (*SecretVersion, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.SecretName == nil {
return nil, errors.New("invalid value for required argument 'SecretName'")
}
if args.VersionId == nil {
return nil, errors.New("invalid value for required argument 'VersionId'")
}
var resource SecretVersion
err := ctx.RegisterResource("tctest:Ssm/secretVersion:SecretVersion", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSecretVersion gets an existing SecretVersion resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetSecretVersion(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SecretVersionState, opts ...pulumi.ResourceOption) (*SecretVersion, error) {
var resource SecretVersion
err := ctx.ReadResource("tctest:Ssm/secretVersion:SecretVersion", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering SecretVersion resources.
type secretVersionState struct {
// The base64-encoded binary secret. secret_binary and secret_string must be set only one, and the maximum support is 4096
// bytes. When secret status is `Disabled`, this field will not update anymore.
SecretBinary *string `pulumi:"secretBinary"`
// Name of secret which cannot be repeated in the same region. The maximum length is 128 bytes. The name can only contain
// English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
SecretName *string `pulumi:"secretName"`
// The string text of secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes.
// When secret status is `Disabled`, this field will not update anymore.
SecretString *string `pulumi:"secretString"`
// Version of secret. The maximum length is 64 bytes. The version_id can only contain English letters, numbers, underscore
// and hyphen '-'. The first character must be a letter or number.
VersionId *string `pulumi:"versionId"`
}
type SecretVersionState struct {
// The base64-encoded binary secret. secret_binary and secret_string must be set only one, and the maximum support is 4096
// bytes. When secret status is `Disabled`, this field will not update anymore.
SecretBinary pulumi.StringPtrInput
// Name of secret which cannot be repeated in the same region. The maximum length is 128 bytes. The name can only contain
// English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
SecretName pulumi.StringPtrInput
// The string text of secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes.
// When secret status is `Disabled`, this field will not update anymore.
SecretString pulumi.StringPtrInput
// Version of secret. The maximum length is 64 bytes. The version_id can only contain English letters, numbers, underscore
// and hyphen '-'. The first character must be a letter or number.
VersionId pulumi.StringPtrInput
}
func (SecretVersionState) ElementType() reflect.Type {
return reflect.TypeOf((*secretVersionState)(nil)).Elem()
}
type secretVersionArgs struct {
// The base64-encoded binary secret. secret_binary and secret_string must be set only one, and the maximum support is 4096
// bytes. When secret status is `Disabled`, this field will not update anymore.
SecretBinary *string `pulumi:"secretBinary"`
// Name of secret which cannot be repeated in the same region. The maximum length is 128 bytes. The name can only contain
// English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
SecretName string `pulumi:"secretName"`
// The string text of secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes.
// When secret status is `Disabled`, this field will not update anymore.
SecretString *string `pulumi:"secretString"`
// Version of secret. The maximum length is 64 bytes. The version_id can only contain English letters, numbers, underscore
// and hyphen '-'. The first character must be a letter or number.
VersionId string `pulumi:"versionId"`
}
// The set of arguments for constructing a SecretVersion resource.
type SecretVersionArgs struct {
// The base64-encoded binary secret. secret_binary and secret_string must be set only one, and the maximum support is 4096
// bytes. When secret status is `Disabled`, this field will not update anymore.
SecretBinary pulumi.StringPtrInput
// Name of secret which cannot be repeated in the same region. The maximum length is 128 bytes. The name can only contain
// English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
SecretName pulumi.StringInput
// The string text of secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes.
// When secret status is `Disabled`, this field will not update anymore.
SecretString pulumi.StringPtrInput
// Version of secret. The maximum length is 64 bytes. The version_id can only contain English letters, numbers, underscore
// and hyphen '-'. The first character must be a letter or number.
VersionId pulumi.StringInput
}
func (SecretVersionArgs) ElementType() reflect.Type {
return reflect.TypeOf((*secretVersionArgs)(nil)).Elem()
}
type SecretVersionInput interface {
pulumi.Input
ToSecretVersionOutput() SecretVersionOutput
ToSecretVersionOutputWithContext(ctx context.Context) SecretVersionOutput
}
func (*SecretVersion) ElementType() reflect.Type {
return reflect.TypeOf((**SecretVersion)(nil)).Elem()
}
func (i *SecretVersion) ToSecretVersionOutput() SecretVersionOutput {
return i.ToSecretVersionOutputWithContext(context.Background())
}
func (i *SecretVersion) ToSecretVersionOutputWithContext(ctx context.Context) SecretVersionOutput {
return pulumi.ToOutputWithContext(ctx, i).(SecretVersionOutput)
}
// SecretVersionArrayInput is an input type that accepts SecretVersionArray and SecretVersionArrayOutput values.
// You can construct a concrete instance of `SecretVersionArrayInput` via:
//
// SecretVersionArray{ SecretVersionArgs{...} }
type SecretVersionArrayInput interface {
pulumi.Input
ToSecretVersionArrayOutput() SecretVersionArrayOutput
ToSecretVersionArrayOutputWithContext(context.Context) SecretVersionArrayOutput
}
type SecretVersionArray []SecretVersionInput
func (SecretVersionArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SecretVersion)(nil)).Elem()
}
func (i SecretVersionArray) ToSecretVersionArrayOutput() SecretVersionArrayOutput {
return i.ToSecretVersionArrayOutputWithContext(context.Background())
}
func (i SecretVersionArray) ToSecretVersionArrayOutputWithContext(ctx context.Context) SecretVersionArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(SecretVersionArrayOutput)
}
// SecretVersionMapInput is an input type that accepts SecretVersionMap and SecretVersionMapOutput values.
// You can construct a concrete instance of `SecretVersionMapInput` via:
//
// SecretVersionMap{ "key": SecretVersionArgs{...} }
type SecretVersionMapInput interface {
pulumi.Input
ToSecretVersionMapOutput() SecretVersionMapOutput
ToSecretVersionMapOutputWithContext(context.Context) SecretVersionMapOutput
}
type SecretVersionMap map[string]SecretVersionInput
func (SecretVersionMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SecretVersion)(nil)).Elem()
}
func (i SecretVersionMap) ToSecretVersionMapOutput() SecretVersionMapOutput {
return i.ToSecretVersionMapOutputWithContext(context.Background())
}
func (i SecretVersionMap) ToSecretVersionMapOutputWithContext(ctx context.Context) SecretVersionMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(SecretVersionMapOutput)
}
type SecretVersionOutput struct{ *pulumi.OutputState }
func (SecretVersionOutput) ElementType() reflect.Type {
return reflect.TypeOf((**SecretVersion)(nil)).Elem()
}
func (o SecretVersionOutput) ToSecretVersionOutput() SecretVersionOutput {
return o
}
func (o SecretVersionOutput) ToSecretVersionOutputWithContext(ctx context.Context) SecretVersionOutput {
return o
}
// The base64-encoded binary secret. secret_binary and secret_string must be set only one, and the maximum support is 4096
// bytes. When secret status is `Disabled`, this field will not update anymore.
func (o SecretVersionOutput) SecretBinary() pulumi.StringPtrOutput {
return o.ApplyT(func(v *SecretVersion) pulumi.StringPtrOutput { return v.SecretBinary }).(pulumi.StringPtrOutput)
}
// Name of secret which cannot be repeated in the same region. The maximum length is 128 bytes. The name can only contain
// English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
func (o SecretVersionOutput) SecretName() pulumi.StringOutput {
return o.ApplyT(func(v *SecretVersion) pulumi.StringOutput { return v.SecretName }).(pulumi.StringOutput)
}
// The string text of secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes.
// When secret status is `Disabled`, this field will not update anymore.
func (o SecretVersionOutput) SecretString() pulumi.StringPtrOutput {
return o.ApplyT(func(v *SecretVersion) pulumi.StringPtrOutput { return v.SecretString }).(pulumi.StringPtrOutput)
}
// Version of secret. The maximum length is 64 bytes. The version_id can only contain English letters, numbers, underscore
// and hyphen '-'. The first character must be a letter or number.
func (o SecretVersionOutput) VersionId() pulumi.StringOutput {
return o.ApplyT(func(v *SecretVersion) pulumi.StringOutput { return v.VersionId }).(pulumi.StringOutput)
}
type SecretVersionArrayOutput struct{ *pulumi.OutputState }
func (SecretVersionArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SecretVersion)(nil)).Elem()
}
func (o SecretVersionArrayOutput) ToSecretVersionArrayOutput() SecretVersionArrayOutput {
return o
}
func (o SecretVersionArrayOutput) ToSecretVersionArrayOutputWithContext(ctx context.Context) SecretVersionArrayOutput {
return o
}
func (o SecretVersionArrayOutput) Index(i pulumi.IntInput) SecretVersionOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SecretVersion {
return vs[0].([]*SecretVersion)[vs[1].(int)]
}).(SecretVersionOutput)
}
type SecretVersionMapOutput struct{ *pulumi.OutputState }
func (SecretVersionMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SecretVersion)(nil)).Elem()
}
func (o SecretVersionMapOutput) ToSecretVersionMapOutput() SecretVersionMapOutput {
return o
}
func (o SecretVersionMapOutput) ToSecretVersionMapOutputWithContext(ctx context.Context) SecretVersionMapOutput {
return o
}
func (o SecretVersionMapOutput) MapIndex(k pulumi.StringInput) SecretVersionOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SecretVersion {
return vs[0].(map[string]*SecretVersion)[vs[1].(string)]
}).(SecretVersionOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*SecretVersionInput)(nil)).Elem(), &SecretVersion{})
pulumi.RegisterInputType(reflect.TypeOf((*SecretVersionArrayInput)(nil)).Elem(), SecretVersionArray{})
pulumi.RegisterInputType(reflect.TypeOf((*SecretVersionMapInput)(nil)).Elem(), SecretVersionMap{})
pulumi.RegisterOutputType(SecretVersionOutput{})
pulumi.RegisterOutputType(SecretVersionArrayOutput{})
pulumi.RegisterOutputType(SecretVersionMapOutput{})
}