aws::launch-template

Creates a Launch Template from config or an existing Instance Id.

Example

aws::launch-template launch-template
    name: "launch-template-gyro-1"
    ami: "amzn-ami-hvm-2018.03.0.20181129-x86_64-gp2"
    shutdown-behavior: "STOP"
    instance-type: "t2.micro"
    key-name: "example"
    security-groups: [
        $(aws::security-group security-group-launch-template-example-1),
        $(aws::security-group security-group-launch-template-example-2)
    ]
    disable-api-termination: false
    ebs-optimized: false

    block-device-mapping
        device-name: "/dev/sdb"
        volume-size: 100
        auto-enable-io: false
    end

    capacity-reservation: "open"

    network-interfaces:[
        $(aws::network-interface nic-example-launch-template-1),
        $(aws::network-interface nic-example-launch-template-2)
    ]

    tags: {
        Name: "launch-template-example-1"
    }
end

Attributes

Attribute Description
name The name of the launch template. (Required)
ami The AMI to be used to launch the Instance created by this Template.
ebs-optimized When set to true, EBS optimization for an instance is enabled. Defaults to false. See Amazon EBS–Optimized Instances.
configure-hibernate-option When set to true, hibernate options for an instance are enabled. Defaults to false. See Hibernate your Instances.
shutdown-behavior The shutdown behavior options for an instance. Valid values are stop or terminate. See Changing the Instance Initiated Shutdown Behavior.
instance-type The launch instance with the type of hardware you desire. See Instance Types.
key-name The launch instance with the key name of an EC2 Key Pair. This is a certificate required to access your instance. See `Amazon EC2 Key Pairs < https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html/>`_.
security-groups list The security groups associated with the launch instance. Required if Network Interface not configured. See Amazon EC2 Security Groups for Linux Instances.
disable-api-termination When set to true, api termination of an instance is enabled. See Enabling Termination Protection for an Instance.
user-data The user data for your instance. See Instance Metadata and User Data.
block-device-mapping list subresource The block device Mapping for the instances being launched using this template.
capacity-reservation The capacity reservation for the instances being launched using this template.
instance-profile Iam instance profile to be linked with the instances being launched using this template.
network-interfaces set The set of Network Interfaces to be attached to the instances being launched using this template. Required if Security Group not provided.
metadata-options subresource

The metadata options for the instance.

http-endpoint
Enable or disable the HTTP metadata endpoint. Valid values are: enabled, or disabled.
http-put-response-hop-limit
Hop limit for instance metadata requests.
http-tokens
Specify if a token is required for instance metadata requests. Default is optional.
credit-specification The credit specifications for the instance.
elastic-gpu-specification list The elastic GPU to associate with the instance.
inference-accelerator list The elastic inference accelerator for the instance.
enclave-options The enclave options for the instance.
hibernation-options The hibernation options for the instance.
market-options The spot market options for the instance.
tag-specification list subresource

The tags to apply to the resources during launch.

resource-type
The type of resource to tag. Valid values are CLIENT_VPN_ENDPOINT, CUSTOMER_GATEWAY, DEDICATED_HOST, DHCP_OPTIONS, EGRESS_ONLY_INTERNET_GATEWAY, ELASTIC_IP, ELASTIC_GPU, EXPORT_IMAGE_TASK, EXPORT_INSTANCE_TASK, FLEET, FPGA_IMAGE, HOST_RESERVATION, IMAGE, IMPORT_IMAGE_TASK, IMPORT_SNAPSHOT_TASK, INSTANCE, INTERNET_GATEWAY, KEY_PAIR, LAUNCH_TEMPLATE, LOCAL_GATEWAY_ROUTE_TABLE_VPC_ASSOCIATION, NATGATEWAY, NETWORK_ACL, NETWORK_INTERFACE, NETWORK_INSIGHTS_ANALYSIS, NETWORK_INSIGHTS_PATH, PLACEMENT_GROUP, RESERVED_INSTANCES, ROUTE_TABLE, SECURITY_GROUP, SNAPSHOT, SPOT_FLEET_REQUEST, SPOT_INSTANCES_REQUEST, SUBNET, TRAFFIC_MIRROR_FILTER, TRAFFIC_MIRROR_SESSION, TRAFFIC_MIRROR_TARGET, TRANSIT_GATEWAY, TRANSIT_GATEWAY_ATTACHMENT, TRANSIT_GATEWAY_CONNECT_PEER, TRANSIT_GATEWAY_MULTICAST_DOMAIN, TRANSIT_GATEWAY_ROUTE_TABLE, VOLUME, VPC, VPC_PEERING_CONNECTION, VPN_CONNECTION, VPN_GATEWAY or VPC_FLOW_LOG. (Required)
tags map
The tags to apply to the resource. (Required)
kernel-id The ID of the kernel.
ram-disk-id The ID of the RAM disk. Can only be set if kernel is set.
placement The placement for the instance;
cpu-options The cpu options for the instance.
monitoring The monitoring for the instance.

Outputs

Attribute Description
id The ID of the launch template.
version The version of the Launch Template.