Class CfnLaunchTemplate
A CloudFormation AWS::EC2::LaunchTemplate
.
Inherited Members
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.AWS.EC2.dll
Syntax (csharp)
public class CfnLaunchTemplate : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnLaunchTemplate
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
Specifies the properties for creating a launch template.
The minimum required properties for specifying a launch template are as follows:
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 in the Amazon EC2 User Guide .
CloudformationResource: AWS::EC2::LaunchTemplate
Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html
ExampleMetadata: infused
Examples
Cluster cluster;
var userData = @"MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=""==MYBOUNDARY==""
--==MYBOUNDARY==
Content-Type: text/x-shellscript; charset=""us-ascii""
#!/bin/bash
echo ""Running custom user data script""
--==MYBOUNDARY==--\
";
var lt = new CfnLaunchTemplate(this, "LaunchTemplate", new CfnLaunchTemplateProps {
LaunchTemplateData = new LaunchTemplateDataProperty {
InstanceType = "t3.small",
UserData = Fn.Base64(userData)
}
});
cluster.AddNodegroupCapacity("extra-ng", new NodegroupOptions {
LaunchTemplateSpec = new LaunchTemplateSpec {
Id = lt.Ref,
Version = lt.AttrLatestVersionNumber
}
});
Synopsis
Constructors
CfnLaunchTemplate(Construct, String, ICfnLaunchTemplateProps) | Create a new |
CfnLaunchTemplate(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnLaunchTemplate(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
AttrDefaultVersionNumber | The default version of the launch template, such as 2. |
AttrLatestVersionNumber | The latest version of the launch template, such as |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
LaunchTemplateData | The information for the launch template. |
LaunchTemplateName | A name for the launch template. |
TagSpecifications | The tags to apply to the launch template on creation. |
VersionDescription | A description for the first version of the launch template. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnLaunchTemplate(Construct, String, ICfnLaunchTemplateProps)
Create a new AWS::EC2::LaunchTemplate
.
public CfnLaunchTemplate(Construct scope, string id, ICfnLaunchTemplateProps props)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnLaunchTemplateProps
- resource properties.
CfnLaunchTemplate(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnLaunchTemplate(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnLaunchTemplate(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnLaunchTemplate(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
AttrDefaultVersionNumber
The default version of the launch template, such as 2.
public virtual string AttrDefaultVersionNumber { get; }
Property Value
System.String
Remarks
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-template
AWS CLI command.
CloudformationAttribute: DefaultVersionNumber
AttrLatestVersionNumber
The latest version of the launch template, such as 5
.
public virtual string AttrLatestVersionNumber { get; }
Property Value
System.String
Remarks
CloudformationAttribute: LatestVersionNumber
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
LaunchTemplateData
The information for the launch template.
public virtual object LaunchTemplateData { get; set; }
Property Value
System.Object
Remarks
LaunchTemplateName
A name for the launch template.
public virtual string LaunchTemplateName { get; set; }
Property Value
System.String
Remarks
TagSpecifications
The tags to apply to the launch template on creation.
public virtual object TagSpecifications { get; set; }
Property Value
System.Object
Remarks
To tag the launch template, the resource type must be launch-template
.
To specify the tags for the resources that are created when an instance is launched, you must use the TagSpecifications
parameter in the launch template data structure.
VersionDescription
A description for the first version of the launch template.
public virtual string VersionDescription { get; set; }
Property Value
System.String
Remarks
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
- tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>