-
Notifications
You must be signed in to change notification settings - Fork 151
/
imageBuilder.go
399 lines (353 loc) · 17.5 KB
/
imageBuilder.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
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
// *** 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 appstream
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides an AppStream image builder.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/appstream"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := appstream.NewImageBuilder(ctx, "testFleet", &appstream.ImageBuilderArgs{
// Description: pulumi.String("Description of a ImageBuilder"),
// DisplayName: pulumi.String("Display name of a ImageBuilder"),
// EnableDefaultInternetAccess: pulumi.Bool(false),
// ImageName: pulumi.String("AppStream-WinServer2012R2-07-19-2021"),
// InstanceType: pulumi.String("stream.standard.large"),
// VpcConfig: &appstream.ImageBuilderVpcConfigArgs{
// SubnetIds: pulumi.StringArray{
// pulumi.Any(aws_subnet.Example.Id),
// },
// },
// Tags: pulumi.StringMap{
// "Name": pulumi.String("Example Image Builder"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// `aws_appstream_image_builder` can be imported using the `name`, e.g.,
//
// ```sh
// $ pulumi import aws:appstream/imageBuilder:ImageBuilder example imageBuilderExample
// ```
type ImageBuilder struct {
pulumi.CustomResourceState
// Set of interface VPC endpoint (interface endpoint) objects. Maximum of 4. See below.
AccessEndpoints ImageBuilderAccessEndpointArrayOutput `pulumi:"accessEndpoints"`
// The version of the AppStream 2.0 agent to use for this image builder.
AppstreamAgentVersion pulumi.StringOutput `pulumi:"appstreamAgentVersion"`
// ARN of the appstream image builder.
Arn pulumi.StringOutput `pulumi:"arn"`
// Date and time, in UTC and extended RFC 3339 format, when the image builder was created.
CreatedTime pulumi.StringOutput `pulumi:"createdTime"`
// Description to display.
Description pulumi.StringOutput `pulumi:"description"`
// Human-readable friendly name for the AppStream image builder.
DisplayName pulumi.StringOutput `pulumi:"displayName"`
// Configuration block for the name of the directory and organizational unit (OU) to use to join the image builder to a Microsoft Active Directory domain. See below.
DomainJoinInfo ImageBuilderDomainJoinInfoOutput `pulumi:"domainJoinInfo"`
// Enables or disables default internet access for the image builder.
EnableDefaultInternetAccess pulumi.BoolOutput `pulumi:"enableDefaultInternetAccess"`
// ARN of the IAM role to apply to the image builder.
IamRoleArn pulumi.StringOutput `pulumi:"iamRoleArn"`
// ARN of the public, private, or shared image to use.
ImageArn pulumi.StringOutput `pulumi:"imageArn"`
// Name of the image used to create the image builder.
ImageName pulumi.StringOutput `pulumi:"imageName"`
// The instance type to use when launching the image builder.
InstanceType pulumi.StringOutput `pulumi:"instanceType"`
// Unique name for the image builder.
Name pulumi.StringOutput `pulumi:"name"`
// State of the image builder. Can be: `PENDING`, `UPDATING_AGENT`, `RUNNING`, `STOPPING`, `STOPPED`, `REBOOTING`, `SNAPSHOTTING`, `DELETING`, `FAILED`, `UPDATING`, `PENDING_QUALIFICATION`
State pulumi.StringOutput `pulumi:"state"`
// A map of tags to assign to the instance. 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 `defaultTags` configuration block.
TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
// Configuration block for the VPC configuration for the image builder. See below.
VpcConfig ImageBuilderVpcConfigOutput `pulumi:"vpcConfig"`
}
// NewImageBuilder registers a new resource with the given unique name, arguments, and options.
func NewImageBuilder(ctx *pulumi.Context,
name string, args *ImageBuilderArgs, opts ...pulumi.ResourceOption) (*ImageBuilder, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.InstanceType == nil {
return nil, errors.New("invalid value for required argument 'InstanceType'")
}
var resource ImageBuilder
err := ctx.RegisterResource("aws:appstream/imageBuilder:ImageBuilder", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetImageBuilder gets an existing ImageBuilder 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 GetImageBuilder(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ImageBuilderState, opts ...pulumi.ResourceOption) (*ImageBuilder, error) {
var resource ImageBuilder
err := ctx.ReadResource("aws:appstream/imageBuilder:ImageBuilder", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ImageBuilder resources.
type imageBuilderState struct {
// Set of interface VPC endpoint (interface endpoint) objects. Maximum of 4. See below.
AccessEndpoints []ImageBuilderAccessEndpoint `pulumi:"accessEndpoints"`
// The version of the AppStream 2.0 agent to use for this image builder.
AppstreamAgentVersion *string `pulumi:"appstreamAgentVersion"`
// ARN of the appstream image builder.
Arn *string `pulumi:"arn"`
// Date and time, in UTC and extended RFC 3339 format, when the image builder was created.
CreatedTime *string `pulumi:"createdTime"`
// Description to display.
Description *string `pulumi:"description"`
// Human-readable friendly name for the AppStream image builder.
DisplayName *string `pulumi:"displayName"`
// Configuration block for the name of the directory and organizational unit (OU) to use to join the image builder to a Microsoft Active Directory domain. See below.
DomainJoinInfo *ImageBuilderDomainJoinInfo `pulumi:"domainJoinInfo"`
// Enables or disables default internet access for the image builder.
EnableDefaultInternetAccess *bool `pulumi:"enableDefaultInternetAccess"`
// ARN of the IAM role to apply to the image builder.
IamRoleArn *string `pulumi:"iamRoleArn"`
// ARN of the public, private, or shared image to use.
ImageArn *string `pulumi:"imageArn"`
// Name of the image used to create the image builder.
ImageName *string `pulumi:"imageName"`
// The instance type to use when launching the image builder.
InstanceType *string `pulumi:"instanceType"`
// Unique name for the image builder.
Name *string `pulumi:"name"`
// State of the image builder. Can be: `PENDING`, `UPDATING_AGENT`, `RUNNING`, `STOPPING`, `STOPPED`, `REBOOTING`, `SNAPSHOTTING`, `DELETING`, `FAILED`, `UPDATING`, `PENDING_QUALIFICATION`
State *string `pulumi:"state"`
// A map of tags to assign to the instance. 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 `defaultTags` configuration block.
TagsAll map[string]string `pulumi:"tagsAll"`
// Configuration block for the VPC configuration for the image builder. See below.
VpcConfig *ImageBuilderVpcConfig `pulumi:"vpcConfig"`
}
type ImageBuilderState struct {
// Set of interface VPC endpoint (interface endpoint) objects. Maximum of 4. See below.
AccessEndpoints ImageBuilderAccessEndpointArrayInput
// The version of the AppStream 2.0 agent to use for this image builder.
AppstreamAgentVersion pulumi.StringPtrInput
// ARN of the appstream image builder.
Arn pulumi.StringPtrInput
// Date and time, in UTC and extended RFC 3339 format, when the image builder was created.
CreatedTime pulumi.StringPtrInput
// Description to display.
Description pulumi.StringPtrInput
// Human-readable friendly name for the AppStream image builder.
DisplayName pulumi.StringPtrInput
// Configuration block for the name of the directory and organizational unit (OU) to use to join the image builder to a Microsoft Active Directory domain. See below.
DomainJoinInfo ImageBuilderDomainJoinInfoPtrInput
// Enables or disables default internet access for the image builder.
EnableDefaultInternetAccess pulumi.BoolPtrInput
// ARN of the IAM role to apply to the image builder.
IamRoleArn pulumi.StringPtrInput
// ARN of the public, private, or shared image to use.
ImageArn pulumi.StringPtrInput
// Name of the image used to create the image builder.
ImageName pulumi.StringPtrInput
// The instance type to use when launching the image builder.
InstanceType pulumi.StringPtrInput
// Unique name for the image builder.
Name pulumi.StringPtrInput
// State of the image builder. Can be: `PENDING`, `UPDATING_AGENT`, `RUNNING`, `STOPPING`, `STOPPED`, `REBOOTING`, `SNAPSHOTTING`, `DELETING`, `FAILED`, `UPDATING`, `PENDING_QUALIFICATION`
State pulumi.StringPtrInput
// A map of tags to assign to the instance. 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 `defaultTags` configuration block.
TagsAll pulumi.StringMapInput
// Configuration block for the VPC configuration for the image builder. See below.
VpcConfig ImageBuilderVpcConfigPtrInput
}
func (ImageBuilderState) ElementType() reflect.Type {
return reflect.TypeOf((*imageBuilderState)(nil)).Elem()
}
type imageBuilderArgs struct {
// Set of interface VPC endpoint (interface endpoint) objects. Maximum of 4. See below.
AccessEndpoints []ImageBuilderAccessEndpoint `pulumi:"accessEndpoints"`
// The version of the AppStream 2.0 agent to use for this image builder.
AppstreamAgentVersion *string `pulumi:"appstreamAgentVersion"`
// Description to display.
Description *string `pulumi:"description"`
// Human-readable friendly name for the AppStream image builder.
DisplayName *string `pulumi:"displayName"`
// Configuration block for the name of the directory and organizational unit (OU) to use to join the image builder to a Microsoft Active Directory domain. See below.
DomainJoinInfo *ImageBuilderDomainJoinInfo `pulumi:"domainJoinInfo"`
// Enables or disables default internet access for the image builder.
EnableDefaultInternetAccess *bool `pulumi:"enableDefaultInternetAccess"`
// ARN of the IAM role to apply to the image builder.
IamRoleArn *string `pulumi:"iamRoleArn"`
// ARN of the public, private, or shared image to use.
ImageArn *string `pulumi:"imageArn"`
// Name of the image used to create the image builder.
ImageName *string `pulumi:"imageName"`
// The instance type to use when launching the image builder.
InstanceType string `pulumi:"instanceType"`
// Unique name for the image builder.
Name *string `pulumi:"name"`
// A map of tags to assign to the instance. 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"`
// Configuration block for the VPC configuration for the image builder. See below.
VpcConfig *ImageBuilderVpcConfig `pulumi:"vpcConfig"`
}
// The set of arguments for constructing a ImageBuilder resource.
type ImageBuilderArgs struct {
// Set of interface VPC endpoint (interface endpoint) objects. Maximum of 4. See below.
AccessEndpoints ImageBuilderAccessEndpointArrayInput
// The version of the AppStream 2.0 agent to use for this image builder.
AppstreamAgentVersion pulumi.StringPtrInput
// Description to display.
Description pulumi.StringPtrInput
// Human-readable friendly name for the AppStream image builder.
DisplayName pulumi.StringPtrInput
// Configuration block for the name of the directory and organizational unit (OU) to use to join the image builder to a Microsoft Active Directory domain. See below.
DomainJoinInfo ImageBuilderDomainJoinInfoPtrInput
// Enables or disables default internet access for the image builder.
EnableDefaultInternetAccess pulumi.BoolPtrInput
// ARN of the IAM role to apply to the image builder.
IamRoleArn pulumi.StringPtrInput
// ARN of the public, private, or shared image to use.
ImageArn pulumi.StringPtrInput
// Name of the image used to create the image builder.
ImageName pulumi.StringPtrInput
// The instance type to use when launching the image builder.
InstanceType pulumi.StringInput
// Unique name for the image builder.
Name pulumi.StringPtrInput
// A map of tags to assign to the instance. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
// Configuration block for the VPC configuration for the image builder. See below.
VpcConfig ImageBuilderVpcConfigPtrInput
}
func (ImageBuilderArgs) ElementType() reflect.Type {
return reflect.TypeOf((*imageBuilderArgs)(nil)).Elem()
}
type ImageBuilderInput interface {
pulumi.Input
ToImageBuilderOutput() ImageBuilderOutput
ToImageBuilderOutputWithContext(ctx context.Context) ImageBuilderOutput
}
func (*ImageBuilder) ElementType() reflect.Type {
return reflect.TypeOf((**ImageBuilder)(nil)).Elem()
}
func (i *ImageBuilder) ToImageBuilderOutput() ImageBuilderOutput {
return i.ToImageBuilderOutputWithContext(context.Background())
}
func (i *ImageBuilder) ToImageBuilderOutputWithContext(ctx context.Context) ImageBuilderOutput {
return pulumi.ToOutputWithContext(ctx, i).(ImageBuilderOutput)
}
// ImageBuilderArrayInput is an input type that accepts ImageBuilderArray and ImageBuilderArrayOutput values.
// You can construct a concrete instance of `ImageBuilderArrayInput` via:
//
// ImageBuilderArray{ ImageBuilderArgs{...} }
type ImageBuilderArrayInput interface {
pulumi.Input
ToImageBuilderArrayOutput() ImageBuilderArrayOutput
ToImageBuilderArrayOutputWithContext(context.Context) ImageBuilderArrayOutput
}
type ImageBuilderArray []ImageBuilderInput
func (ImageBuilderArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ImageBuilder)(nil)).Elem()
}
func (i ImageBuilderArray) ToImageBuilderArrayOutput() ImageBuilderArrayOutput {
return i.ToImageBuilderArrayOutputWithContext(context.Background())
}
func (i ImageBuilderArray) ToImageBuilderArrayOutputWithContext(ctx context.Context) ImageBuilderArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ImageBuilderArrayOutput)
}
// ImageBuilderMapInput is an input type that accepts ImageBuilderMap and ImageBuilderMapOutput values.
// You can construct a concrete instance of `ImageBuilderMapInput` via:
//
// ImageBuilderMap{ "key": ImageBuilderArgs{...} }
type ImageBuilderMapInput interface {
pulumi.Input
ToImageBuilderMapOutput() ImageBuilderMapOutput
ToImageBuilderMapOutputWithContext(context.Context) ImageBuilderMapOutput
}
type ImageBuilderMap map[string]ImageBuilderInput
func (ImageBuilderMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ImageBuilder)(nil)).Elem()
}
func (i ImageBuilderMap) ToImageBuilderMapOutput() ImageBuilderMapOutput {
return i.ToImageBuilderMapOutputWithContext(context.Background())
}
func (i ImageBuilderMap) ToImageBuilderMapOutputWithContext(ctx context.Context) ImageBuilderMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ImageBuilderMapOutput)
}
type ImageBuilderOutput struct{ *pulumi.OutputState }
func (ImageBuilderOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ImageBuilder)(nil)).Elem()
}
func (o ImageBuilderOutput) ToImageBuilderOutput() ImageBuilderOutput {
return o
}
func (o ImageBuilderOutput) ToImageBuilderOutputWithContext(ctx context.Context) ImageBuilderOutput {
return o
}
type ImageBuilderArrayOutput struct{ *pulumi.OutputState }
func (ImageBuilderArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ImageBuilder)(nil)).Elem()
}
func (o ImageBuilderArrayOutput) ToImageBuilderArrayOutput() ImageBuilderArrayOutput {
return o
}
func (o ImageBuilderArrayOutput) ToImageBuilderArrayOutputWithContext(ctx context.Context) ImageBuilderArrayOutput {
return o
}
func (o ImageBuilderArrayOutput) Index(i pulumi.IntInput) ImageBuilderOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ImageBuilder {
return vs[0].([]*ImageBuilder)[vs[1].(int)]
}).(ImageBuilderOutput)
}
type ImageBuilderMapOutput struct{ *pulumi.OutputState }
func (ImageBuilderMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ImageBuilder)(nil)).Elem()
}
func (o ImageBuilderMapOutput) ToImageBuilderMapOutput() ImageBuilderMapOutput {
return o
}
func (o ImageBuilderMapOutput) ToImageBuilderMapOutputWithContext(ctx context.Context) ImageBuilderMapOutput {
return o
}
func (o ImageBuilderMapOutput) MapIndex(k pulumi.StringInput) ImageBuilderOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ImageBuilder {
return vs[0].(map[string]*ImageBuilder)[vs[1].(string)]
}).(ImageBuilderOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ImageBuilderInput)(nil)).Elem(), &ImageBuilder{})
pulumi.RegisterInputType(reflect.TypeOf((*ImageBuilderArrayInput)(nil)).Elem(), ImageBuilderArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ImageBuilderMapInput)(nil)).Elem(), ImageBuilderMap{})
pulumi.RegisterOutputType(ImageBuilderOutput{})
pulumi.RegisterOutputType(ImageBuilderArrayOutput{})
pulumi.RegisterOutputType(ImageBuilderMapOutput{})
}