-
Notifications
You must be signed in to change notification settings - Fork 151
/
ami.go
542 lines (482 loc) · 22 KB
/
ami.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
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
// *** 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 ec2
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// The AMI resource allows the creation and management of a completely-custom
// *Amazon Machine Image* (AMI).
//
// If you just want to duplicate an existing AMI, possibly copying it to another
// region, it's better to use `ec2.AmiCopy` instead.
//
// If you just want to share an existing AMI with another AWS account,
// it's better to use `ec2.AmiLaunchPermission` instead.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := ec2.NewAmi(ctx, "example", &ec2.AmiArgs{
// EbsBlockDevices: ec2.AmiEbsBlockDeviceArray{
// &ec2.AmiEbsBlockDeviceArgs{
// DeviceName: pulumi.String("/dev/xvda"),
// SnapshotId: pulumi.String("snap-xxxxxxxx"),
// VolumeSize: pulumi.Int(8),
// },
// },
// RootDeviceName: pulumi.String("/dev/xvda"),
// VirtualizationType: pulumi.String("hvm"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// `aws_ami` can be imported using the ID of the AMI, e.g.
//
// ```sh
// $ pulumi import aws:ec2/ami:Ami example ami-12345678
// ```
type Ami struct {
pulumi.CustomResourceState
// Machine architecture for created instances. Defaults to "x8664".
Architecture pulumi.StringPtrOutput `pulumi:"architecture"`
// The ARN of the AMI.
Arn pulumi.StringOutput `pulumi:"arn"`
// A longer, human-readable description for the AMI.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Nested block describing an EBS block device that should be
// attached to created instances. The structure of this block is described below.
EbsBlockDevices AmiEbsBlockDeviceArrayOutput `pulumi:"ebsBlockDevices"`
// Specifies whether enhanced networking with ENA is enabled. Defaults to `false`.
EnaSupport pulumi.BoolPtrOutput `pulumi:"enaSupport"`
// Nested block describing an ephemeral block device that
// should be attached to created instances. The structure of this block is described below.
EphemeralBlockDevices AmiEphemeralBlockDeviceArrayOutput `pulumi:"ephemeralBlockDevices"`
// The hypervisor type of the image.
Hypervisor pulumi.StringOutput `pulumi:"hypervisor"`
// Path to an S3 object containing an image manifest, e.g. created
// by the `ec2-upload-bundle` command in the EC2 command line tools.
ImageLocation pulumi.StringOutput `pulumi:"imageLocation"`
// The AWS account alias (for example, amazon, self) or the AWS account ID of the AMI owner.
ImageOwnerAlias pulumi.StringOutput `pulumi:"imageOwnerAlias"`
// The type of image.
ImageType pulumi.StringOutput `pulumi:"imageType"`
// The id of the kernel image (AKI) that will be used as the paravirtual
// kernel in created instances.
KernelId pulumi.StringPtrOutput `pulumi:"kernelId"`
ManageEbsSnapshots pulumi.BoolOutput `pulumi:"manageEbsSnapshots"`
// A region-unique name for the AMI.
Name pulumi.StringOutput `pulumi:"name"`
// The AWS account ID of the image owner.
OwnerId pulumi.StringOutput `pulumi:"ownerId"`
// This value is set to windows for Windows AMIs; otherwise, it is blank.
Platform pulumi.StringOutput `pulumi:"platform"`
// The platform details associated with the billing code of the AMI.
PlatformDetails pulumi.StringOutput `pulumi:"platformDetails"`
// Indicates whether the image has public launch permissions.
Public pulumi.BoolOutput `pulumi:"public"`
// The id of an initrd image (ARI) that will be used when booting the
// created instances.
RamdiskId pulumi.StringPtrOutput `pulumi:"ramdiskId"`
// The name of the root device (for example, `/dev/sda1`, or `/dev/xvda`).
RootDeviceName pulumi.StringPtrOutput `pulumi:"rootDeviceName"`
// The Snapshot ID for the root volume (for EBS-backed AMIs)
RootSnapshotId pulumi.StringOutput `pulumi:"rootSnapshotId"`
// When set to "simple" (the default), enables enhanced networking
// for created instances. No other value is supported at this time.
SriovNetSupport pulumi.StringPtrOutput `pulumi:"sriovNetSupport"`
// A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-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"`
// The operation of the Amazon EC2 instance and the billing code that is associated with the AMI.
UsageOperation pulumi.StringOutput `pulumi:"usageOperation"`
// Keyword to choose what virtualization mode created instances
// will use. Can be either "paravirtual" (the default) or "hvm". The choice of virtualization type
// changes the set of further arguments that are required, as described below.
VirtualizationType pulumi.StringPtrOutput `pulumi:"virtualizationType"`
}
// NewAmi registers a new resource with the given unique name, arguments, and options.
func NewAmi(ctx *pulumi.Context,
name string, args *AmiArgs, opts ...pulumi.ResourceOption) (*Ami, error) {
if args == nil {
args = &AmiArgs{}
}
var resource Ami
err := ctx.RegisterResource("aws:ec2/ami:Ami", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAmi gets an existing Ami 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 GetAmi(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AmiState, opts ...pulumi.ResourceOption) (*Ami, error) {
var resource Ami
err := ctx.ReadResource("aws:ec2/ami:Ami", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Ami resources.
type amiState struct {
// Machine architecture for created instances. Defaults to "x8664".
Architecture *string `pulumi:"architecture"`
// The ARN of the AMI.
Arn *string `pulumi:"arn"`
// A longer, human-readable description for the AMI.
Description *string `pulumi:"description"`
// Nested block describing an EBS block device that should be
// attached to created instances. The structure of this block is described below.
EbsBlockDevices []AmiEbsBlockDevice `pulumi:"ebsBlockDevices"`
// Specifies whether enhanced networking with ENA is enabled. Defaults to `false`.
EnaSupport *bool `pulumi:"enaSupport"`
// Nested block describing an ephemeral block device that
// should be attached to created instances. The structure of this block is described below.
EphemeralBlockDevices []AmiEphemeralBlockDevice `pulumi:"ephemeralBlockDevices"`
// The hypervisor type of the image.
Hypervisor *string `pulumi:"hypervisor"`
// Path to an S3 object containing an image manifest, e.g. created
// by the `ec2-upload-bundle` command in the EC2 command line tools.
ImageLocation *string `pulumi:"imageLocation"`
// The AWS account alias (for example, amazon, self) or the AWS account ID of the AMI owner.
ImageOwnerAlias *string `pulumi:"imageOwnerAlias"`
// The type of image.
ImageType *string `pulumi:"imageType"`
// The id of the kernel image (AKI) that will be used as the paravirtual
// kernel in created instances.
KernelId *string `pulumi:"kernelId"`
ManageEbsSnapshots *bool `pulumi:"manageEbsSnapshots"`
// A region-unique name for the AMI.
Name *string `pulumi:"name"`
// The AWS account ID of the image owner.
OwnerId *string `pulumi:"ownerId"`
// This value is set to windows for Windows AMIs; otherwise, it is blank.
Platform *string `pulumi:"platform"`
// The platform details associated with the billing code of the AMI.
PlatformDetails *string `pulumi:"platformDetails"`
// Indicates whether the image has public launch permissions.
Public *bool `pulumi:"public"`
// The id of an initrd image (ARI) that will be used when booting the
// created instances.
RamdiskId *string `pulumi:"ramdiskId"`
// The name of the root device (for example, `/dev/sda1`, or `/dev/xvda`).
RootDeviceName *string `pulumi:"rootDeviceName"`
// The Snapshot ID for the root volume (for EBS-backed AMIs)
RootSnapshotId *string `pulumi:"rootSnapshotId"`
// When set to "simple" (the default), enables enhanced networking
// for created instances. No other value is supported at this time.
SriovNetSupport *string `pulumi:"sriovNetSupport"`
// A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-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"`
// The operation of the Amazon EC2 instance and the billing code that is associated with the AMI.
UsageOperation *string `pulumi:"usageOperation"`
// Keyword to choose what virtualization mode created instances
// will use. Can be either "paravirtual" (the default) or "hvm". The choice of virtualization type
// changes the set of further arguments that are required, as described below.
VirtualizationType *string `pulumi:"virtualizationType"`
}
type AmiState struct {
// Machine architecture for created instances. Defaults to "x8664".
Architecture pulumi.StringPtrInput
// The ARN of the AMI.
Arn pulumi.StringPtrInput
// A longer, human-readable description for the AMI.
Description pulumi.StringPtrInput
// Nested block describing an EBS block device that should be
// attached to created instances. The structure of this block is described below.
EbsBlockDevices AmiEbsBlockDeviceArrayInput
// Specifies whether enhanced networking with ENA is enabled. Defaults to `false`.
EnaSupport pulumi.BoolPtrInput
// Nested block describing an ephemeral block device that
// should be attached to created instances. The structure of this block is described below.
EphemeralBlockDevices AmiEphemeralBlockDeviceArrayInput
// The hypervisor type of the image.
Hypervisor pulumi.StringPtrInput
// Path to an S3 object containing an image manifest, e.g. created
// by the `ec2-upload-bundle` command in the EC2 command line tools.
ImageLocation pulumi.StringPtrInput
// The AWS account alias (for example, amazon, self) or the AWS account ID of the AMI owner.
ImageOwnerAlias pulumi.StringPtrInput
// The type of image.
ImageType pulumi.StringPtrInput
// The id of the kernel image (AKI) that will be used as the paravirtual
// kernel in created instances.
KernelId pulumi.StringPtrInput
ManageEbsSnapshots pulumi.BoolPtrInput
// A region-unique name for the AMI.
Name pulumi.StringPtrInput
// The AWS account ID of the image owner.
OwnerId pulumi.StringPtrInput
// This value is set to windows for Windows AMIs; otherwise, it is blank.
Platform pulumi.StringPtrInput
// The platform details associated with the billing code of the AMI.
PlatformDetails pulumi.StringPtrInput
// Indicates whether the image has public launch permissions.
Public pulumi.BoolPtrInput
// The id of an initrd image (ARI) that will be used when booting the
// created instances.
RamdiskId pulumi.StringPtrInput
// The name of the root device (for example, `/dev/sda1`, or `/dev/xvda`).
RootDeviceName pulumi.StringPtrInput
// The Snapshot ID for the root volume (for EBS-backed AMIs)
RootSnapshotId pulumi.StringPtrInput
// When set to "simple" (the default), enables enhanced networking
// for created instances. No other value is supported at this time.
SriovNetSupport pulumi.StringPtrInput
// A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-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
// The operation of the Amazon EC2 instance and the billing code that is associated with the AMI.
UsageOperation pulumi.StringPtrInput
// Keyword to choose what virtualization mode created instances
// will use. Can be either "paravirtual" (the default) or "hvm". The choice of virtualization type
// changes the set of further arguments that are required, as described below.
VirtualizationType pulumi.StringPtrInput
}
func (AmiState) ElementType() reflect.Type {
return reflect.TypeOf((*amiState)(nil)).Elem()
}
type amiArgs struct {
// Machine architecture for created instances. Defaults to "x8664".
Architecture *string `pulumi:"architecture"`
// A longer, human-readable description for the AMI.
Description *string `pulumi:"description"`
// Nested block describing an EBS block device that should be
// attached to created instances. The structure of this block is described below.
EbsBlockDevices []AmiEbsBlockDevice `pulumi:"ebsBlockDevices"`
// Specifies whether enhanced networking with ENA is enabled. Defaults to `false`.
EnaSupport *bool `pulumi:"enaSupport"`
// Nested block describing an ephemeral block device that
// should be attached to created instances. The structure of this block is described below.
EphemeralBlockDevices []AmiEphemeralBlockDevice `pulumi:"ephemeralBlockDevices"`
// Path to an S3 object containing an image manifest, e.g. created
// by the `ec2-upload-bundle` command in the EC2 command line tools.
ImageLocation *string `pulumi:"imageLocation"`
// The id of the kernel image (AKI) that will be used as the paravirtual
// kernel in created instances.
KernelId *string `pulumi:"kernelId"`
// A region-unique name for the AMI.
Name *string `pulumi:"name"`
// The id of an initrd image (ARI) that will be used when booting the
// created instances.
RamdiskId *string `pulumi:"ramdiskId"`
// The name of the root device (for example, `/dev/sda1`, or `/dev/xvda`).
RootDeviceName *string `pulumi:"rootDeviceName"`
// When set to "simple" (the default), enables enhanced networking
// for created instances. No other value is supported at this time.
SriovNetSupport *string `pulumi:"sriovNetSupport"`
// A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-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"`
// Keyword to choose what virtualization mode created instances
// will use. Can be either "paravirtual" (the default) or "hvm". The choice of virtualization type
// changes the set of further arguments that are required, as described below.
VirtualizationType *string `pulumi:"virtualizationType"`
}
// The set of arguments for constructing a Ami resource.
type AmiArgs struct {
// Machine architecture for created instances. Defaults to "x8664".
Architecture pulumi.StringPtrInput
// A longer, human-readable description for the AMI.
Description pulumi.StringPtrInput
// Nested block describing an EBS block device that should be
// attached to created instances. The structure of this block is described below.
EbsBlockDevices AmiEbsBlockDeviceArrayInput
// Specifies whether enhanced networking with ENA is enabled. Defaults to `false`.
EnaSupport pulumi.BoolPtrInput
// Nested block describing an ephemeral block device that
// should be attached to created instances. The structure of this block is described below.
EphemeralBlockDevices AmiEphemeralBlockDeviceArrayInput
// Path to an S3 object containing an image manifest, e.g. created
// by the `ec2-upload-bundle` command in the EC2 command line tools.
ImageLocation pulumi.StringPtrInput
// The id of the kernel image (AKI) that will be used as the paravirtual
// kernel in created instances.
KernelId pulumi.StringPtrInput
// A region-unique name for the AMI.
Name pulumi.StringPtrInput
// The id of an initrd image (ARI) that will be used when booting the
// created instances.
RamdiskId pulumi.StringPtrInput
// The name of the root device (for example, `/dev/sda1`, or `/dev/xvda`).
RootDeviceName pulumi.StringPtrInput
// When set to "simple" (the default), enables enhanced networking
// for created instances. No other value is supported at this time.
SriovNetSupport pulumi.StringPtrInput
// A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-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
// Keyword to choose what virtualization mode created instances
// will use. Can be either "paravirtual" (the default) or "hvm". The choice of virtualization type
// changes the set of further arguments that are required, as described below.
VirtualizationType pulumi.StringPtrInput
}
func (AmiArgs) ElementType() reflect.Type {
return reflect.TypeOf((*amiArgs)(nil)).Elem()
}
type AmiInput interface {
pulumi.Input
ToAmiOutput() AmiOutput
ToAmiOutputWithContext(ctx context.Context) AmiOutput
}
func (*Ami) ElementType() reflect.Type {
return reflect.TypeOf((*Ami)(nil))
}
func (i *Ami) ToAmiOutput() AmiOutput {
return i.ToAmiOutputWithContext(context.Background())
}
func (i *Ami) ToAmiOutputWithContext(ctx context.Context) AmiOutput {
return pulumi.ToOutputWithContext(ctx, i).(AmiOutput)
}
func (i *Ami) ToAmiPtrOutput() AmiPtrOutput {
return i.ToAmiPtrOutputWithContext(context.Background())
}
func (i *Ami) ToAmiPtrOutputWithContext(ctx context.Context) AmiPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(AmiPtrOutput)
}
type AmiPtrInput interface {
pulumi.Input
ToAmiPtrOutput() AmiPtrOutput
ToAmiPtrOutputWithContext(ctx context.Context) AmiPtrOutput
}
type amiPtrType AmiArgs
func (*amiPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**Ami)(nil))
}
func (i *amiPtrType) ToAmiPtrOutput() AmiPtrOutput {
return i.ToAmiPtrOutputWithContext(context.Background())
}
func (i *amiPtrType) ToAmiPtrOutputWithContext(ctx context.Context) AmiPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(AmiPtrOutput)
}
// AmiArrayInput is an input type that accepts AmiArray and AmiArrayOutput values.
// You can construct a concrete instance of `AmiArrayInput` via:
//
// AmiArray{ AmiArgs{...} }
type AmiArrayInput interface {
pulumi.Input
ToAmiArrayOutput() AmiArrayOutput
ToAmiArrayOutputWithContext(context.Context) AmiArrayOutput
}
type AmiArray []AmiInput
func (AmiArray) ElementType() reflect.Type {
return reflect.TypeOf(([]*Ami)(nil))
}
func (i AmiArray) ToAmiArrayOutput() AmiArrayOutput {
return i.ToAmiArrayOutputWithContext(context.Background())
}
func (i AmiArray) ToAmiArrayOutputWithContext(ctx context.Context) AmiArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AmiArrayOutput)
}
// AmiMapInput is an input type that accepts AmiMap and AmiMapOutput values.
// You can construct a concrete instance of `AmiMapInput` via:
//
// AmiMap{ "key": AmiArgs{...} }
type AmiMapInput interface {
pulumi.Input
ToAmiMapOutput() AmiMapOutput
ToAmiMapOutputWithContext(context.Context) AmiMapOutput
}
type AmiMap map[string]AmiInput
func (AmiMap) ElementType() reflect.Type {
return reflect.TypeOf((map[string]*Ami)(nil))
}
func (i AmiMap) ToAmiMapOutput() AmiMapOutput {
return i.ToAmiMapOutputWithContext(context.Background())
}
func (i AmiMap) ToAmiMapOutputWithContext(ctx context.Context) AmiMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AmiMapOutput)
}
type AmiOutput struct {
*pulumi.OutputState
}
func (AmiOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Ami)(nil))
}
func (o AmiOutput) ToAmiOutput() AmiOutput {
return o
}
func (o AmiOutput) ToAmiOutputWithContext(ctx context.Context) AmiOutput {
return o
}
func (o AmiOutput) ToAmiPtrOutput() AmiPtrOutput {
return o.ToAmiPtrOutputWithContext(context.Background())
}
func (o AmiOutput) ToAmiPtrOutputWithContext(ctx context.Context) AmiPtrOutput {
return o.ApplyT(func(v Ami) *Ami {
return &v
}).(AmiPtrOutput)
}
type AmiPtrOutput struct {
*pulumi.OutputState
}
func (AmiPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Ami)(nil))
}
func (o AmiPtrOutput) ToAmiPtrOutput() AmiPtrOutput {
return o
}
func (o AmiPtrOutput) ToAmiPtrOutputWithContext(ctx context.Context) AmiPtrOutput {
return o
}
type AmiArrayOutput struct{ *pulumi.OutputState }
func (AmiArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]Ami)(nil))
}
func (o AmiArrayOutput) ToAmiArrayOutput() AmiArrayOutput {
return o
}
func (o AmiArrayOutput) ToAmiArrayOutputWithContext(ctx context.Context) AmiArrayOutput {
return o
}
func (o AmiArrayOutput) Index(i pulumi.IntInput) AmiOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) Ami {
return vs[0].([]Ami)[vs[1].(int)]
}).(AmiOutput)
}
type AmiMapOutput struct{ *pulumi.OutputState }
func (AmiMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]Ami)(nil))
}
func (o AmiMapOutput) ToAmiMapOutput() AmiMapOutput {
return o
}
func (o AmiMapOutput) ToAmiMapOutputWithContext(ctx context.Context) AmiMapOutput {
return o
}
func (o AmiMapOutput) MapIndex(k pulumi.StringInput) AmiOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) Ami {
return vs[0].(map[string]Ami)[vs[1].(string)]
}).(AmiOutput)
}
func init() {
pulumi.RegisterOutputType(AmiOutput{})
pulumi.RegisterOutputType(AmiPtrOutput{})
pulumi.RegisterOutputType(AmiArrayOutput{})
pulumi.RegisterOutputType(AmiMapOutput{})
}