interface CfnLaunchTemplateProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.EC2.CfnLaunchTemplateProps |
![]() | software.amazon.awscdk.services.ec2.CfnLaunchTemplateProps |
![]() | aws_cdk.aws_ec2.CfnLaunchTemplateProps |
![]() | @aws-cdk/aws-ec2 » CfnLaunchTemplateProps |
Properties for defining a CfnLaunchTemplate
.
Example
declare const cluster: eks.Cluster;
const 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==--\\
`;
const lt = new ec2.CfnLaunchTemplate(this, 'LaunchTemplate', {
launchTemplateData: {
instanceType: 't3.small',
userData: Fn.base64(userData),
},
});
cluster.addNodegroupCapacity('extra-ng', {
launchTemplateSpec: {
id: lt.ref,
version: lt.attrLatestVersionNumber,
},
});
Properties
Name | Type | Description |
---|---|---|
launch | IResolvable | Launch | The information for the launch template. |
launch | string | A name for the launch template. |
tag | IResolvable | IResolvable | Launch [] | The tags to apply to the launch template on creation. |
version | string | A description for the first version of the launch template. |
launchTemplateData
Type:
IResolvable
|
Launch
The information for the launch template.
launchTemplateName?
Type:
string
(optional)
A name for the launch template.
tagSpecifications?
Type:
IResolvable
|
IResolvable
|
Launch
[]
(optional)
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 the resources that are created when an instance is launched, you must use the
TagSpecifications
parameter in the launch template data structure.
versionDescription?
Type:
string
(optional)
A description for the first version of the launch template.