AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::EC2::LaunchTemplate

CfnLaunchTemplate

Specifies the properties for creating a launch template. The minimum required properties for specifying a launch template are as follows: - You must specify at least one property for the launch template data. - You can optionally specify a name for the launch template. If you do not specify a name, CloudFormation creates a name for you. A launch template can contain some or all of the configuration information to launch an instance. When you launch an instance using a launch template, instance properties that are not specified in the launch template use default values, except the `ImageId` property, which has no default value. If you do not specify an AMI ID for the launch template `ImageId` property, you must specify an AMI ID for the instance `ImageId` property. For more information, see [Launch an instance from a launch template](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html) in the *Amazon EC2 User Guide* .

Import

import { CfnLaunchTemplate } from 'aws-cdk-lib/aws-ec2';

Or use the module namespace:

import * as ec2 from 'aws-cdk-lib/aws-ec2';
// ec2.CfnLaunchTemplate

Properties

Configuration passed to the constructor as CfnLaunchTemplateProps.

launchTemplateDataRequired
IResolvable | LaunchTemplateDataProperty

The information for the launch template.

launchTemplateNameOptional
string

A name for the launch template.

tagSpecificationsOptional
IResolvable | IResolvable | LaunchTemplateTagSpecificationProperty[]

The tags to apply to the launch template on creation. To tag the launch template, the resource type must be `launch-template` . To specify the tags for resources that are created during instance launch, use [TagSpecifications](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata.html#cfn-ec2-launchtemplate-launchtemplatedata-tagspecifications) .

versionDescriptionOptional
string

A description for the first version of the launch template.

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Get the Amazon EC2 Cheat Sheet

Everything you need to know about Amazon EC2 on one page. HD quality, print-friendly.

Download Free Infographic