LaunchTemplateSpec

class aws_cdk.aws_eks.LaunchTemplateSpec(*, id, version=None)

Bases: object

Launch template property specification.

Parameters
  • id (str) – The Launch template ID.

  • version (Optional[str]) – The launch template version to be used (optional). Default: - the default version of the launch template

ExampleMetadata

infused

Example:

# cluster: eks.Cluster


user_data = """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==--\
"""
lt = ec2.CfnLaunchTemplate(self, "LaunchTemplate",
    launch_template_data=ec2.CfnLaunchTemplate.LaunchTemplateDataProperty(
        instance_type="t3.small",
        user_data=Fn.base64(user_data)
    )
)

cluster.add_nodegroup_capacity("extra-ng",
    launch_template_spec=eks.LaunchTemplateSpec(
        id=lt.ref,
        version=lt.attr_latest_version_number
    )
)

Attributes

id

The Launch template ID.

Return type

str

version

The launch template version to be used (optional).

Default
  • the default version of the launch template

Return type

Optional[str]