aws-cdk-lib.aws_ec2.CfnLaunchTemplateProps

interface CfnLaunchTemplateProps

LanguageType name
.NETAmazon.CDK.AWS.EC2.CfnLaunchTemplateProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsec2#CfnLaunchTemplateProps
Javasoftware.amazon.awscdk.services.ec2.CfnLaunchTemplateProps
Pythonaws_cdk.aws_ec2.CfnLaunchTemplateProps
TypeScript aws-cdk-lib » 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

NameTypeDescription
launchTemplateDataIResolvable | LaunchTemplateDataPropertyThe information for the launch template.
launchTemplateName?stringA name for the launch template.
tagSpecifications?IResolvable | IResolvable | LaunchTemplateTagSpecificationProperty[]The tags to apply to the launch template on creation.
versionDescription?stringA description for the first version of the launch template.

launchTemplateData

Type: IResolvable | LaunchTemplateDataProperty

The information for the launch template.


launchTemplateName?

Type: string (optional)

A name for the launch template.


tagSpecifications?

Type: IResolvable | IResolvable | LaunchTemplateTagSpecificationProperty[] (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.