interface LaunchTemplateSpec
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.EKS.LaunchTemplateSpec |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awseks#LaunchTemplateSpec |
Java | software.amazon.awscdk.services.eks.LaunchTemplateSpec |
Python | aws_cdk.aws_eks.LaunchTemplateSpec |
TypeScript (source) | aws-cdk-lib » aws_eks » LaunchTemplateSpec |
Launch template property specification.
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 |
---|---|---|
id | string | The Launch template ID. |
version? | string | The launch template version to be used (optional). |
id
Type:
string
The Launch template ID.
version?
Type:
string
(optional, default: the default version of the launch template)
The launch template version to be used (optional).