Show / Hide Table of Contents

Class CfnLaunchTemplate.LaunchTemplateDataProperty

The information to include in the launch template.

Inheritance
System.Object
CfnLaunchTemplate.LaunchTemplateDataProperty
Implements
CfnLaunchTemplate.ILaunchTemplateDataProperty
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.AWS.EC2.dll
Syntax (csharp)
public class LaunchTemplateDataProperty : Object, CfnLaunchTemplate.ILaunchTemplateDataProperty
Syntax (vb)
Public Class LaunchTemplateDataProperty
    Inherits Object
    Implements CfnLaunchTemplate.ILaunchTemplateDataProperty
Remarks

You must specify at least one parameter for the launch template data.

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata.html

ExampleMetadata: fixture=_generated

Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;

LaunchTemplateDataProperty launchTemplateDataProperty = new LaunchTemplateDataProperty {
    BlockDeviceMappings = new [] { new BlockDeviceMappingProperty {
        DeviceName = "deviceName",
        Ebs = new EbsProperty {
            DeleteOnTermination = false,
            Encrypted = false,
            Iops = 123,
            KmsKeyId = "kmsKeyId",
            SnapshotId = "snapshotId",
            Throughput = 123,
            VolumeSize = 123,
            VolumeType = "volumeType"
        },
        NoDevice = "noDevice",
        VirtualName = "virtualName"
    } },
    CapacityReservationSpecification = new CapacityReservationSpecificationProperty {
        CapacityReservationPreference = "capacityReservationPreference",
        CapacityReservationTarget = new CapacityReservationTargetProperty {
            CapacityReservationId = "capacityReservationId",
            CapacityReservationResourceGroupArn = "capacityReservationResourceGroupArn"
        }
    },
    CpuOptions = new CpuOptionsProperty {
        CoreCount = 123,
        ThreadsPerCore = 123
    },
    CreditSpecification = new CreditSpecificationProperty {
        CpuCredits = "cpuCredits"
    },
    DisableApiStop = false,
    DisableApiTermination = false,
    EbsOptimized = false,
    ElasticGpuSpecifications = new [] { new ElasticGpuSpecificationProperty {
        Type = "type"
    } },
    ElasticInferenceAccelerators = new [] { new LaunchTemplateElasticInferenceAcceleratorProperty {
        Count = 123,
        Type = "type"
    } },
    EnclaveOptions = new EnclaveOptionsProperty {
        Enabled = false
    },
    HibernationOptions = new HibernationOptionsProperty {
        Configured = false
    },
    IamInstanceProfile = new IamInstanceProfileProperty {
        Arn = "arn",
        Name = "name"
    },
    ImageId = "imageId",
    InstanceInitiatedShutdownBehavior = "instanceInitiatedShutdownBehavior",
    InstanceMarketOptions = new InstanceMarketOptionsProperty {
        MarketType = "marketType",
        SpotOptions = new SpotOptionsProperty {
            BlockDurationMinutes = 123,
            InstanceInterruptionBehavior = "instanceInterruptionBehavior",
            MaxPrice = "maxPrice",
            SpotInstanceType = "spotInstanceType",
            ValidUntil = "validUntil"
        }
    },
    InstanceRequirements = new InstanceRequirementsProperty {
        AcceleratorCount = new AcceleratorCountProperty {
            Max = 123,
            Min = 123
        },
        AcceleratorManufacturers = new [] { "acceleratorManufacturers" },
        AcceleratorNames = new [] { "acceleratorNames" },
        AcceleratorTotalMemoryMiB = new AcceleratorTotalMemoryMiBProperty {
            Max = 123,
            Min = 123
        },
        AcceleratorTypes = new [] { "acceleratorTypes" },
        BareMetal = "bareMetal",
        BaselineEbsBandwidthMbps = new BaselineEbsBandwidthMbpsProperty {
            Max = 123,
            Min = 123
        },
        BurstablePerformance = "burstablePerformance",
        CpuManufacturers = new [] { "cpuManufacturers" },
        ExcludedInstanceTypes = new [] { "excludedInstanceTypes" },
        InstanceGenerations = new [] { "instanceGenerations" },
        LocalStorage = "localStorage",
        LocalStorageTypes = new [] { "localStorageTypes" },
        MemoryGiBPerVCpu = new MemoryGiBPerVCpuProperty {
            Max = 123,
            Min = 123
        },
        MemoryMiB = new MemoryMiBProperty {
            Max = 123,
            Min = 123
        },
        NetworkInterfaceCount = new NetworkInterfaceCountProperty {
            Max = 123,
            Min = 123
        },
        OnDemandMaxPricePercentageOverLowestPrice = 123,
        RequireHibernateSupport = false,
        SpotMaxPricePercentageOverLowestPrice = 123,
        TotalLocalStorageGb = new TotalLocalStorageGBProperty {
            Max = 123,
            Min = 123
        },
        VCpuCount = new VCpuCountProperty {
            Max = 123,
            Min = 123
        }
    },
    InstanceType = "instanceType",
    KernelId = "kernelId",
    KeyName = "keyName",
    LicenseSpecifications = new [] { new LicenseSpecificationProperty {
        LicenseConfigurationArn = "licenseConfigurationArn"
    } },
    MaintenanceOptions = new MaintenanceOptionsProperty {
        AutoRecovery = "autoRecovery"
    },
    MetadataOptions = new MetadataOptionsProperty {
        HttpEndpoint = "httpEndpoint",
        HttpProtocolIpv6 = "httpProtocolIpv6",
        HttpPutResponseHopLimit = 123,
        HttpTokens = "httpTokens",
        InstanceMetadataTags = "instanceMetadataTags"
    },
    Monitoring = new MonitoringProperty {
        Enabled = false
    },
    NetworkInterfaces = new [] { new NetworkInterfaceProperty {
        AssociateCarrierIpAddress = false,
        AssociatePublicIpAddress = false,
        DeleteOnTermination = false,
        Description = "description",
        DeviceIndex = 123,
        Groups = new [] { "groups" },
        InterfaceType = "interfaceType",
        Ipv4PrefixCount = 123,
        Ipv4Prefixes = new [] { new Ipv4PrefixSpecificationProperty {
            Ipv4Prefix = "ipv4Prefix"
        } },
        Ipv6AddressCount = 123,
        Ipv6Addresses = new [] { new Ipv6AddProperty {
            Ipv6Address = "ipv6Address"
        } },
        Ipv6PrefixCount = 123,
        Ipv6Prefixes = new [] { new Ipv6PrefixSpecificationProperty {
            Ipv6Prefix = "ipv6Prefix"
        } },
        NetworkCardIndex = 123,
        NetworkInterfaceId = "networkInterfaceId",
        PrivateIpAddress = "privateIpAddress",
        PrivateIpAddresses = new [] { new PrivateIpAddProperty {
            Primary = false,
            PrivateIpAddress = "privateIpAddress"
        } },
        SecondaryPrivateIpAddressCount = 123,
        SubnetId = "subnetId"
    } },
    Placement = new PlacementProperty {
        Affinity = "affinity",
        AvailabilityZone = "availabilityZone",
        GroupName = "groupName",
        HostId = "hostId",
        HostResourceGroupArn = "hostResourceGroupArn",
        PartitionNumber = 123,
        SpreadDomain = "spreadDomain",
        Tenancy = "tenancy"
    },
    PrivateDnsNameOptions = new PrivateDnsNameOptionsProperty {
        EnableResourceNameDnsAaaaRecord = false,
        EnableResourceNameDnsARecord = false,
        HostnameType = "hostnameType"
    },
    RamDiskId = "ramDiskId",
    SecurityGroupIds = new [] { "securityGroupIds" },
    SecurityGroups = new [] { "securityGroups" },
    TagSpecifications = new [] { new TagSpecificationProperty {
        ResourceType = "resourceType",
        Tags = new [] { new CfnTag {
            Key = "key",
            Value = "value"
        } }
    } },
    UserData = "userData"
};

Synopsis

Constructors

LaunchTemplateDataProperty()

Properties

BlockDeviceMappings

The block device mapping.

CapacityReservationSpecification

The Capacity Reservation targeting option.

CpuOptions

The CPU options for the instance.

CreditSpecification

The credit option for CPU usage of the instance.

DisableApiStop

CfnLaunchTemplate.LaunchTemplateDataProperty.DisableApiStop.

DisableApiTermination

If you set this parameter to true , you can't terminate the instance using the Amazon EC2 console, CLI, or API;

EbsOptimized

Indicates whether the instance is optimized for Amazon EBS I/O.

ElasticGpuSpecifications

An elastic GPU to associate with the instance.

ElasticInferenceAccelerators

The elastic inference accelerator for the instance.

EnclaveOptions

Indicates whether the instance is enabled for AWS Nitro Enclaves.

HibernationOptions

Indicates whether an instance is enabled for hibernation.

IamInstanceProfile

The name or Amazon Resource Name (ARN) of an IAM instance profile.

ImageId

The ID of the AMI.

InstanceInitiatedShutdownBehavior

Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

InstanceMarketOptions

The market (purchasing) option for the instances.

InstanceRequirements

The attributes for the instance types.

InstanceType

The instance type. For more information, see Instance types in the Amazon Elastic Compute Cloud User Guide .

KernelId

The ID of the kernel.

KeyName

The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair .

LicenseSpecifications

The license configurations.

MaintenanceOptions

CfnLaunchTemplate.LaunchTemplateDataProperty.MaintenanceOptions.

MetadataOptions

The metadata options for the instance.

Monitoring

The monitoring for the instance.

NetworkInterfaces

One or more network interfaces.

Placement

The placement for the instance.

PrivateDnsNameOptions

The options for the instance hostname.

RamDiskId

The ID of the RAM disk.

SecurityGroupIds

One or more security group IDs.

SecurityGroups

[EC2-Classic, default VPC] One or more security group names.

TagSpecifications

The tags to apply to the resources during launch.

UserData

The user data to make available to the instance.

Constructors

LaunchTemplateDataProperty()

public LaunchTemplateDataProperty()

Properties

BlockDeviceMappings

The block device mapping.

public object BlockDeviceMappings { get; set; }
Property Value

System.Object

Remarks

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

CapacityReservationSpecification

The Capacity Reservation targeting option.

public object CapacityReservationSpecification { get; set; }
Property Value

System.Object

Remarks

If you do not specify this parameter, the instance's Capacity Reservation preference defaults to open , which enables it to run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).

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

CpuOptions

The CPU options for the instance.

public object CpuOptions { get; set; }
Property Value

System.Object

Remarks

For more information, see Optimizing CPU Options in the Amazon Elastic Compute Cloud User Guide .

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

CreditSpecification

The credit option for CPU usage of the instance.

public object CreditSpecification { get; set; }
Property Value

System.Object

Remarks

Valid for T2, T3, or T3a instances only.

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

DisableApiStop

CfnLaunchTemplate.LaunchTemplateDataProperty.DisableApiStop.

public object DisableApiStop { get; set; }
Property Value

System.Object

Remarks

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

DisableApiTermination

If you set this parameter to true , you can't terminate the instance using the Amazon EC2 console, CLI, or API;

public object DisableApiTermination { get; set; }
Property Value

System.Object

Remarks

otherwise, you can. To change this attribute after launch, use ModifyInstanceAttribute . Alternatively, if you set InstanceInitiatedShutdownBehavior to terminate , you can terminate the instance by running the shutdown command from the instance.

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

EbsOptimized

Indicates whether the instance is optimized for Amazon EBS I/O.

public object EbsOptimized { get; set; }
Property Value

System.Object

Remarks

This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.

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

ElasticGpuSpecifications

An elastic GPU to associate with the instance.

public object ElasticGpuSpecifications { get; set; }
Property Value

System.Object

Remarks

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

ElasticInferenceAccelerators

The elastic inference accelerator for the instance.

public object ElasticInferenceAccelerators { get; set; }
Property Value

System.Object

Remarks

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

EnclaveOptions

Indicates whether the instance is enabled for AWS Nitro Enclaves.

public object EnclaveOptions { get; set; }
Property Value

System.Object

Remarks

For more information, see What is AWS Nitro Enclaves? in the AWS Nitro Enclaves User Guide .

You can't enable AWS Nitro Enclaves and hibernation on the same instance.

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

HibernationOptions

Indicates whether an instance is enabled for hibernation.

public object HibernationOptions { get; set; }
Property Value

System.Object

Remarks

This parameter is valid only if the instance meets the hibernation prerequisites . For more information, see Hibernate your instance in the Amazon Elastic Compute Cloud User Guide .

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

IamInstanceProfile

The name or Amazon Resource Name (ARN) of an IAM instance profile.

public object IamInstanceProfile { get; set; }
Property Value

System.Object

Remarks

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

ImageId

The ID of the AMI.

public string ImageId { get; set; }
Property Value

System.String

Remarks

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

InstanceInitiatedShutdownBehavior

Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

public string InstanceInitiatedShutdownBehavior { get; set; }
Property Value

System.String

Remarks

Default: stop

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

InstanceMarketOptions

The market (purchasing) option for the instances.

public object InstanceMarketOptions { get; set; }
Property Value

System.Object

Remarks

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

InstanceRequirements

The attributes for the instance types.

public object InstanceRequirements { get; set; }
Property Value

System.Object

Remarks

When you specify instance attributes, Amazon EC2 will identify instance types with these attributes.

If you specify InstanceRequirements , you can't specify InstanceTypes .

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

InstanceType

The instance type. For more information, see Instance types in the Amazon Elastic Compute Cloud User Guide .

public string InstanceType { get; set; }
Property Value

System.String

Remarks

If you specify InstanceTypes , you can't specify InstanceRequirements .

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

KernelId

The ID of the kernel.

public string KernelId { get; set; }
Property Value

System.String

Remarks

We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User Provided Kernels in the Amazon EC2 User Guide .

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

KeyName

The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair .

public string KeyName { get; set; }
Property Value

System.String

Remarks

If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.

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

LicenseSpecifications

The license configurations.

public object LicenseSpecifications { get; set; }
Property Value

System.Object

Remarks

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

MaintenanceOptions

CfnLaunchTemplate.LaunchTemplateDataProperty.MaintenanceOptions.

public object MaintenanceOptions { get; set; }
Property Value

System.Object

Remarks

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

MetadataOptions

The metadata options for the instance.

public object MetadataOptions { get; set; }
Property Value

System.Object

Remarks

For more information, see Instance Metadata and User Data in the Amazon Elastic Compute Cloud User Guide .

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

Monitoring

The monitoring for the instance.

public object Monitoring { get; set; }
Property Value

System.Object

Remarks

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

NetworkInterfaces

One or more network interfaces.

public object NetworkInterfaces { get; set; }
Property Value

System.Object

Remarks

If you specify a network interface, you must specify any security groups and subnets as part of the network interface.

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

Placement

The placement for the instance.

public object Placement { get; set; }
Property Value

System.Object

Remarks

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

PrivateDnsNameOptions

The options for the instance hostname.

public object PrivateDnsNameOptions { get; set; }
Property Value

System.Object

Remarks

The default values are inherited from the subnet.

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

RamDiskId

The ID of the RAM disk.

public string RamDiskId { get; set; }
Property Value

System.String

Remarks

We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User provided kernels in the Amazon Elastic Compute Cloud User Guide .

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

SecurityGroupIds

One or more security group IDs.

public string[] SecurityGroupIds { get; set; }
Property Value

System.String[]

Remarks

You can create a security group using CreateSecurityGroup . You cannot specify both a security group ID and security name in the same request.

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

SecurityGroups

[EC2-Classic, default VPC] One or more security group names.

public string[] SecurityGroups { get; set; }
Property Value

System.String[]

Remarks

For a nondefault VPC, you must use security group IDs instead. You cannot specify both a security group ID and security name in the same request.

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

TagSpecifications

The tags to apply to the resources during launch.

public object TagSpecifications { get; set; }
Property Value

System.Object

Remarks

You can only tag instances and volumes on launch. The specified tags are applied to all instances or volumes that are created during launch.

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

UserData

The user data to make available to the instance.

public string UserData { get; set; }
Property Value

System.String

Remarks

You must provide base64-encoded text. User data is limited to 16 KB. For more information, see Run commands on your Linux instance at launch (Linux) or Work with instance user data (Windows) in the Amazon Elastic Compute Cloud User Guide .

If you are creating the launch template for use with AWS Batch , the user data must be provided in the MIME multi-part archive format . For more information, see Amazon EC2 user data in launch templates in the AWS Batch User Guide .

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

Implements

CfnLaunchTemplate.ILaunchTemplateDataProperty
Back to top Generated by DocFX