-
Notifications
You must be signed in to change notification settings - Fork 152
/
component.go
379 lines (333 loc) · 14.7 KB
/
component.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
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
// *** 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 imagebuilder
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages an Image Builder Component.
//
// ## Example Usage
// ### URI Document
//
// ```go
// package main
//
// import (
// "fmt"
//
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/imagebuilder"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := imagebuilder.NewComponent(ctx, "example", &imagebuilder.ComponentArgs{
// Platform: pulumi.String("Linux"),
// Uri: pulumi.String(fmt.Sprintf("%v%v%v%v", "s3://", aws_s3_bucket_object.Example.Bucket, "/", aws_s3_bucket_object.Example.Key)),
// Version: pulumi.String("1.0.0"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// `aws_imagebuilder_components` resources can be imported by using the Amazon Resource Name (ARN), e.g.,
//
// ```sh
// $ pulumi import aws:imagebuilder/component:Component example arn:aws:imagebuilder:us-east-1:123456789012:component/example/1.0.0/1
// ```
//
// Certain resource arguments, such as `uri`, cannot be read via the API and imported into the provider. The provider will display a difference for these arguments the first run after import if declared in the the provider configuration for an imported resource.
type Component struct {
pulumi.CustomResourceState
// (Required) Amazon Resource Name (ARN) of the component.
Arn pulumi.StringOutput `pulumi:"arn"`
// Change description of the component.
ChangeDescription pulumi.StringPtrOutput `pulumi:"changeDescription"`
// Inline YAML string with data of the component. Exactly one of `data` and `uri` can be specified. the provider will only perform drift detection of its value when present in a configuration.
Data pulumi.StringOutput `pulumi:"data"`
// Date the component was created.
DateCreated pulumi.StringOutput `pulumi:"dateCreated"`
// Description of the component.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Encryption status of the component.
Encrypted pulumi.BoolOutput `pulumi:"encrypted"`
// Amazon Resource Name (ARN) of the Key Management Service (KMS) Key used to encrypt the component.
KmsKeyId pulumi.StringPtrOutput `pulumi:"kmsKeyId"`
// Name of the component.
Name pulumi.StringOutput `pulumi:"name"`
// Owner of the component.
Owner pulumi.StringOutput `pulumi:"owner"`
// Platform of the component.
Platform pulumi.StringOutput `pulumi:"platform"`
// Set of Operating Systems (OS) supported by the component.
SupportedOsVersions pulumi.StringArrayOutput `pulumi:"supportedOsVersions"`
// Key-value map of resource tags for the component. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider .
TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
// Type of the component.
Type pulumi.StringOutput `pulumi:"type"`
// S3 URI with data of the component. Exactly one of `data` and `uri` can be specified.
Uri pulumi.StringPtrOutput `pulumi:"uri"`
// Version of the component.
Version pulumi.StringOutput `pulumi:"version"`
}
// NewComponent registers a new resource with the given unique name, arguments, and options.
func NewComponent(ctx *pulumi.Context,
name string, args *ComponentArgs, opts ...pulumi.ResourceOption) (*Component, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Platform == nil {
return nil, errors.New("invalid value for required argument 'Platform'")
}
if args.Version == nil {
return nil, errors.New("invalid value for required argument 'Version'")
}
var resource Component
err := ctx.RegisterResource("aws:imagebuilder/component:Component", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetComponent gets an existing Component 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 GetComponent(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ComponentState, opts ...pulumi.ResourceOption) (*Component, error) {
var resource Component
err := ctx.ReadResource("aws:imagebuilder/component:Component", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Component resources.
type componentState struct {
// (Required) Amazon Resource Name (ARN) of the component.
Arn *string `pulumi:"arn"`
// Change description of the component.
ChangeDescription *string `pulumi:"changeDescription"`
// Inline YAML string with data of the component. Exactly one of `data` and `uri` can be specified. the provider will only perform drift detection of its value when present in a configuration.
Data *string `pulumi:"data"`
// Date the component was created.
DateCreated *string `pulumi:"dateCreated"`
// Description of the component.
Description *string `pulumi:"description"`
// Encryption status of the component.
Encrypted *bool `pulumi:"encrypted"`
// Amazon Resource Name (ARN) of the Key Management Service (KMS) Key used to encrypt the component.
KmsKeyId *string `pulumi:"kmsKeyId"`
// Name of the component.
Name *string `pulumi:"name"`
// Owner of the component.
Owner *string `pulumi:"owner"`
// Platform of the component.
Platform *string `pulumi:"platform"`
// Set of Operating Systems (OS) supported by the component.
SupportedOsVersions []string `pulumi:"supportedOsVersions"`
// Key-value map of resource tags for the component. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider .
TagsAll map[string]string `pulumi:"tagsAll"`
// Type of the component.
Type *string `pulumi:"type"`
// S3 URI with data of the component. Exactly one of `data` and `uri` can be specified.
Uri *string `pulumi:"uri"`
// Version of the component.
Version *string `pulumi:"version"`
}
type ComponentState struct {
// (Required) Amazon Resource Name (ARN) of the component.
Arn pulumi.StringPtrInput
// Change description of the component.
ChangeDescription pulumi.StringPtrInput
// Inline YAML string with data of the component. Exactly one of `data` and `uri` can be specified. the provider will only perform drift detection of its value when present in a configuration.
Data pulumi.StringPtrInput
// Date the component was created.
DateCreated pulumi.StringPtrInput
// Description of the component.
Description pulumi.StringPtrInput
// Encryption status of the component.
Encrypted pulumi.BoolPtrInput
// Amazon Resource Name (ARN) of the Key Management Service (KMS) Key used to encrypt the component.
KmsKeyId pulumi.StringPtrInput
// Name of the component.
Name pulumi.StringPtrInput
// Owner of the component.
Owner pulumi.StringPtrInput
// Platform of the component.
Platform pulumi.StringPtrInput
// Set of Operating Systems (OS) supported by the component.
SupportedOsVersions pulumi.StringArrayInput
// Key-value map of resource tags for the component. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
// A map of tags assigned to the resource, including those inherited from the provider .
TagsAll pulumi.StringMapInput
// Type of the component.
Type pulumi.StringPtrInput
// S3 URI with data of the component. Exactly one of `data` and `uri` can be specified.
Uri pulumi.StringPtrInput
// Version of the component.
Version pulumi.StringPtrInput
}
func (ComponentState) ElementType() reflect.Type {
return reflect.TypeOf((*componentState)(nil)).Elem()
}
type componentArgs struct {
// Change description of the component.
ChangeDescription *string `pulumi:"changeDescription"`
// Inline YAML string with data of the component. Exactly one of `data` and `uri` can be specified. the provider will only perform drift detection of its value when present in a configuration.
Data *string `pulumi:"data"`
// Description of the component.
Description *string `pulumi:"description"`
// Amazon Resource Name (ARN) of the Key Management Service (KMS) Key used to encrypt the component.
KmsKeyId *string `pulumi:"kmsKeyId"`
// Name of the component.
Name *string `pulumi:"name"`
// Platform of the component.
Platform string `pulumi:"platform"`
// Set of Operating Systems (OS) supported by the component.
SupportedOsVersions []string `pulumi:"supportedOsVersions"`
// Key-value map of resource tags for the component. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
// S3 URI with data of the component. Exactly one of `data` and `uri` can be specified.
Uri *string `pulumi:"uri"`
// Version of the component.
Version string `pulumi:"version"`
}
// The set of arguments for constructing a Component resource.
type ComponentArgs struct {
// Change description of the component.
ChangeDescription pulumi.StringPtrInput
// Inline YAML string with data of the component. Exactly one of `data` and `uri` can be specified. the provider will only perform drift detection of its value when present in a configuration.
Data pulumi.StringPtrInput
// Description of the component.
Description pulumi.StringPtrInput
// Amazon Resource Name (ARN) of the Key Management Service (KMS) Key used to encrypt the component.
KmsKeyId pulumi.StringPtrInput
// Name of the component.
Name pulumi.StringPtrInput
// Platform of the component.
Platform pulumi.StringInput
// Set of Operating Systems (OS) supported by the component.
SupportedOsVersions pulumi.StringArrayInput
// Key-value map of resource tags for the component. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
// S3 URI with data of the component. Exactly one of `data` and `uri` can be specified.
Uri pulumi.StringPtrInput
// Version of the component.
Version pulumi.StringInput
}
func (ComponentArgs) ElementType() reflect.Type {
return reflect.TypeOf((*componentArgs)(nil)).Elem()
}
type ComponentInput interface {
pulumi.Input
ToComponentOutput() ComponentOutput
ToComponentOutputWithContext(ctx context.Context) ComponentOutput
}
func (*Component) ElementType() reflect.Type {
return reflect.TypeOf((**Component)(nil)).Elem()
}
func (i *Component) ToComponentOutput() ComponentOutput {
return i.ToComponentOutputWithContext(context.Background())
}
func (i *Component) ToComponentOutputWithContext(ctx context.Context) ComponentOutput {
return pulumi.ToOutputWithContext(ctx, i).(ComponentOutput)
}
// ComponentArrayInput is an input type that accepts ComponentArray and ComponentArrayOutput values.
// You can construct a concrete instance of `ComponentArrayInput` via:
//
// ComponentArray{ ComponentArgs{...} }
type ComponentArrayInput interface {
pulumi.Input
ToComponentArrayOutput() ComponentArrayOutput
ToComponentArrayOutputWithContext(context.Context) ComponentArrayOutput
}
type ComponentArray []ComponentInput
func (ComponentArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Component)(nil)).Elem()
}
func (i ComponentArray) ToComponentArrayOutput() ComponentArrayOutput {
return i.ToComponentArrayOutputWithContext(context.Background())
}
func (i ComponentArray) ToComponentArrayOutputWithContext(ctx context.Context) ComponentArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ComponentArrayOutput)
}
// ComponentMapInput is an input type that accepts ComponentMap and ComponentMapOutput values.
// You can construct a concrete instance of `ComponentMapInput` via:
//
// ComponentMap{ "key": ComponentArgs{...} }
type ComponentMapInput interface {
pulumi.Input
ToComponentMapOutput() ComponentMapOutput
ToComponentMapOutputWithContext(context.Context) ComponentMapOutput
}
type ComponentMap map[string]ComponentInput
func (ComponentMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Component)(nil)).Elem()
}
func (i ComponentMap) ToComponentMapOutput() ComponentMapOutput {
return i.ToComponentMapOutputWithContext(context.Background())
}
func (i ComponentMap) ToComponentMapOutputWithContext(ctx context.Context) ComponentMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ComponentMapOutput)
}
type ComponentOutput struct{ *pulumi.OutputState }
func (ComponentOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Component)(nil)).Elem()
}
func (o ComponentOutput) ToComponentOutput() ComponentOutput {
return o
}
func (o ComponentOutput) ToComponentOutputWithContext(ctx context.Context) ComponentOutput {
return o
}
type ComponentArrayOutput struct{ *pulumi.OutputState }
func (ComponentArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Component)(nil)).Elem()
}
func (o ComponentArrayOutput) ToComponentArrayOutput() ComponentArrayOutput {
return o
}
func (o ComponentArrayOutput) ToComponentArrayOutputWithContext(ctx context.Context) ComponentArrayOutput {
return o
}
func (o ComponentArrayOutput) Index(i pulumi.IntInput) ComponentOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Component {
return vs[0].([]*Component)[vs[1].(int)]
}).(ComponentOutput)
}
type ComponentMapOutput struct{ *pulumi.OutputState }
func (ComponentMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Component)(nil)).Elem()
}
func (o ComponentMapOutput) ToComponentMapOutput() ComponentMapOutput {
return o
}
func (o ComponentMapOutput) ToComponentMapOutputWithContext(ctx context.Context) ComponentMapOutput {
return o
}
func (o ComponentMapOutput) MapIndex(k pulumi.StringInput) ComponentOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Component {
return vs[0].(map[string]*Component)[vs[1].(string)]
}).(ComponentOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ComponentInput)(nil)).Elem(), &Component{})
pulumi.RegisterInputType(reflect.TypeOf((*ComponentArrayInput)(nil)).Elem(), ComponentArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ComponentMapInput)(nil)).Elem(), ComponentMap{})
pulumi.RegisterOutputType(ComponentOutput{})
pulumi.RegisterOutputType(ComponentArrayOutput{})
pulumi.RegisterOutputType(ComponentMapOutput{})
}