Class CfnLaunchTemplate
Specifies the properties for creating a launch template.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnLaunchTemplate : CfnResource, IInspectable
Syntax (vb)
Public Class CfnLaunchTemplate
Inherits CfnResource
Implements IInspectable
Remarks
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 .
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html
CloudformationResource: AWS::EC2::LaunchTemplate
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(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 |
CfnLaunchTemplate(Construct, String, ICfnLaunchTemplateProps) |
Properties
AttrDefaultVersionNumber | The default version of the launch template, such as 2. |
AttrLatestVersionNumber | The latest version of the launch template, such as |
AttrLaunchTemplateId | The ID of the launch template. |
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(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
CfnLaunchTemplate(Construct, String, ICfnLaunchTemplateProps)
public CfnLaunchTemplate(Construct scope, string id, ICfnLaunchTemplateProps props)
Parameters
- scope Constructs.Construct
Scope in which this resource is defined.
- id System.String
Construct identifier for this resource (unique in its scope).
- props ICfnLaunchTemplateProps
Resource properties.
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
AttrLaunchTemplateId
The ID of the launch template.
public virtual string AttrLaunchTemplateId { get; }
Property Value
System.String
Remarks
CloudformationAttribute: LaunchTemplateId
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
LaunchTemplateName
A name for the launch template.
public virtual string LaunchTemplateName { get; set; }
Property Value
System.String
TagSpecifications
The tags to apply to the launch template on creation.
public virtual object TagSpecifications { get; set; }
Property Value
System.Object
VersionDescription
A description for the first version of the launch template.
public virtual string VersionDescription { get; set; }
Property Value
System.String
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>