Class LaunchTemplate
Provides an EC2 launch template resource. Can be used to create instances or auto scaling groups.
Inherited Members
Namespace: Pulumi.Aws.Ec2
Assembly: Pulumi.Aws.dll
Syntax
public class LaunchTemplate : CustomResource
Constructors
View SourceLaunchTemplate(String, LaunchTemplateArgs, CustomResourceOptions)
Create a LaunchTemplate resource with the given unique name, arguments, and options.
Declaration
public LaunchTemplate(string name, LaunchTemplateArgs args = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| LaunchTemplateArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceArn
The Amazon Resource Name (ARN) of the instance profile.
Declaration
public Output<string> Arn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
BlockDeviceMappings
Specify volumes to attach to the instance besides the volumes specified by the AMI. See Block Devices below for details.
Declaration
public Output<ImmutableArray<LaunchTemplateBlockDeviceMapping>> BlockDeviceMappings { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<LaunchTemplateBlockDeviceMapping>> |
CapacityReservationSpecification
Targeting for EC2 capacity reservations. See Capacity Reservation Specification below for more details.
Declaration
public Output<LaunchTemplateCapacityReservationSpecification> CapacityReservationSpecification { get; }
Property Value
| Type | Description |
|---|---|
| Output<LaunchTemplateCapacityReservationSpecification> |
CpuOptions
The CPU options for the instance. See CPU Options below for more details.
Declaration
public Output<LaunchTemplateCpuOptions> CpuOptions { get; }
Property Value
| Type | Description |
|---|---|
| Output<LaunchTemplateCpuOptions> |
CreditSpecification
Customize the credit specification of the instance. See Credit Specification below for more details.
Declaration
public Output<LaunchTemplateCreditSpecification> CreditSpecification { get; }
Property Value
| Type | Description |
|---|---|
| Output<LaunchTemplateCreditSpecification> |
DefaultVersion
The default version of the launch template.
Declaration
public Output<int> DefaultVersion { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
Description
Description of the launch template.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DisableApiTermination
If true, enables EC2 Instance
Termination Protection
Declaration
public Output<bool?> DisableApiTermination { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
EbsOptimized
If true, the launched EC2 instance will be EBS-optimized.
Declaration
public Output<string> EbsOptimized { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ElasticGpuSpecifications
The elastic GPU to attach to the instance. See Elastic GPU below for more details.
Declaration
public Output<ImmutableArray<LaunchTemplateElasticGpuSpecification>> ElasticGpuSpecifications { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<LaunchTemplateElasticGpuSpecification>> |
ElasticInferenceAccelerator
Configuration block containing an Elastic Inference Accelerator to attach to the instance. See Elastic Inference Accelerator below for more details.
Declaration
public Output<LaunchTemplateElasticInferenceAccelerator> ElasticInferenceAccelerator { get; }
Property Value
| Type | Description |
|---|---|
| Output<LaunchTemplateElasticInferenceAccelerator> |
HibernationOptions
The hibernation options for the instance. See Hibernation Options below for more details.
Declaration
public Output<LaunchTemplateHibernationOptions> HibernationOptions { get; }
Property Value
| Type | Description |
|---|---|
| Output<LaunchTemplateHibernationOptions> |
IamInstanceProfile
The IAM Instance Profile to launch the instance with. See Instance Profile below for more details.
Declaration
public Output<LaunchTemplateIamInstanceProfile> IamInstanceProfile { get; }
Property Value
| Type | Description |
|---|---|
| Output<LaunchTemplateIamInstanceProfile> |
ImageId
The AMI from which to launch the instance.
Declaration
public Output<string> ImageId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
InstanceInitiatedShutdownBehavior
Shutdown behavior for the instance. Can be stop or terminate.
(Default: stop).
Declaration
public Output<string> InstanceInitiatedShutdownBehavior { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
InstanceMarketOptions
The market (purchasing) option for the instance. See Market Options below for details.
Declaration
public Output<LaunchTemplateInstanceMarketOptions> InstanceMarketOptions { get; }
Property Value
| Type | Description |
|---|---|
| Output<LaunchTemplateInstanceMarketOptions> |
InstanceType
The type of the instance.
Declaration
public Output<string> InstanceType { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
KernelId
The kernel ID.
Declaration
public Output<string> KernelId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
KeyName
The key name to use for the instance.
Declaration
public Output<string> KeyName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
LatestVersion
The latest version of the launch template.
Declaration
public Output<int> LatestVersion { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
LicenseSpecifications
A list of license specifications to associate with. See License Specification below for more details.
Declaration
public Output<ImmutableArray<LaunchTemplateLicenseSpecification>> LicenseSpecifications { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<LaunchTemplateLicenseSpecification>> |
MetadataOptions
Customize the metadata options for the instance. See Metadata Options below for more details.
Declaration
public Output<LaunchTemplateMetadataOptions> MetadataOptions { get; }
Property Value
| Type | Description |
|---|---|
| Output<LaunchTemplateMetadataOptions> |
Monitoring
The monitoring option for the instance. See Monitoring below for more details.
Declaration
public Output<LaunchTemplateMonitoring> Monitoring { get; }
Property Value
| Type | Description |
|---|---|
| Output<LaunchTemplateMonitoring> |
Name
The name of the launch template. If you leave this blank, this provider will auto-generate a unique name.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
NamePrefix
Creates a unique name beginning with the specified prefix. Conflicts with name.
Declaration
public Output<string> NamePrefix { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
NetworkInterfaces
Customize network interfaces to be attached at instance boot time. See Network Interfaces below for more details.
Declaration
public Output<ImmutableArray<LaunchTemplateNetworkInterface>> NetworkInterfaces { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<LaunchTemplateNetworkInterface>> |
Placement
The placement of the instance. See Placement below for more details.
Declaration
public Output<LaunchTemplatePlacement> Placement { get; }
Property Value
| Type | Description |
|---|---|
| Output<LaunchTemplatePlacement> |
RamDiskId
The ID of the RAM disk.
Declaration
public Output<string> RamDiskId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SecurityGroupNames
A list of security group names to associate with. If you are creating Instances in a VPC, use
vpc_security_group_ids instead.
Declaration
public Output<ImmutableArray<string>> SecurityGroupNames { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Tags
A map of tags to assign to the launch template.
Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>> |
TagSpecifications
The tags to apply to the resources during launch. See Tag Specifications below for more details.
Declaration
public Output<ImmutableArray<LaunchTemplateTagSpecification>> TagSpecifications { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<LaunchTemplateTagSpecification>> |
UserData
The Base64-encoded user data to provide when launching the instance.
Declaration
public Output<string> UserData { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
VpcSecurityGroupIds
A list of security group IDs to associate with.
Declaration
public Output<ImmutableArray<string>> VpcSecurityGroupIds { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Methods
View SourceGet(String, Input<String>, LaunchTemplateState, CustomResourceOptions)
Get an existing LaunchTemplate resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static LaunchTemplate Get(string name, Input<string> id, LaunchTemplateState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| LaunchTemplateState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| LaunchTemplate |