Amazon EC2 LaunchTemplate LaunchTemplateData
The
LaunchTemplateData property type specifies the information to include the launch template for an Amazon
EC2 instance.
LaunchTemplateData is a property of the AWS::EC2::LaunchTemplate resource.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "SecurityGroups" : [String, ... ], "TagSpecifications" : [ TagSpecification, ... ], "UserData" :String, "InstanceInitiatedShutdownBehavior" :String, "BlockDeviceMappings" : [ BlockDeviceMapping, ... ], "IamInstanceProfile" : IamInstanceProfile, "KernelId" :String, "SecurityGroupIds" : [String, ... ], "EbsOptimized" :Boolean, "KeyName" :String, "DisableApiTermination" :Boolean, "ElasticGpuSpecifications" : [ ElasticGpuSpecification, ... ], "Placement" : Placement, "InstanceMarketOptions" : InstanceMarketOptions, "NetworkInterfaces" : [ NetworkInterface, ... ], "ImageId" :String, "InstanceType" :String, "RamDiskId" :String, "Monitoring" : Monitoring, "CreditSpecification" : CreditSpecification }
YAML
SecurityGroups: -StringTagSpecifications: - TagSpecification UserData:StringInstanceInitiatedShutdownBehavior:StringBlockDeviceMappings: - BlockDeviceMapping IamInstanceProfile: IamInstanceProfile KernelId:StringSecurityGroupIds: -StringEbsOptimized:BooleanKeyName:StringDisableApiTermination:BooleanElasticGpuSpecifications: - ElasticGpuSpecification Placement: Placement InstanceMarketOptions: InstanceMarketOptions NetworkInterfaces: - NetworkInterface ImageId:StringInstanceType:StringRamDiskId:StringMonitoring: Monitoring CreditSpecification: CreditSpecification
Properties
BlockDeviceMappings-
The block device mapping.
Required: No
Type: List of BlockDeviceMapping
Update requires: No interruption
CreditSpecification-
The credit option for CPU usage of the instance. Valid for T2 instances only.
Required: No
Type: CreditSpecification
Update requires: No interruption
DisableApiTermination-
If set to
true, you can't terminate the instance using the Amazon EC2 console, CLI, or API.Required: No
Type: Boolean
Update requires: No interruption
EbsOptimized-
Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.
Required: No
Type: Boolean
Update requires: No interruption
ElasticGpuSpecifications-
An elastic GPU to associate with the instance.
Required: No
Type: List of ElasticGpuSpecification
Update requires: No interruption
IamInstanceProfile-
The IAM instance profile.
Required: No
Type: IamInstanceProfile
Update requires: No interruption
ImageId-
The ID of the AMI. For more information, see DescribeImages in the Amazon EC2 API Reference.
Required: No
Type: String
Update requires: No interruption
InstanceInitiatedShutdownBehavior-
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
Valid values include
stopandterminate. The default isstop.Required: No
Type: String
Update requires: No interruption
InstanceMarketOptions-
The market (purchasing) option for the instances.
Required: No
Type: InstanceMarketOptions
Update requires: No interruption
InstanceType-
The instance type. For a list of valid values, see RequestLaunchTemplateData in the Amazon EC2 API Reference.
Required: No
Type: String
Update requires: No interruption
KernelId-
The ID of the kernel.
Important
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User Provided Kernels in the Amazon EC2 User Guide for Linux Instances.
Required: No
Type: String
Update requires: No interruption
KeyName-
The name of the key pair. For information on creating a key pair, see CreateKeyPair or ImportKeyPair in the Amazon EC2 API Reference.
Important
If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.
Required: No
Type: String
Update requires: No interruption
Monitoring-
The monitoring for the instance.
Required: No
Type: Monitoring
Update requires: No interruption
NetworkInterfaces-
One or more network interfaces.
Required: No
Type: List of NetworkInterface
Update requires: No interruption
Placement-
The placement for the instance.
Required: No
Type: Placement
Update requires: No interruption
RamDiskId-
The ID of the RAM disk.
Important
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User Provided Kernels in the Amazon EC2 User Guide for Linux Instances.
Required: No
Type: String
Update requires: No interruption
SecurityGroups-
[EC2-Classic, default VPC] One or more security group names. For a nondefault VPC, you must use security group IDs instead. You cannot specify both a security group ID and security name in the same request.
Required: No
Type: List of String values
Update requires: No interruption
SecurityGroupIds-
One or more security group IDs. You cannot specify both a security group ID and security name in the same request. For information on creating a security group, see CreateSecurityGroup in the Amazon EC2 API Reference.
Required: No
Type: List of String values
Update requires: No interruption
TagSpecifications-
The tags to apply to the resources during launch. You can tag instances and volumes. The specified tags are applied to all instances or volumes that are created during launch.
Required: No
Type: List of TagSpecification
Update requires: No interruption
UserData-
The Base64-encoded user data to make available to the instance. For more information, see Running Commands on Your Linux Instance at Launch in the Amazon EC2 User Guide for Linux Instances and Adding User Data in the Amazon EC2 User Guide for Windows Instances.
Required: No
Type: String
Update requires: No interruption
See Also
-
RequestLaunchTemplateData in the Amazon EC2 API Reference
