AWS::EC2::LaunchTemplate
The AWS::EC2::LaunchTemplate resource creates a launch template for an
Amazon EC2 instance. A launch template contains the parameters to launch an instance.
For more
information, see CreateLaunchTemplate in the Amazon EC2 API Reference.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::EC2::LaunchTemplate", "Properties" : { "LaunchTemplateName" :String, "LaunchTemplateData" : LaunchTemplateData } }
YAML
Type: "AWS::EC2::LaunchTemplate" Properties: LaunchTemplateName:StringLaunchTemplateData: LaunchTemplateData
Properties
LaunchTemplateName-
A name for the launch template.
Length Constraints: Minimum length of 3. Maximum length of 128.
Pattern: [a-zA-Z0-9\(\)\.-/_]+
Required: No
Type: String
Update requires: Replacement
LaunchTemplateData-
The information for the launch template.
Required: No
Type: LaunchTemplateData
Update requires: No interruption
Return Values
Fn::GetAtt
Fn::GetAtt returns a value for a specified attribute of this type.
The following are the available attributes and sample return values.
LatestVersionNumber-
The latest version of the launch template, such as
5. DefaultVersionNumber-
The default version of the launch template, such as
2.Note
The default version of a launch template cannot be specified in AWS CloudFormation. The default version can be set in the Amazon EC2 Console or by using the
modify-launch-templateAWS CLI command.
For more information about using
Fn::GetAtt, see
Fn::GetAtt.
Ref
When you pass the logical ID of an AWS::EC2::LaunchTemplate resource to the
intrinsic Ref function, Ref returns the ID of the launch template,
such as lt-01238c059e3466abc.
For more information about using the Ref function, see Ref.
See Also
-
CreateLaunchTemplate in the Amazon EC2 API Reference
