CfnLaunchTemplateProps Struct
Properties for defining a CfnLaunchTemplate.
Example
ts
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
launchTemplateDataIResolvable | CfnLaunchTemplate.LaunchTemplateDataPropertylaunch_template_datatyping.Union[IResolvable, LaunchTemplateDataProperty]launchTemplateDataIResolvableLaunchTemplateDataIResolvableLaunchTemplateDatainterface{}required#The information for the launch template.
launchTemplateNameoptionalstringlaunch_template_nameoptionalstrlaunchTemplateNameoptionalStringLaunchTemplateNameoptionalstringLaunchTemplateNameoptional*string#A name for the launch template.
tagSpecificationsoptionalIResolvable | IResolvable | CfnLaunchTemplate.LaunchTemplateTagSpecificationProperty[]tag_specificationsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, LaunchTemplateTagSpecificationProperty]]]tagSpecificationsoptionalIResolvableTagSpecificationsoptionalIResolvableTagSpecificationsoptionalinterface{}#The tags to apply to the launch template on creation.
notes
To tag the launch template, the resource type must be launch-template .
To specify the tags for resources that are created during instance launch, use TagSpecifications .
versionDescriptionoptionalstringversion_descriptionoptionalstrversionDescriptionoptionalStringVersionDescriptionoptionalstringVersionDescriptionoptional*string#A description for the first version of the launch template.