-
Notifications
You must be signed in to change notification settings - Fork 150
/
publicKey.go
315 lines (255 loc) · 10.3 KB
/
publicKey.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
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
// *** 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 cloudfront
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// ## Import
//
// CloudFront Public Key can be imported using the `id`, e.g.
//
// ```sh
// $ pulumi import aws:cloudfront/publicKey:PublicKey example K3D5EWEUDCCXON
// ```
type PublicKey struct {
pulumi.CustomResourceState
// Internal value used by CloudFront to allow future updates to the public key configuration.
CallerReference pulumi.StringOutput `pulumi:"callerReference"`
// An optional comment about the public key.
Comment pulumi.StringPtrOutput `pulumi:"comment"`
// The encoded public key that you want to add to CloudFront to use with features like field-level encryption.
EncodedKey pulumi.StringOutput `pulumi:"encodedKey"`
// The current version of the public key. For example: `E2QWRUHAPOMQZL`.
Etag pulumi.StringOutput `pulumi:"etag"`
// The name for the public key. By default generated by this provider.
Name pulumi.StringOutput `pulumi:"name"`
// The name for the public key. Conflicts with `name`.
NamePrefix pulumi.StringOutput `pulumi:"namePrefix"`
}
// NewPublicKey registers a new resource with the given unique name, arguments, and options.
func NewPublicKey(ctx *pulumi.Context,
name string, args *PublicKeyArgs, opts ...pulumi.ResourceOption) (*PublicKey, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.EncodedKey == nil {
return nil, errors.New("invalid value for required argument 'EncodedKey'")
}
var resource PublicKey
err := ctx.RegisterResource("aws:cloudfront/publicKey:PublicKey", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetPublicKey gets an existing PublicKey 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 GetPublicKey(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *PublicKeyState, opts ...pulumi.ResourceOption) (*PublicKey, error) {
var resource PublicKey
err := ctx.ReadResource("aws:cloudfront/publicKey:PublicKey", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering PublicKey resources.
type publicKeyState struct {
// Internal value used by CloudFront to allow future updates to the public key configuration.
CallerReference *string `pulumi:"callerReference"`
// An optional comment about the public key.
Comment *string `pulumi:"comment"`
// The encoded public key that you want to add to CloudFront to use with features like field-level encryption.
EncodedKey *string `pulumi:"encodedKey"`
// The current version of the public key. For example: `E2QWRUHAPOMQZL`.
Etag *string `pulumi:"etag"`
// The name for the public key. By default generated by this provider.
Name *string `pulumi:"name"`
// The name for the public key. Conflicts with `name`.
NamePrefix *string `pulumi:"namePrefix"`
}
type PublicKeyState struct {
// Internal value used by CloudFront to allow future updates to the public key configuration.
CallerReference pulumi.StringPtrInput
// An optional comment about the public key.
Comment pulumi.StringPtrInput
// The encoded public key that you want to add to CloudFront to use with features like field-level encryption.
EncodedKey pulumi.StringPtrInput
// The current version of the public key. For example: `E2QWRUHAPOMQZL`.
Etag pulumi.StringPtrInput
// The name for the public key. By default generated by this provider.
Name pulumi.StringPtrInput
// The name for the public key. Conflicts with `name`.
NamePrefix pulumi.StringPtrInput
}
func (PublicKeyState) ElementType() reflect.Type {
return reflect.TypeOf((*publicKeyState)(nil)).Elem()
}
type publicKeyArgs struct {
// An optional comment about the public key.
Comment *string `pulumi:"comment"`
// The encoded public key that you want to add to CloudFront to use with features like field-level encryption.
EncodedKey string `pulumi:"encodedKey"`
// The name for the public key. By default generated by this provider.
Name *string `pulumi:"name"`
// The name for the public key. Conflicts with `name`.
NamePrefix *string `pulumi:"namePrefix"`
}
// The set of arguments for constructing a PublicKey resource.
type PublicKeyArgs struct {
// An optional comment about the public key.
Comment pulumi.StringPtrInput
// The encoded public key that you want to add to CloudFront to use with features like field-level encryption.
EncodedKey pulumi.StringInput
// The name for the public key. By default generated by this provider.
Name pulumi.StringPtrInput
// The name for the public key. Conflicts with `name`.
NamePrefix pulumi.StringPtrInput
}
func (PublicKeyArgs) ElementType() reflect.Type {
return reflect.TypeOf((*publicKeyArgs)(nil)).Elem()
}
type PublicKeyInput interface {
pulumi.Input
ToPublicKeyOutput() PublicKeyOutput
ToPublicKeyOutputWithContext(ctx context.Context) PublicKeyOutput
}
func (*PublicKey) ElementType() reflect.Type {
return reflect.TypeOf((*PublicKey)(nil))
}
func (i *PublicKey) ToPublicKeyOutput() PublicKeyOutput {
return i.ToPublicKeyOutputWithContext(context.Background())
}
func (i *PublicKey) ToPublicKeyOutputWithContext(ctx context.Context) PublicKeyOutput {
return pulumi.ToOutputWithContext(ctx, i).(PublicKeyOutput)
}
func (i *PublicKey) ToPublicKeyPtrOutput() PublicKeyPtrOutput {
return i.ToPublicKeyPtrOutputWithContext(context.Background())
}
func (i *PublicKey) ToPublicKeyPtrOutputWithContext(ctx context.Context) PublicKeyPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(PublicKeyPtrOutput)
}
type PublicKeyPtrInput interface {
pulumi.Input
ToPublicKeyPtrOutput() PublicKeyPtrOutput
ToPublicKeyPtrOutputWithContext(ctx context.Context) PublicKeyPtrOutput
}
type publicKeyPtrType PublicKeyArgs
func (*publicKeyPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**PublicKey)(nil))
}
func (i *publicKeyPtrType) ToPublicKeyPtrOutput() PublicKeyPtrOutput {
return i.ToPublicKeyPtrOutputWithContext(context.Background())
}
func (i *publicKeyPtrType) ToPublicKeyPtrOutputWithContext(ctx context.Context) PublicKeyPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(PublicKeyPtrOutput)
}
// PublicKeyArrayInput is an input type that accepts PublicKeyArray and PublicKeyArrayOutput values.
// You can construct a concrete instance of `PublicKeyArrayInput` via:
//
// PublicKeyArray{ PublicKeyArgs{...} }
type PublicKeyArrayInput interface {
pulumi.Input
ToPublicKeyArrayOutput() PublicKeyArrayOutput
ToPublicKeyArrayOutputWithContext(context.Context) PublicKeyArrayOutput
}
type PublicKeyArray []PublicKeyInput
func (PublicKeyArray) ElementType() reflect.Type {
return reflect.TypeOf(([]*PublicKey)(nil))
}
func (i PublicKeyArray) ToPublicKeyArrayOutput() PublicKeyArrayOutput {
return i.ToPublicKeyArrayOutputWithContext(context.Background())
}
func (i PublicKeyArray) ToPublicKeyArrayOutputWithContext(ctx context.Context) PublicKeyArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(PublicKeyArrayOutput)
}
// PublicKeyMapInput is an input type that accepts PublicKeyMap and PublicKeyMapOutput values.
// You can construct a concrete instance of `PublicKeyMapInput` via:
//
// PublicKeyMap{ "key": PublicKeyArgs{...} }
type PublicKeyMapInput interface {
pulumi.Input
ToPublicKeyMapOutput() PublicKeyMapOutput
ToPublicKeyMapOutputWithContext(context.Context) PublicKeyMapOutput
}
type PublicKeyMap map[string]PublicKeyInput
func (PublicKeyMap) ElementType() reflect.Type {
return reflect.TypeOf((map[string]*PublicKey)(nil))
}
func (i PublicKeyMap) ToPublicKeyMapOutput() PublicKeyMapOutput {
return i.ToPublicKeyMapOutputWithContext(context.Background())
}
func (i PublicKeyMap) ToPublicKeyMapOutputWithContext(ctx context.Context) PublicKeyMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(PublicKeyMapOutput)
}
type PublicKeyOutput struct {
*pulumi.OutputState
}
func (PublicKeyOutput) ElementType() reflect.Type {
return reflect.TypeOf((*PublicKey)(nil))
}
func (o PublicKeyOutput) ToPublicKeyOutput() PublicKeyOutput {
return o
}
func (o PublicKeyOutput) ToPublicKeyOutputWithContext(ctx context.Context) PublicKeyOutput {
return o
}
func (o PublicKeyOutput) ToPublicKeyPtrOutput() PublicKeyPtrOutput {
return o.ToPublicKeyPtrOutputWithContext(context.Background())
}
func (o PublicKeyOutput) ToPublicKeyPtrOutputWithContext(ctx context.Context) PublicKeyPtrOutput {
return o.ApplyT(func(v PublicKey) *PublicKey {
return &v
}).(PublicKeyPtrOutput)
}
type PublicKeyPtrOutput struct {
*pulumi.OutputState
}
func (PublicKeyPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**PublicKey)(nil))
}
func (o PublicKeyPtrOutput) ToPublicKeyPtrOutput() PublicKeyPtrOutput {
return o
}
func (o PublicKeyPtrOutput) ToPublicKeyPtrOutputWithContext(ctx context.Context) PublicKeyPtrOutput {
return o
}
type PublicKeyArrayOutput struct{ *pulumi.OutputState }
func (PublicKeyArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]PublicKey)(nil))
}
func (o PublicKeyArrayOutput) ToPublicKeyArrayOutput() PublicKeyArrayOutput {
return o
}
func (o PublicKeyArrayOutput) ToPublicKeyArrayOutputWithContext(ctx context.Context) PublicKeyArrayOutput {
return o
}
func (o PublicKeyArrayOutput) Index(i pulumi.IntInput) PublicKeyOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) PublicKey {
return vs[0].([]PublicKey)[vs[1].(int)]
}).(PublicKeyOutput)
}
type PublicKeyMapOutput struct{ *pulumi.OutputState }
func (PublicKeyMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]PublicKey)(nil))
}
func (o PublicKeyMapOutput) ToPublicKeyMapOutput() PublicKeyMapOutput {
return o
}
func (o PublicKeyMapOutput) ToPublicKeyMapOutputWithContext(ctx context.Context) PublicKeyMapOutput {
return o
}
func (o PublicKeyMapOutput) MapIndex(k pulumi.StringInput) PublicKeyOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) PublicKey {
return vs[0].(map[string]PublicKey)[vs[1].(string)]
}).(PublicKeyOutput)
}
func init() {
pulumi.RegisterOutputType(PublicKeyOutput{})
pulumi.RegisterOutputType(PublicKeyPtrOutput{})
pulumi.RegisterOutputType(PublicKeyArrayOutput{})
pulumi.RegisterOutputType(PublicKeyMapOutput{})
}