-
Notifications
You must be signed in to change notification settings - Fork 151
/
launchConfiguration.go
763 lines (702 loc) · 33.7 KB
/
launchConfiguration.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
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
// *** 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/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a resource to create a new launch configuration, used for autoscaling groups.
//
// ## 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 {
// opt0 := true
// ubuntu, err := ec2.LookupAmi(ctx, &ec2.LookupAmiArgs{
// MostRecent: &opt0,
// Filters: []ec2.GetAmiFilter{
// ec2.GetAmiFilter{
// Name: "name",
// Values: []string{
// "ubuntu/images/hvm-ssd/ubuntu-trusty-14.04-amd64-server-*",
// },
// },
// ec2.GetAmiFilter{
// Name: "virtualization-type",
// Values: []string{
// "hvm",
// },
// },
// },
// Owners: []string{
// "099720109477",
// },
// }, nil)
// if err != nil {
// return err
// }
// _, err = ec2.NewLaunchConfiguration(ctx, "asConf", &ec2.LaunchConfigurationArgs{
// ImageId: pulumi.String(ubuntu.Id),
// InstanceType: pulumi.String("t2.micro"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
// ## Using with AutoScaling Groups
//
// Launch Configurations cannot be updated after creation with the Amazon
// Web Service API. In order to update a Launch Configuration, this provider will
// destroy the existing resource and create a replacement. In order to effectively
// use a Launch Configuration resource with an [AutoScaling Group resource](https://www.terraform.io/docs/providers/aws/r/autoscaling_group.html),
// it's recommended to specify `createBeforeDestroy` in a [lifecycle](https://www.terraform.io/docs/configuration/meta-arguments/lifecycle.html) block.
// Either omit the Launch Configuration `name` attribute, or specify a partial name
// with `namePrefix`. Example:
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/autoscaling"
// "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 {
// opt0 := true
// ubuntu, err := ec2.LookupAmi(ctx, &ec2.LookupAmiArgs{
// MostRecent: &opt0,
// Filters: []ec2.GetAmiFilter{
// ec2.GetAmiFilter{
// Name: "name",
// Values: []string{
// "ubuntu/images/hvm-ssd/ubuntu-trusty-14.04-amd64-server-*",
// },
// },
// ec2.GetAmiFilter{
// Name: "virtualization-type",
// Values: []string{
// "hvm",
// },
// },
// },
// Owners: []string{
// "099720109477",
// },
// }, nil)
// if err != nil {
// return err
// }
// asConf, err := ec2.NewLaunchConfiguration(ctx, "asConf", &ec2.LaunchConfigurationArgs{
// NamePrefix: pulumi.String("lc-example-"),
// ImageId: pulumi.String(ubuntu.Id),
// InstanceType: pulumi.String("t2.micro"),
// })
// if err != nil {
// return err
// }
// _, err = autoscaling.NewGroup(ctx, "bar", &autoscaling.GroupArgs{
// LaunchConfiguration: asConf.Name,
// MinSize: pulumi.Int(1),
// MaxSize: pulumi.Int(2),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// With this setup this provider generates a unique name for your Launch
// Configuration and can then update the AutoScaling Group without conflict before
// destroying the previous Launch Configuration.
//
// ## Using with Spot Instances
//
// Launch configurations can set the spot instance pricing to be used for the
// Auto Scaling Group to reserve instances. Simply specifying the `spotPrice`
// parameter will set the price on the Launch Configuration which will attempt to
// reserve your instances at this price. See the [AWS Spot Instance
// documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances.html)
// for more information or how to launch [Spot Instances](https://www.terraform.io/docs/providers/aws/r/spot_instance_request.html) with this provider.
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/autoscaling"
// "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 {
// opt0 := true
// ubuntu, err := ec2.LookupAmi(ctx, &ec2.LookupAmiArgs{
// MostRecent: &opt0,
// Filters: []ec2.GetAmiFilter{
// ec2.GetAmiFilter{
// Name: "name",
// Values: []string{
// "ubuntu/images/hvm-ssd/ubuntu-trusty-14.04-amd64-server-*",
// },
// },
// ec2.GetAmiFilter{
// Name: "virtualization-type",
// Values: []string{
// "hvm",
// },
// },
// },
// Owners: []string{
// "099720109477",
// },
// }, nil)
// if err != nil {
// return err
// }
// asConf, err := ec2.NewLaunchConfiguration(ctx, "asConf", &ec2.LaunchConfigurationArgs{
// ImageId: pulumi.String(ubuntu.Id),
// InstanceType: pulumi.String("m4.large"),
// SpotPrice: pulumi.String("0.001"),
// })
// if err != nil {
// return err
// }
// _, err = autoscaling.NewGroup(ctx, "bar", &autoscaling.GroupArgs{
// LaunchConfiguration: asConf.Name,
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Block devices
//
// Each of the `*_block_device` attributes controls a portion of the AWS
// Launch Configuration's "Block Device Mapping". It's a good idea to familiarize yourself with [AWS's Block Device
// Mapping docs](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html)
// to understand the implications of using these attributes.
//
// The `rootBlockDevice` mapping supports the following:
//
// * `volumeType` - (Optional) The type of volume. Can be `"standard"`, `"gp2"`, `"gp3"`, `"st1"`, `"sc1"`
// or `"io1"`. (Default: `"standard"`).
// * `volumeSize` - (Optional) The size of the volume in gigabytes.
// * `iops` - (Optional) The amount of provisioned
// [IOPS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-io-characteristics.html).
// This must be set with a `volumeType` of `"io1"`.
// * `throughput` - (Optional) The throughput (MiBps) to provision for a `gp3` volume.
// * `deleteOnTermination` - (Optional) Whether the volume should be destroyed
// on instance termination (Default: `true`).
// * `encrypted` - (Optional) Whether the volume should be encrypted or not. (Default: `false`).
//
// Modifying any of the `rootBlockDevice` settings requires resource
// replacement.
//
// Each `ebsBlockDevice` supports the following:
//
// * `deviceName` - (Required) The name of the device to mount.
// * `snapshotId` - (Optional) The Snapshot ID to mount.
// * `volumeType` - (Optional) The type of volume. Can be `"standard"`, `"gp2"`, `"gp3"`, `"st1"`, `"sc1"`
// or `"io1"`. (Default: `"standard"`).
// * `volumeSize` - (Optional) The size of the volume in gigabytes.
// * `iops` - (Optional) The amount of provisioned
// [IOPS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-io-characteristics.html).
// This must be set with a `volumeType` of `"io1"`.
// * `throughput` - (Optional) The throughput (MiBps) to provision for a `gp3` volume.
// * `deleteOnTermination` - (Optional) Whether the volume should be destroyed
// on instance termination (Default: `true`).
// * `encrypted` - (Optional) Whether the volume should be encrypted or not. Do not use this option if you are using `snapshotId` as the encrypted flag will be determined by the snapshot. (Default: `false`).
// * `noDevice` - (Optional) Whether the device in the block device mapping of the AMI is suppressed.
//
// Modifying any `ebsBlockDevice` currently requires resource replacement.
//
// Each `ephemeralBlockDevice` supports the following:
//
// * `deviceName` - The name of the block device to mount on the instance.
// * `virtualName` - The [Instance Store Device
// Name](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html#InstanceStoreDeviceNames)
// (e.g., `"ephemeral0"`)
//
// Each AWS Instance type has a different set of Instance Store block devices
// available for attachment. AWS [publishes a
// list](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html#StorageOnInstanceTypes)
// of which ephemeral devices are available on each type. The devices are always
// identified by the `virtualName` in the format `"ephemeral{0..N}"`.
//
// > **NOTE:** Changes to `*_block_device` configuration of _existing_ resources
// cannot currently be detected by this provider. After updating to block device
// configuration, resource recreation can be manually triggered by using the
// [`up` command with the --replace argument](https://www.pulumi.com/docs/reference/cli/pulumi_up/).
//
// ## Import
//
// Launch configurations can be imported using the `name`, e.g.,
//
// ```sh
// $ pulumi import aws:ec2/launchConfiguration:LaunchConfiguration as_conf lg-123456
// ```
type LaunchConfiguration struct {
pulumi.CustomResourceState
// The Amazon Resource Name of the launch configuration.
Arn pulumi.StringOutput `pulumi:"arn"`
// Associate a public ip address with an instance in a VPC.
AssociatePublicIpAddress pulumi.BoolPtrOutput `pulumi:"associatePublicIpAddress"`
// Additional EBS block devices to attach to the
// instance. See Block Devices below for details.
EbsBlockDevices LaunchConfigurationEbsBlockDeviceArrayOutput `pulumi:"ebsBlockDevices"`
// If true, the launched EC2 instance will be EBS-optimized.
EbsOptimized pulumi.BoolOutput `pulumi:"ebsOptimized"`
// Enables/disables detailed monitoring. This is enabled by default.
EnableMonitoring pulumi.BoolPtrOutput `pulumi:"enableMonitoring"`
// Customize Ephemeral (also known as
// "Instance Store") volumes on the instance. See Block Devices below for details.
EphemeralBlockDevices LaunchConfigurationEphemeralBlockDeviceArrayOutput `pulumi:"ephemeralBlockDevices"`
// The name attribute of the IAM instance profile to associate
// with launched instances.
IamInstanceProfile pulumi.StringPtrOutput `pulumi:"iamInstanceProfile"`
// The EC2 image ID to launch.
ImageId pulumi.StringOutput `pulumi:"imageId"`
// The size of instance to launch.
InstanceType pulumi.StringOutput `pulumi:"instanceType"`
// The key name that should be used for the instance.
KeyName pulumi.StringOutput `pulumi:"keyName"`
// The metadata options for the instance.
MetadataOptions LaunchConfigurationMetadataOptionsOutput `pulumi:"metadataOptions"`
// The name of the launch configuration. If you leave
// this blank, this provider will auto-generate a unique name. Conflicts with `namePrefix`.
Name pulumi.StringOutput `pulumi:"name"`
// Creates a unique name beginning with the specified
// prefix. Conflicts with `name`.
NamePrefix pulumi.StringOutput `pulumi:"namePrefix"`
// The tenancy of the instance. Valid values are
// `"default"` or `"dedicated"`, see [AWS's Create Launch Configuration](http://docs.aws.amazon.com/AutoScaling/latest/APIReference/API_CreateLaunchConfiguration.html)
// for more details
PlacementTenancy pulumi.StringPtrOutput `pulumi:"placementTenancy"`
// Customize details about the root block
// device of the instance. See Block Devices below for details.
RootBlockDevice LaunchConfigurationRootBlockDeviceOutput `pulumi:"rootBlockDevice"`
// A list of associated security group IDS.
SecurityGroups pulumi.StringArrayOutput `pulumi:"securityGroups"`
// The maximum price to use for reserving spot instances.
SpotPrice pulumi.StringPtrOutput `pulumi:"spotPrice"`
// The user data to provide when launching the instance. Do not pass gzip-compressed data via this argument; see `userDataBase64` instead.
UserData pulumi.StringPtrOutput `pulumi:"userData"`
// Can be used instead of `userData` to pass base64-encoded binary data directly. Use this instead of `userData` whenever the value is not a valid UTF-8 string. For example, gzip-encoded user data must be base64-encoded and passed via this argument to avoid corruption.
UserDataBase64 pulumi.StringPtrOutput `pulumi:"userDataBase64"`
// The ID of a ClassicLink-enabled VPC. Only applies to EC2-Classic instances. (eg. `vpc-2730681a`)
VpcClassicLinkId pulumi.StringPtrOutput `pulumi:"vpcClassicLinkId"`
// The IDs of one or more security groups for the specified ClassicLink-enabled VPC (eg. `sg-46ae3d11`).
VpcClassicLinkSecurityGroups pulumi.StringArrayOutput `pulumi:"vpcClassicLinkSecurityGroups"`
}
// NewLaunchConfiguration registers a new resource with the given unique name, arguments, and options.
func NewLaunchConfiguration(ctx *pulumi.Context,
name string, args *LaunchConfigurationArgs, opts ...pulumi.ResourceOption) (*LaunchConfiguration, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ImageId == nil {
return nil, errors.New("invalid value for required argument 'ImageId'")
}
if args.InstanceType == nil {
return nil, errors.New("invalid value for required argument 'InstanceType'")
}
var resource LaunchConfiguration
err := ctx.RegisterResource("aws:ec2/launchConfiguration:LaunchConfiguration", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetLaunchConfiguration gets an existing LaunchConfiguration 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 GetLaunchConfiguration(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *LaunchConfigurationState, opts ...pulumi.ResourceOption) (*LaunchConfiguration, error) {
var resource LaunchConfiguration
err := ctx.ReadResource("aws:ec2/launchConfiguration:LaunchConfiguration", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering LaunchConfiguration resources.
type launchConfigurationState struct {
// The Amazon Resource Name of the launch configuration.
Arn *string `pulumi:"arn"`
// Associate a public ip address with an instance in a VPC.
AssociatePublicIpAddress *bool `pulumi:"associatePublicIpAddress"`
// Additional EBS block devices to attach to the
// instance. See Block Devices below for details.
EbsBlockDevices []LaunchConfigurationEbsBlockDevice `pulumi:"ebsBlockDevices"`
// If true, the launched EC2 instance will be EBS-optimized.
EbsOptimized *bool `pulumi:"ebsOptimized"`
// Enables/disables detailed monitoring. This is enabled by default.
EnableMonitoring *bool `pulumi:"enableMonitoring"`
// Customize Ephemeral (also known as
// "Instance Store") volumes on the instance. See Block Devices below for details.
EphemeralBlockDevices []LaunchConfigurationEphemeralBlockDevice `pulumi:"ephemeralBlockDevices"`
// The name attribute of the IAM instance profile to associate
// with launched instances.
IamInstanceProfile interface{} `pulumi:"iamInstanceProfile"`
// The EC2 image ID to launch.
ImageId *string `pulumi:"imageId"`
// The size of instance to launch.
InstanceType *string `pulumi:"instanceType"`
// The key name that should be used for the instance.
KeyName *string `pulumi:"keyName"`
// The metadata options for the instance.
MetadataOptions *LaunchConfigurationMetadataOptions `pulumi:"metadataOptions"`
// The name of the launch configuration. If you leave
// this blank, this provider will auto-generate a unique name. Conflicts with `namePrefix`.
Name *string `pulumi:"name"`
// Creates a unique name beginning with the specified
// prefix. Conflicts with `name`.
NamePrefix *string `pulumi:"namePrefix"`
// The tenancy of the instance. Valid values are
// `"default"` or `"dedicated"`, see [AWS's Create Launch Configuration](http://docs.aws.amazon.com/AutoScaling/latest/APIReference/API_CreateLaunchConfiguration.html)
// for more details
PlacementTenancy *string `pulumi:"placementTenancy"`
// Customize details about the root block
// device of the instance. See Block Devices below for details.
RootBlockDevice *LaunchConfigurationRootBlockDevice `pulumi:"rootBlockDevice"`
// A list of associated security group IDS.
SecurityGroups []string `pulumi:"securityGroups"`
// The maximum price to use for reserving spot instances.
SpotPrice *string `pulumi:"spotPrice"`
// The user data to provide when launching the instance. Do not pass gzip-compressed data via this argument; see `userDataBase64` instead.
UserData *string `pulumi:"userData"`
// Can be used instead of `userData` to pass base64-encoded binary data directly. Use this instead of `userData` whenever the value is not a valid UTF-8 string. For example, gzip-encoded user data must be base64-encoded and passed via this argument to avoid corruption.
UserDataBase64 *string `pulumi:"userDataBase64"`
// The ID of a ClassicLink-enabled VPC. Only applies to EC2-Classic instances. (eg. `vpc-2730681a`)
VpcClassicLinkId *string `pulumi:"vpcClassicLinkId"`
// The IDs of one or more security groups for the specified ClassicLink-enabled VPC (eg. `sg-46ae3d11`).
VpcClassicLinkSecurityGroups []string `pulumi:"vpcClassicLinkSecurityGroups"`
}
type LaunchConfigurationState struct {
// The Amazon Resource Name of the launch configuration.
Arn pulumi.StringPtrInput
// Associate a public ip address with an instance in a VPC.
AssociatePublicIpAddress pulumi.BoolPtrInput
// Additional EBS block devices to attach to the
// instance. See Block Devices below for details.
EbsBlockDevices LaunchConfigurationEbsBlockDeviceArrayInput
// If true, the launched EC2 instance will be EBS-optimized.
EbsOptimized pulumi.BoolPtrInput
// Enables/disables detailed monitoring. This is enabled by default.
EnableMonitoring pulumi.BoolPtrInput
// Customize Ephemeral (also known as
// "Instance Store") volumes on the instance. See Block Devices below for details.
EphemeralBlockDevices LaunchConfigurationEphemeralBlockDeviceArrayInput
// The name attribute of the IAM instance profile to associate
// with launched instances.
IamInstanceProfile pulumi.Input
// The EC2 image ID to launch.
ImageId pulumi.StringPtrInput
// The size of instance to launch.
InstanceType pulumi.StringPtrInput
// The key name that should be used for the instance.
KeyName pulumi.StringPtrInput
// The metadata options for the instance.
MetadataOptions LaunchConfigurationMetadataOptionsPtrInput
// The name of the launch configuration. If you leave
// this blank, this provider will auto-generate a unique name. Conflicts with `namePrefix`.
Name pulumi.StringPtrInput
// Creates a unique name beginning with the specified
// prefix. Conflicts with `name`.
NamePrefix pulumi.StringPtrInput
// The tenancy of the instance. Valid values are
// `"default"` or `"dedicated"`, see [AWS's Create Launch Configuration](http://docs.aws.amazon.com/AutoScaling/latest/APIReference/API_CreateLaunchConfiguration.html)
// for more details
PlacementTenancy pulumi.StringPtrInput
// Customize details about the root block
// device of the instance. See Block Devices below for details.
RootBlockDevice LaunchConfigurationRootBlockDevicePtrInput
// A list of associated security group IDS.
SecurityGroups pulumi.StringArrayInput
// The maximum price to use for reserving spot instances.
SpotPrice pulumi.StringPtrInput
// The user data to provide when launching the instance. Do not pass gzip-compressed data via this argument; see `userDataBase64` instead.
UserData pulumi.StringPtrInput
// Can be used instead of `userData` to pass base64-encoded binary data directly. Use this instead of `userData` whenever the value is not a valid UTF-8 string. For example, gzip-encoded user data must be base64-encoded and passed via this argument to avoid corruption.
UserDataBase64 pulumi.StringPtrInput
// The ID of a ClassicLink-enabled VPC. Only applies to EC2-Classic instances. (eg. `vpc-2730681a`)
VpcClassicLinkId pulumi.StringPtrInput
// The IDs of one or more security groups for the specified ClassicLink-enabled VPC (eg. `sg-46ae3d11`).
VpcClassicLinkSecurityGroups pulumi.StringArrayInput
}
func (LaunchConfigurationState) ElementType() reflect.Type {
return reflect.TypeOf((*launchConfigurationState)(nil)).Elem()
}
type launchConfigurationArgs struct {
// Associate a public ip address with an instance in a VPC.
AssociatePublicIpAddress *bool `pulumi:"associatePublicIpAddress"`
// Additional EBS block devices to attach to the
// instance. See Block Devices below for details.
EbsBlockDevices []LaunchConfigurationEbsBlockDevice `pulumi:"ebsBlockDevices"`
// If true, the launched EC2 instance will be EBS-optimized.
EbsOptimized *bool `pulumi:"ebsOptimized"`
// Enables/disables detailed monitoring. This is enabled by default.
EnableMonitoring *bool `pulumi:"enableMonitoring"`
// Customize Ephemeral (also known as
// "Instance Store") volumes on the instance. See Block Devices below for details.
EphemeralBlockDevices []LaunchConfigurationEphemeralBlockDevice `pulumi:"ephemeralBlockDevices"`
// The name attribute of the IAM instance profile to associate
// with launched instances.
IamInstanceProfile interface{} `pulumi:"iamInstanceProfile"`
// The EC2 image ID to launch.
ImageId string `pulumi:"imageId"`
// The size of instance to launch.
InstanceType string `pulumi:"instanceType"`
// The key name that should be used for the instance.
KeyName *string `pulumi:"keyName"`
// The metadata options for the instance.
MetadataOptions *LaunchConfigurationMetadataOptions `pulumi:"metadataOptions"`
// The name of the launch configuration. If you leave
// this blank, this provider will auto-generate a unique name. Conflicts with `namePrefix`.
Name *string `pulumi:"name"`
// Creates a unique name beginning with the specified
// prefix. Conflicts with `name`.
NamePrefix *string `pulumi:"namePrefix"`
// The tenancy of the instance. Valid values are
// `"default"` or `"dedicated"`, see [AWS's Create Launch Configuration](http://docs.aws.amazon.com/AutoScaling/latest/APIReference/API_CreateLaunchConfiguration.html)
// for more details
PlacementTenancy *string `pulumi:"placementTenancy"`
// Customize details about the root block
// device of the instance. See Block Devices below for details.
RootBlockDevice *LaunchConfigurationRootBlockDevice `pulumi:"rootBlockDevice"`
// A list of associated security group IDS.
SecurityGroups []string `pulumi:"securityGroups"`
// The maximum price to use for reserving spot instances.
SpotPrice *string `pulumi:"spotPrice"`
// The user data to provide when launching the instance. Do not pass gzip-compressed data via this argument; see `userDataBase64` instead.
UserData *string `pulumi:"userData"`
// Can be used instead of `userData` to pass base64-encoded binary data directly. Use this instead of `userData` whenever the value is not a valid UTF-8 string. For example, gzip-encoded user data must be base64-encoded and passed via this argument to avoid corruption.
UserDataBase64 *string `pulumi:"userDataBase64"`
// The ID of a ClassicLink-enabled VPC. Only applies to EC2-Classic instances. (eg. `vpc-2730681a`)
VpcClassicLinkId *string `pulumi:"vpcClassicLinkId"`
// The IDs of one or more security groups for the specified ClassicLink-enabled VPC (eg. `sg-46ae3d11`).
VpcClassicLinkSecurityGroups []string `pulumi:"vpcClassicLinkSecurityGroups"`
}
// The set of arguments for constructing a LaunchConfiguration resource.
type LaunchConfigurationArgs struct {
// Associate a public ip address with an instance in a VPC.
AssociatePublicIpAddress pulumi.BoolPtrInput
// Additional EBS block devices to attach to the
// instance. See Block Devices below for details.
EbsBlockDevices LaunchConfigurationEbsBlockDeviceArrayInput
// If true, the launched EC2 instance will be EBS-optimized.
EbsOptimized pulumi.BoolPtrInput
// Enables/disables detailed monitoring. This is enabled by default.
EnableMonitoring pulumi.BoolPtrInput
// Customize Ephemeral (also known as
// "Instance Store") volumes on the instance. See Block Devices below for details.
EphemeralBlockDevices LaunchConfigurationEphemeralBlockDeviceArrayInput
// The name attribute of the IAM instance profile to associate
// with launched instances.
IamInstanceProfile pulumi.Input
// The EC2 image ID to launch.
ImageId pulumi.StringInput
// The size of instance to launch.
InstanceType pulumi.StringInput
// The key name that should be used for the instance.
KeyName pulumi.StringPtrInput
// The metadata options for the instance.
MetadataOptions LaunchConfigurationMetadataOptionsPtrInput
// The name of the launch configuration. If you leave
// this blank, this provider will auto-generate a unique name. Conflicts with `namePrefix`.
Name pulumi.StringPtrInput
// Creates a unique name beginning with the specified
// prefix. Conflicts with `name`.
NamePrefix pulumi.StringPtrInput
// The tenancy of the instance. Valid values are
// `"default"` or `"dedicated"`, see [AWS's Create Launch Configuration](http://docs.aws.amazon.com/AutoScaling/latest/APIReference/API_CreateLaunchConfiguration.html)
// for more details
PlacementTenancy pulumi.StringPtrInput
// Customize details about the root block
// device of the instance. See Block Devices below for details.
RootBlockDevice LaunchConfigurationRootBlockDevicePtrInput
// A list of associated security group IDS.
SecurityGroups pulumi.StringArrayInput
// The maximum price to use for reserving spot instances.
SpotPrice pulumi.StringPtrInput
// The user data to provide when launching the instance. Do not pass gzip-compressed data via this argument; see `userDataBase64` instead.
UserData pulumi.StringPtrInput
// Can be used instead of `userData` to pass base64-encoded binary data directly. Use this instead of `userData` whenever the value is not a valid UTF-8 string. For example, gzip-encoded user data must be base64-encoded and passed via this argument to avoid corruption.
UserDataBase64 pulumi.StringPtrInput
// The ID of a ClassicLink-enabled VPC. Only applies to EC2-Classic instances. (eg. `vpc-2730681a`)
VpcClassicLinkId pulumi.StringPtrInput
// The IDs of one or more security groups for the specified ClassicLink-enabled VPC (eg. `sg-46ae3d11`).
VpcClassicLinkSecurityGroups pulumi.StringArrayInput
}
func (LaunchConfigurationArgs) ElementType() reflect.Type {
return reflect.TypeOf((*launchConfigurationArgs)(nil)).Elem()
}
type LaunchConfigurationInput interface {
pulumi.Input
ToLaunchConfigurationOutput() LaunchConfigurationOutput
ToLaunchConfigurationOutputWithContext(ctx context.Context) LaunchConfigurationOutput
}
func (*LaunchConfiguration) ElementType() reflect.Type {
return reflect.TypeOf((*LaunchConfiguration)(nil))
}
func (i *LaunchConfiguration) ToLaunchConfigurationOutput() LaunchConfigurationOutput {
return i.ToLaunchConfigurationOutputWithContext(context.Background())
}
func (i *LaunchConfiguration) ToLaunchConfigurationOutputWithContext(ctx context.Context) LaunchConfigurationOutput {
return pulumi.ToOutputWithContext(ctx, i).(LaunchConfigurationOutput)
}
func (i *LaunchConfiguration) ToLaunchConfigurationPtrOutput() LaunchConfigurationPtrOutput {
return i.ToLaunchConfigurationPtrOutputWithContext(context.Background())
}
func (i *LaunchConfiguration) ToLaunchConfigurationPtrOutputWithContext(ctx context.Context) LaunchConfigurationPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(LaunchConfigurationPtrOutput)
}
type LaunchConfigurationPtrInput interface {
pulumi.Input
ToLaunchConfigurationPtrOutput() LaunchConfigurationPtrOutput
ToLaunchConfigurationPtrOutputWithContext(ctx context.Context) LaunchConfigurationPtrOutput
}
type launchConfigurationPtrType LaunchConfigurationArgs
func (*launchConfigurationPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**LaunchConfiguration)(nil))
}
func (i *launchConfigurationPtrType) ToLaunchConfigurationPtrOutput() LaunchConfigurationPtrOutput {
return i.ToLaunchConfigurationPtrOutputWithContext(context.Background())
}
func (i *launchConfigurationPtrType) ToLaunchConfigurationPtrOutputWithContext(ctx context.Context) LaunchConfigurationPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(LaunchConfigurationPtrOutput)
}
// LaunchConfigurationArrayInput is an input type that accepts LaunchConfigurationArray and LaunchConfigurationArrayOutput values.
// You can construct a concrete instance of `LaunchConfigurationArrayInput` via:
//
// LaunchConfigurationArray{ LaunchConfigurationArgs{...} }
type LaunchConfigurationArrayInput interface {
pulumi.Input
ToLaunchConfigurationArrayOutput() LaunchConfigurationArrayOutput
ToLaunchConfigurationArrayOutputWithContext(context.Context) LaunchConfigurationArrayOutput
}
type LaunchConfigurationArray []LaunchConfigurationInput
func (LaunchConfigurationArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*LaunchConfiguration)(nil)).Elem()
}
func (i LaunchConfigurationArray) ToLaunchConfigurationArrayOutput() LaunchConfigurationArrayOutput {
return i.ToLaunchConfigurationArrayOutputWithContext(context.Background())
}
func (i LaunchConfigurationArray) ToLaunchConfigurationArrayOutputWithContext(ctx context.Context) LaunchConfigurationArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(LaunchConfigurationArrayOutput)
}
// LaunchConfigurationMapInput is an input type that accepts LaunchConfigurationMap and LaunchConfigurationMapOutput values.
// You can construct a concrete instance of `LaunchConfigurationMapInput` via:
//
// LaunchConfigurationMap{ "key": LaunchConfigurationArgs{...} }
type LaunchConfigurationMapInput interface {
pulumi.Input
ToLaunchConfigurationMapOutput() LaunchConfigurationMapOutput
ToLaunchConfigurationMapOutputWithContext(context.Context) LaunchConfigurationMapOutput
}
type LaunchConfigurationMap map[string]LaunchConfigurationInput
func (LaunchConfigurationMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*LaunchConfiguration)(nil)).Elem()
}
func (i LaunchConfigurationMap) ToLaunchConfigurationMapOutput() LaunchConfigurationMapOutput {
return i.ToLaunchConfigurationMapOutputWithContext(context.Background())
}
func (i LaunchConfigurationMap) ToLaunchConfigurationMapOutputWithContext(ctx context.Context) LaunchConfigurationMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(LaunchConfigurationMapOutput)
}
type LaunchConfigurationOutput struct{ *pulumi.OutputState }
func (LaunchConfigurationOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LaunchConfiguration)(nil))
}
func (o LaunchConfigurationOutput) ToLaunchConfigurationOutput() LaunchConfigurationOutput {
return o
}
func (o LaunchConfigurationOutput) ToLaunchConfigurationOutputWithContext(ctx context.Context) LaunchConfigurationOutput {
return o
}
func (o LaunchConfigurationOutput) ToLaunchConfigurationPtrOutput() LaunchConfigurationPtrOutput {
return o.ToLaunchConfigurationPtrOutputWithContext(context.Background())
}
func (o LaunchConfigurationOutput) ToLaunchConfigurationPtrOutputWithContext(ctx context.Context) LaunchConfigurationPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v LaunchConfiguration) *LaunchConfiguration {
return &v
}).(LaunchConfigurationPtrOutput)
}
type LaunchConfigurationPtrOutput struct{ *pulumi.OutputState }
func (LaunchConfigurationPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**LaunchConfiguration)(nil))
}
func (o LaunchConfigurationPtrOutput) ToLaunchConfigurationPtrOutput() LaunchConfigurationPtrOutput {
return o
}
func (o LaunchConfigurationPtrOutput) ToLaunchConfigurationPtrOutputWithContext(ctx context.Context) LaunchConfigurationPtrOutput {
return o
}
func (o LaunchConfigurationPtrOutput) Elem() LaunchConfigurationOutput {
return o.ApplyT(func(v *LaunchConfiguration) LaunchConfiguration {
if v != nil {
return *v
}
var ret LaunchConfiguration
return ret
}).(LaunchConfigurationOutput)
}
type LaunchConfigurationArrayOutput struct{ *pulumi.OutputState }
func (LaunchConfigurationArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]LaunchConfiguration)(nil))
}
func (o LaunchConfigurationArrayOutput) ToLaunchConfigurationArrayOutput() LaunchConfigurationArrayOutput {
return o
}
func (o LaunchConfigurationArrayOutput) ToLaunchConfigurationArrayOutputWithContext(ctx context.Context) LaunchConfigurationArrayOutput {
return o
}
func (o LaunchConfigurationArrayOutput) Index(i pulumi.IntInput) LaunchConfigurationOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) LaunchConfiguration {
return vs[0].([]LaunchConfiguration)[vs[1].(int)]
}).(LaunchConfigurationOutput)
}
type LaunchConfigurationMapOutput struct{ *pulumi.OutputState }
func (LaunchConfigurationMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]LaunchConfiguration)(nil))
}
func (o LaunchConfigurationMapOutput) ToLaunchConfigurationMapOutput() LaunchConfigurationMapOutput {
return o
}
func (o LaunchConfigurationMapOutput) ToLaunchConfigurationMapOutputWithContext(ctx context.Context) LaunchConfigurationMapOutput {
return o
}
func (o LaunchConfigurationMapOutput) MapIndex(k pulumi.StringInput) LaunchConfigurationOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) LaunchConfiguration {
return vs[0].(map[string]LaunchConfiguration)[vs[1].(string)]
}).(LaunchConfigurationOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*LaunchConfigurationInput)(nil)).Elem(), &LaunchConfiguration{})
pulumi.RegisterInputType(reflect.TypeOf((*LaunchConfigurationPtrInput)(nil)).Elem(), &LaunchConfiguration{})
pulumi.RegisterInputType(reflect.TypeOf((*LaunchConfigurationArrayInput)(nil)).Elem(), LaunchConfigurationArray{})
pulumi.RegisterInputType(reflect.TypeOf((*LaunchConfigurationMapInput)(nil)).Elem(), LaunchConfigurationMap{})
pulumi.RegisterOutputType(LaunchConfigurationOutput{})
pulumi.RegisterOutputType(LaunchConfigurationPtrOutput{})
pulumi.RegisterOutputType(LaunchConfigurationArrayOutput{})
pulumi.RegisterOutputType(LaunchConfigurationMapOutput{})
}