Class CfnLaunchTemplate
Specifies the properties for creating a launch template.
Inherited Members
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnLaunchTemplate : CfnResource, IInspectable, ILaunchTemplateRef, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Class CfnLaunchTemplate Inherits CfnResource Implements IInspectable, ILaunchTemplateRef, IConstruct, IDependable, IEnvironmentAware
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(Construct, string, ICfnLaunchTemplateProps) | Create a new |
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 | Specifies the properties for creating a launch template. |
| LaunchTemplateData | The information for the launch template. |
| LaunchTemplateName | A name for the launch template. |
| LaunchTemplateRef | A reference to a LaunchTemplate resource. |
| TagSpecifications | The tags to apply to the launch template on creation. |
| VersionDescription | A description for the first version of the launch template. |
Methods
| ArnForLaunchTemplate(ILaunchTemplateRef) | Specifies the properties for creating a launch template. |
| FromLaunchTemplateId(Construct, string, string) | Creates a new ILaunchTemplateRef from a launchTemplateId. |
| Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
| IsCfnLaunchTemplate(object) | Checks whether the given object is a CfnLaunchTemplate. |
| RenderProperties(IDictionary<string, object>) | Specifies the properties for creating a launch template. |
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 string
Construct identifier for this resource (unique in its scope).
- props ICfnLaunchTemplateProps
Resource properties.
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
Properties
AttrDefaultVersionNumber
The default version of the launch template, such as 2.
public virtual string AttrDefaultVersionNumber { get; }
Property Value
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
Remarks
CloudformationAttribute: LatestVersionNumber
AttrLaunchTemplateId
The ID of the launch template.
public virtual string AttrLaunchTemplateId { get; }
Property Value
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
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
CfnProperties
Specifies the properties for creating a launch template.
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
Overrides
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
LaunchTemplateData
The information for the launch template.
public virtual object LaunchTemplateData { get; set; }
Property Value
Remarks
Type union: either IResolvable or CfnLaunchTemplate.ILaunchTemplateDataProperty
LaunchTemplateName
A name for the launch template.
public virtual string? LaunchTemplateName { get; set; }
Property Value
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
LaunchTemplateRef
A reference to a LaunchTemplate resource.
public virtual ILaunchTemplateReference LaunchTemplateRef { get; }
Property Value
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
TagSpecifications
The tags to apply to the launch template on creation.
public virtual object? TagSpecifications { get; set; }
Property Value
Remarks
Type union: either IResolvable or (either IResolvable or CfnLaunchTemplate.ILaunchTemplateTagSpecificationProperty)[]
VersionDescription
A description for the first version of the launch template.
public virtual string? VersionDescription { get; set; }
Property Value
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
Methods
ArnForLaunchTemplate(ILaunchTemplateRef)
Specifies the properties for creating a launch template.
public static string ArnForLaunchTemplate(ILaunchTemplateRef resource)
Parameters
- resource ILaunchTemplateRef
Returns
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
}
});
FromLaunchTemplateId(Construct, string, string)
Creates a new ILaunchTemplateRef from a launchTemplateId.
public static ILaunchTemplateRef FromLaunchTemplateId(Construct scope, string id, string launchTemplateId)
Parameters
Returns
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
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.
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
IsCfnLaunchTemplate(object)
Checks whether the given object is a CfnLaunchTemplate.
public static bool IsCfnLaunchTemplate(object x)
Parameters
- x object
Returns
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
RenderProperties(IDictionary<string, object>)
Specifies the properties for creating a launch template.
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props IDictionary<string, object>
Returns
Overrides
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