CfnLaunchTemplateProps

class aws_cdk.aws_ec2.CfnLaunchTemplateProps(*, launch_template_data, launch_template_name=None, tag_specifications=None, version_description=None)

Bases: object

Properties for defining a CfnLaunchTemplate.

Parameters:
  • launch_template_data (Union[IResolvable, LaunchTemplateDataProperty, Dict[str, Any]]) – The information for the launch template.

  • launch_template_name (Optional[str]) – A name for the launch template.

  • tag_specifications (Union[IResolvable, Sequence[Union[IResolvable, LaunchTemplateTagSpecificationProperty, Dict[str, Any]]], None]) – The tags to apply to the launch template on creation. To tag the launch template, the resource type must be launch-template . .. epigraph:: 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.

  • version_description (Optional[str]) – A description for the first version of the launch template.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html

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

launch_template_data

The information for the launch template.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html#cfn-ec2-launchtemplate-launchtemplatedata

launch_template_name

A name for the launch template.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html#cfn-ec2-launchtemplate-launchtemplatename

tag_specifications

The tags to apply to the launch template on creation.

To tag the launch template, the resource type must be launch-template . .. epigraph:

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 <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestLaunchTemplateData.html>`_ structure.
Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html#cfn-ec2-launchtemplate-tagspecifications

version_description

A description for the first version of the launch template.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html#cfn-ec2-launchtemplate-versiondescription