/
keyGroup.go
315 lines (265 loc) · 9.59 KB
/
keyGroup.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
// 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 cloudfront
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// ## Example Usage
//
// The following example below creates a CloudFront key group.
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudfront"
// "github.com/pulumi/pulumi-std/sdk/go/std"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// invokeFile, err := std.File(ctx, &std.FileArgs{
// Input: "public_key.pem",
// }, nil)
// if err != nil {
// return err
// }
// example, err := cloudfront.NewPublicKey(ctx, "example", &cloudfront.PublicKeyArgs{
// Comment: pulumi.String("example public key"),
// EncodedKey: invokeFile.Result,
// Name: pulumi.String("example-key"),
// })
// if err != nil {
// return err
// }
// _, err = cloudfront.NewKeyGroup(ctx, "example", &cloudfront.KeyGroupArgs{
// Comment: pulumi.String("example key group"),
// Items: pulumi.StringArray{
// example.ID(),
// },
// Name: pulumi.String("example-key-group"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Import
//
// Using `pulumi import`, import CloudFront Key Group using the `id`. For example:
//
// ```sh
// $ pulumi import aws:cloudfront/keyGroup:KeyGroup example 4b4f2r1c-315d-5c2e-f093-216t50jed10f
// ```
type KeyGroup struct {
pulumi.CustomResourceState
// A comment to describe the key group..
Comment pulumi.StringPtrOutput `pulumi:"comment"`
// The identifier for this version of the key group.
Etag pulumi.StringOutput `pulumi:"etag"`
// A list of the identifiers of the public keys in the key group.
Items pulumi.StringArrayOutput `pulumi:"items"`
// A name to identify the key group.
Name pulumi.StringOutput `pulumi:"name"`
}
// NewKeyGroup registers a new resource with the given unique name, arguments, and options.
func NewKeyGroup(ctx *pulumi.Context,
name string, args *KeyGroupArgs, opts ...pulumi.ResourceOption) (*KeyGroup, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Items == nil {
return nil, errors.New("invalid value for required argument 'Items'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource KeyGroup
err := ctx.RegisterResource("aws:cloudfront/keyGroup:KeyGroup", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetKeyGroup gets an existing KeyGroup 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 GetKeyGroup(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *KeyGroupState, opts ...pulumi.ResourceOption) (*KeyGroup, error) {
var resource KeyGroup
err := ctx.ReadResource("aws:cloudfront/keyGroup:KeyGroup", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering KeyGroup resources.
type keyGroupState struct {
// A comment to describe the key group..
Comment *string `pulumi:"comment"`
// The identifier for this version of the key group.
Etag *string `pulumi:"etag"`
// A list of the identifiers of the public keys in the key group.
Items []string `pulumi:"items"`
// A name to identify the key group.
Name *string `pulumi:"name"`
}
type KeyGroupState struct {
// A comment to describe the key group..
Comment pulumi.StringPtrInput
// The identifier for this version of the key group.
Etag pulumi.StringPtrInput
// A list of the identifiers of the public keys in the key group.
Items pulumi.StringArrayInput
// A name to identify the key group.
Name pulumi.StringPtrInput
}
func (KeyGroupState) ElementType() reflect.Type {
return reflect.TypeOf((*keyGroupState)(nil)).Elem()
}
type keyGroupArgs struct {
// A comment to describe the key group..
Comment *string `pulumi:"comment"`
// A list of the identifiers of the public keys in the key group.
Items []string `pulumi:"items"`
// A name to identify the key group.
Name *string `pulumi:"name"`
}
// The set of arguments for constructing a KeyGroup resource.
type KeyGroupArgs struct {
// A comment to describe the key group..
Comment pulumi.StringPtrInput
// A list of the identifiers of the public keys in the key group.
Items pulumi.StringArrayInput
// A name to identify the key group.
Name pulumi.StringPtrInput
}
func (KeyGroupArgs) ElementType() reflect.Type {
return reflect.TypeOf((*keyGroupArgs)(nil)).Elem()
}
type KeyGroupInput interface {
pulumi.Input
ToKeyGroupOutput() KeyGroupOutput
ToKeyGroupOutputWithContext(ctx context.Context) KeyGroupOutput
}
func (*KeyGroup) ElementType() reflect.Type {
return reflect.TypeOf((**KeyGroup)(nil)).Elem()
}
func (i *KeyGroup) ToKeyGroupOutput() KeyGroupOutput {
return i.ToKeyGroupOutputWithContext(context.Background())
}
func (i *KeyGroup) ToKeyGroupOutputWithContext(ctx context.Context) KeyGroupOutput {
return pulumi.ToOutputWithContext(ctx, i).(KeyGroupOutput)
}
// KeyGroupArrayInput is an input type that accepts KeyGroupArray and KeyGroupArrayOutput values.
// You can construct a concrete instance of `KeyGroupArrayInput` via:
//
// KeyGroupArray{ KeyGroupArgs{...} }
type KeyGroupArrayInput interface {
pulumi.Input
ToKeyGroupArrayOutput() KeyGroupArrayOutput
ToKeyGroupArrayOutputWithContext(context.Context) KeyGroupArrayOutput
}
type KeyGroupArray []KeyGroupInput
func (KeyGroupArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*KeyGroup)(nil)).Elem()
}
func (i KeyGroupArray) ToKeyGroupArrayOutput() KeyGroupArrayOutput {
return i.ToKeyGroupArrayOutputWithContext(context.Background())
}
func (i KeyGroupArray) ToKeyGroupArrayOutputWithContext(ctx context.Context) KeyGroupArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(KeyGroupArrayOutput)
}
// KeyGroupMapInput is an input type that accepts KeyGroupMap and KeyGroupMapOutput values.
// You can construct a concrete instance of `KeyGroupMapInput` via:
//
// KeyGroupMap{ "key": KeyGroupArgs{...} }
type KeyGroupMapInput interface {
pulumi.Input
ToKeyGroupMapOutput() KeyGroupMapOutput
ToKeyGroupMapOutputWithContext(context.Context) KeyGroupMapOutput
}
type KeyGroupMap map[string]KeyGroupInput
func (KeyGroupMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*KeyGroup)(nil)).Elem()
}
func (i KeyGroupMap) ToKeyGroupMapOutput() KeyGroupMapOutput {
return i.ToKeyGroupMapOutputWithContext(context.Background())
}
func (i KeyGroupMap) ToKeyGroupMapOutputWithContext(ctx context.Context) KeyGroupMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(KeyGroupMapOutput)
}
type KeyGroupOutput struct{ *pulumi.OutputState }
func (KeyGroupOutput) ElementType() reflect.Type {
return reflect.TypeOf((**KeyGroup)(nil)).Elem()
}
func (o KeyGroupOutput) ToKeyGroupOutput() KeyGroupOutput {
return o
}
func (o KeyGroupOutput) ToKeyGroupOutputWithContext(ctx context.Context) KeyGroupOutput {
return o
}
// A comment to describe the key group..
func (o KeyGroupOutput) Comment() pulumi.StringPtrOutput {
return o.ApplyT(func(v *KeyGroup) pulumi.StringPtrOutput { return v.Comment }).(pulumi.StringPtrOutput)
}
// The identifier for this version of the key group.
func (o KeyGroupOutput) Etag() pulumi.StringOutput {
return o.ApplyT(func(v *KeyGroup) pulumi.StringOutput { return v.Etag }).(pulumi.StringOutput)
}
// A list of the identifiers of the public keys in the key group.
func (o KeyGroupOutput) Items() pulumi.StringArrayOutput {
return o.ApplyT(func(v *KeyGroup) pulumi.StringArrayOutput { return v.Items }).(pulumi.StringArrayOutput)
}
// A name to identify the key group.
func (o KeyGroupOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *KeyGroup) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
type KeyGroupArrayOutput struct{ *pulumi.OutputState }
func (KeyGroupArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*KeyGroup)(nil)).Elem()
}
func (o KeyGroupArrayOutput) ToKeyGroupArrayOutput() KeyGroupArrayOutput {
return o
}
func (o KeyGroupArrayOutput) ToKeyGroupArrayOutputWithContext(ctx context.Context) KeyGroupArrayOutput {
return o
}
func (o KeyGroupArrayOutput) Index(i pulumi.IntInput) KeyGroupOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *KeyGroup {
return vs[0].([]*KeyGroup)[vs[1].(int)]
}).(KeyGroupOutput)
}
type KeyGroupMapOutput struct{ *pulumi.OutputState }
func (KeyGroupMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*KeyGroup)(nil)).Elem()
}
func (o KeyGroupMapOutput) ToKeyGroupMapOutput() KeyGroupMapOutput {
return o
}
func (o KeyGroupMapOutput) ToKeyGroupMapOutputWithContext(ctx context.Context) KeyGroupMapOutput {
return o
}
func (o KeyGroupMapOutput) MapIndex(k pulumi.StringInput) KeyGroupOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *KeyGroup {
return vs[0].(map[string]*KeyGroup)[vs[1].(string)]
}).(KeyGroupOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*KeyGroupInput)(nil)).Elem(), &KeyGroup{})
pulumi.RegisterInputType(reflect.TypeOf((*KeyGroupArrayInput)(nil)).Elem(), KeyGroupArray{})
pulumi.RegisterInputType(reflect.TypeOf((*KeyGroupMapInput)(nil)).Elem(), KeyGroupMap{})
pulumi.RegisterOutputType(KeyGroupOutput{})
pulumi.RegisterOutputType(KeyGroupArrayOutput{})
pulumi.RegisterOutputType(KeyGroupMapOutput{})
}