/
imagePipeline.go
382 lines (336 loc) · 16.4 KB
/
imagePipeline.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
380
381
382
// *** 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 Image Pipeline.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "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.NewImagePipeline(ctx, "example", &imagebuilder.ImagePipelineArgs{
// ImageRecipeArn: pulumi.Any(aws_imagebuilder_image_recipe.Example.Arn),
// InfrastructureConfigurationArn: pulumi.Any(aws_imagebuilder_infrastructure_configuration.Example.Arn),
// Schedule: &imagebuilder.ImagePipelineScheduleArgs{
// ScheduleExpression: pulumi.String("cron(0 0 * * ? *)"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// `aws_imagebuilder_image_pipeline` resources can be imported using the Amazon Resource Name (ARN), e.g.,
//
// ```sh
// $ pulumi import aws:imagebuilder/imagePipeline:ImagePipeline example arn:aws:imagebuilder:us-east-1:123456789012:image-pipeline/example
// ```
type ImagePipeline struct {
pulumi.CustomResourceState
// Amazon Resource Name (ARN) of the image pipeline.
Arn pulumi.StringOutput `pulumi:"arn"`
// Date the image pipeline was created.
DateCreated pulumi.StringOutput `pulumi:"dateCreated"`
// Date the image pipeline was last run.
DateLastRun pulumi.StringOutput `pulumi:"dateLastRun"`
// Date the image pipeline will run next.
DateNextRun pulumi.StringOutput `pulumi:"dateNextRun"`
// Date the image pipeline was updated.
DateUpdated pulumi.StringOutput `pulumi:"dateUpdated"`
// Description of the image pipeline.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Amazon Resource Name (ARN) of the Image Builder Distribution Configuration.
DistributionConfigurationArn pulumi.StringPtrOutput `pulumi:"distributionConfigurationArn"`
// Whether additional information about the image being created is collected. Defaults to `true`.
EnhancedImageMetadataEnabled pulumi.BoolPtrOutput `pulumi:"enhancedImageMetadataEnabled"`
// Amazon Resource Name (ARN) of the Image Builder Infrastructure Recipe.
ImageRecipeArn pulumi.StringOutput `pulumi:"imageRecipeArn"`
// Configuration block with image tests configuration. Detailed below.
ImageTestsConfiguration ImagePipelineImageTestsConfigurationOutput `pulumi:"imageTestsConfiguration"`
// Amazon Resource Name (ARN) of the Image Builder Infrastructure Configuration.
InfrastructureConfigurationArn pulumi.StringOutput `pulumi:"infrastructureConfigurationArn"`
// Name of the image pipeline.
Name pulumi.StringOutput `pulumi:"name"`
// Platform of the image pipeline.
Platform pulumi.StringOutput `pulumi:"platform"`
// Configuration block with schedule settings. Detailed below.
Schedule ImagePipelineSchedulePtrOutput `pulumi:"schedule"`
// Status of the image pipeline. Valid values are `DISABLED` and `ENABLED`. Defaults to `ENABLED`.
Status pulumi.StringPtrOutput `pulumi:"status"`
// Key-value map of resource tags for the image pipeline. .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"`
}
// NewImagePipeline registers a new resource with the given unique name, arguments, and options.
func NewImagePipeline(ctx *pulumi.Context,
name string, args *ImagePipelineArgs, opts ...pulumi.ResourceOption) (*ImagePipeline, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ImageRecipeArn == nil {
return nil, errors.New("invalid value for required argument 'ImageRecipeArn'")
}
if args.InfrastructureConfigurationArn == nil {
return nil, errors.New("invalid value for required argument 'InfrastructureConfigurationArn'")
}
var resource ImagePipeline
err := ctx.RegisterResource("aws:imagebuilder/imagePipeline:ImagePipeline", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetImagePipeline gets an existing ImagePipeline 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 GetImagePipeline(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ImagePipelineState, opts ...pulumi.ResourceOption) (*ImagePipeline, error) {
var resource ImagePipeline
err := ctx.ReadResource("aws:imagebuilder/imagePipeline:ImagePipeline", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ImagePipeline resources.
type imagePipelineState struct {
// Amazon Resource Name (ARN) of the image pipeline.
Arn *string `pulumi:"arn"`
// Date the image pipeline was created.
DateCreated *string `pulumi:"dateCreated"`
// Date the image pipeline was last run.
DateLastRun *string `pulumi:"dateLastRun"`
// Date the image pipeline will run next.
DateNextRun *string `pulumi:"dateNextRun"`
// Date the image pipeline was updated.
DateUpdated *string `pulumi:"dateUpdated"`
// Description of the image pipeline.
Description *string `pulumi:"description"`
// Amazon Resource Name (ARN) of the Image Builder Distribution Configuration.
DistributionConfigurationArn *string `pulumi:"distributionConfigurationArn"`
// Whether additional information about the image being created is collected. Defaults to `true`.
EnhancedImageMetadataEnabled *bool `pulumi:"enhancedImageMetadataEnabled"`
// Amazon Resource Name (ARN) of the Image Builder Infrastructure Recipe.
ImageRecipeArn *string `pulumi:"imageRecipeArn"`
// Configuration block with image tests configuration. Detailed below.
ImageTestsConfiguration *ImagePipelineImageTestsConfiguration `pulumi:"imageTestsConfiguration"`
// Amazon Resource Name (ARN) of the Image Builder Infrastructure Configuration.
InfrastructureConfigurationArn *string `pulumi:"infrastructureConfigurationArn"`
// Name of the image pipeline.
Name *string `pulumi:"name"`
// Platform of the image pipeline.
Platform *string `pulumi:"platform"`
// Configuration block with schedule settings. Detailed below.
Schedule *ImagePipelineSchedule `pulumi:"schedule"`
// Status of the image pipeline. Valid values are `DISABLED` and `ENABLED`. Defaults to `ENABLED`.
Status *string `pulumi:"status"`
// Key-value map of resource tags for the image pipeline. .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 ImagePipelineState struct {
// Amazon Resource Name (ARN) of the image pipeline.
Arn pulumi.StringPtrInput
// Date the image pipeline was created.
DateCreated pulumi.StringPtrInput
// Date the image pipeline was last run.
DateLastRun pulumi.StringPtrInput
// Date the image pipeline will run next.
DateNextRun pulumi.StringPtrInput
// Date the image pipeline was updated.
DateUpdated pulumi.StringPtrInput
// Description of the image pipeline.
Description pulumi.StringPtrInput
// Amazon Resource Name (ARN) of the Image Builder Distribution Configuration.
DistributionConfigurationArn pulumi.StringPtrInput
// Whether additional information about the image being created is collected. Defaults to `true`.
EnhancedImageMetadataEnabled pulumi.BoolPtrInput
// Amazon Resource Name (ARN) of the Image Builder Infrastructure Recipe.
ImageRecipeArn pulumi.StringPtrInput
// Configuration block with image tests configuration. Detailed below.
ImageTestsConfiguration ImagePipelineImageTestsConfigurationPtrInput
// Amazon Resource Name (ARN) of the Image Builder Infrastructure Configuration.
InfrastructureConfigurationArn pulumi.StringPtrInput
// Name of the image pipeline.
Name pulumi.StringPtrInput
// Platform of the image pipeline.
Platform pulumi.StringPtrInput
// Configuration block with schedule settings. Detailed below.
Schedule ImagePipelineSchedulePtrInput
// Status of the image pipeline. Valid values are `DISABLED` and `ENABLED`. Defaults to `ENABLED`.
Status pulumi.StringPtrInput
// Key-value map of resource tags for the image pipeline. .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
}
func (ImagePipelineState) ElementType() reflect.Type {
return reflect.TypeOf((*imagePipelineState)(nil)).Elem()
}
type imagePipelineArgs struct {
// Description of the image pipeline.
Description *string `pulumi:"description"`
// Amazon Resource Name (ARN) of the Image Builder Distribution Configuration.
DistributionConfigurationArn *string `pulumi:"distributionConfigurationArn"`
// Whether additional information about the image being created is collected. Defaults to `true`.
EnhancedImageMetadataEnabled *bool `pulumi:"enhancedImageMetadataEnabled"`
// Amazon Resource Name (ARN) of the Image Builder Infrastructure Recipe.
ImageRecipeArn string `pulumi:"imageRecipeArn"`
// Configuration block with image tests configuration. Detailed below.
ImageTestsConfiguration *ImagePipelineImageTestsConfiguration `pulumi:"imageTestsConfiguration"`
// Amazon Resource Name (ARN) of the Image Builder Infrastructure Configuration.
InfrastructureConfigurationArn string `pulumi:"infrastructureConfigurationArn"`
// Name of the image pipeline.
Name *string `pulumi:"name"`
// Configuration block with schedule settings. Detailed below.
Schedule *ImagePipelineSchedule `pulumi:"schedule"`
// Status of the image pipeline. Valid values are `DISABLED` and `ENABLED`. Defaults to `ENABLED`.
Status *string `pulumi:"status"`
// Key-value map of resource tags for the image pipeline. .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"`
}
// The set of arguments for constructing a ImagePipeline resource.
type ImagePipelineArgs struct {
// Description of the image pipeline.
Description pulumi.StringPtrInput
// Amazon Resource Name (ARN) of the Image Builder Distribution Configuration.
DistributionConfigurationArn pulumi.StringPtrInput
// Whether additional information about the image being created is collected. Defaults to `true`.
EnhancedImageMetadataEnabled pulumi.BoolPtrInput
// Amazon Resource Name (ARN) of the Image Builder Infrastructure Recipe.
ImageRecipeArn pulumi.StringInput
// Configuration block with image tests configuration. Detailed below.
ImageTestsConfiguration ImagePipelineImageTestsConfigurationPtrInput
// Amazon Resource Name (ARN) of the Image Builder Infrastructure Configuration.
InfrastructureConfigurationArn pulumi.StringInput
// Name of the image pipeline.
Name pulumi.StringPtrInput
// Configuration block with schedule settings. Detailed below.
Schedule ImagePipelineSchedulePtrInput
// Status of the image pipeline. Valid values are `DISABLED` and `ENABLED`. Defaults to `ENABLED`.
Status pulumi.StringPtrInput
// Key-value map of resource tags for the image pipeline. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
}
func (ImagePipelineArgs) ElementType() reflect.Type {
return reflect.TypeOf((*imagePipelineArgs)(nil)).Elem()
}
type ImagePipelineInput interface {
pulumi.Input
ToImagePipelineOutput() ImagePipelineOutput
ToImagePipelineOutputWithContext(ctx context.Context) ImagePipelineOutput
}
func (*ImagePipeline) ElementType() reflect.Type {
return reflect.TypeOf((**ImagePipeline)(nil)).Elem()
}
func (i *ImagePipeline) ToImagePipelineOutput() ImagePipelineOutput {
return i.ToImagePipelineOutputWithContext(context.Background())
}
func (i *ImagePipeline) ToImagePipelineOutputWithContext(ctx context.Context) ImagePipelineOutput {
return pulumi.ToOutputWithContext(ctx, i).(ImagePipelineOutput)
}
// ImagePipelineArrayInput is an input type that accepts ImagePipelineArray and ImagePipelineArrayOutput values.
// You can construct a concrete instance of `ImagePipelineArrayInput` via:
//
// ImagePipelineArray{ ImagePipelineArgs{...} }
type ImagePipelineArrayInput interface {
pulumi.Input
ToImagePipelineArrayOutput() ImagePipelineArrayOutput
ToImagePipelineArrayOutputWithContext(context.Context) ImagePipelineArrayOutput
}
type ImagePipelineArray []ImagePipelineInput
func (ImagePipelineArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ImagePipeline)(nil)).Elem()
}
func (i ImagePipelineArray) ToImagePipelineArrayOutput() ImagePipelineArrayOutput {
return i.ToImagePipelineArrayOutputWithContext(context.Background())
}
func (i ImagePipelineArray) ToImagePipelineArrayOutputWithContext(ctx context.Context) ImagePipelineArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ImagePipelineArrayOutput)
}
// ImagePipelineMapInput is an input type that accepts ImagePipelineMap and ImagePipelineMapOutput values.
// You can construct a concrete instance of `ImagePipelineMapInput` via:
//
// ImagePipelineMap{ "key": ImagePipelineArgs{...} }
type ImagePipelineMapInput interface {
pulumi.Input
ToImagePipelineMapOutput() ImagePipelineMapOutput
ToImagePipelineMapOutputWithContext(context.Context) ImagePipelineMapOutput
}
type ImagePipelineMap map[string]ImagePipelineInput
func (ImagePipelineMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ImagePipeline)(nil)).Elem()
}
func (i ImagePipelineMap) ToImagePipelineMapOutput() ImagePipelineMapOutput {
return i.ToImagePipelineMapOutputWithContext(context.Background())
}
func (i ImagePipelineMap) ToImagePipelineMapOutputWithContext(ctx context.Context) ImagePipelineMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ImagePipelineMapOutput)
}
type ImagePipelineOutput struct{ *pulumi.OutputState }
func (ImagePipelineOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ImagePipeline)(nil)).Elem()
}
func (o ImagePipelineOutput) ToImagePipelineOutput() ImagePipelineOutput {
return o
}
func (o ImagePipelineOutput) ToImagePipelineOutputWithContext(ctx context.Context) ImagePipelineOutput {
return o
}
type ImagePipelineArrayOutput struct{ *pulumi.OutputState }
func (ImagePipelineArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ImagePipeline)(nil)).Elem()
}
func (o ImagePipelineArrayOutput) ToImagePipelineArrayOutput() ImagePipelineArrayOutput {
return o
}
func (o ImagePipelineArrayOutput) ToImagePipelineArrayOutputWithContext(ctx context.Context) ImagePipelineArrayOutput {
return o
}
func (o ImagePipelineArrayOutput) Index(i pulumi.IntInput) ImagePipelineOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ImagePipeline {
return vs[0].([]*ImagePipeline)[vs[1].(int)]
}).(ImagePipelineOutput)
}
type ImagePipelineMapOutput struct{ *pulumi.OutputState }
func (ImagePipelineMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ImagePipeline)(nil)).Elem()
}
func (o ImagePipelineMapOutput) ToImagePipelineMapOutput() ImagePipelineMapOutput {
return o
}
func (o ImagePipelineMapOutput) ToImagePipelineMapOutputWithContext(ctx context.Context) ImagePipelineMapOutput {
return o
}
func (o ImagePipelineMapOutput) MapIndex(k pulumi.StringInput) ImagePipelineOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ImagePipeline {
return vs[0].(map[string]*ImagePipeline)[vs[1].(string)]
}).(ImagePipelineOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ImagePipelineInput)(nil)).Elem(), &ImagePipeline{})
pulumi.RegisterInputType(reflect.TypeOf((*ImagePipelineArrayInput)(nil)).Elem(), ImagePipelineArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ImagePipelineMapInput)(nil)).Elem(), ImagePipelineMap{})
pulumi.RegisterOutputType(ImagePipelineOutput{})
pulumi.RegisterOutputType(ImagePipelineArrayOutput{})
pulumi.RegisterOutputType(ImagePipelineMapOutput{})
}