Class CfnLaunchTemplate.LaunchTemplateDataProperty
The information to include in the launch template.
Inheritance
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.
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;
var 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 {
AmdSevSnp = "amdSevSnp",
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" },
AllowedInstanceTypes = new [] { "allowedInstanceTypes" },
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
},
NetworkBandwidthGbps = new NetworkBandwidthGbpsProperty {
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",
GroupId = "groupId",
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 | Indicates whether to enable the instance for stop protection. |
DisableApiTermination | If you set this parameter to |
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 | The maintenance options of your instance. |
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 hostname type for EC2 instances launched into this subnet and how DNS A and AAAA record queries should be handled. |
RamDiskId | The ID of the RAM disk. |
SecurityGroupIds | The IDs of the security groups. |
SecurityGroups | One or more security group names. |
TagSpecifications | The tags to apply to the resources that are created during instance 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
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).
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 .
CreditSpecification
The credit option for CPU usage of the instance.
public object CreditSpecification { get; set; }
Property Value
System.Object
Remarks
DisableApiStop
Indicates whether to enable the instance for stop protection.
public object DisableApiStop { get; set; }
Property Value
System.Object
Remarks
For more information, see Stop protection in the Amazon Elastic Compute Cloud User Guide .
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.
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.
ElasticGpuSpecifications
An elastic GPU to associate with the instance.
public object ElasticGpuSpecifications { get; set; }
Property Value
System.Object
Remarks
ElasticInferenceAccelerators
The elastic inference accelerator for the instance.
public object ElasticInferenceAccelerators { get; set; }
Property Value
System.Object
Remarks
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.
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 .
IamInstanceProfile
The name or Amazon Resource Name (ARN) of an IAM instance profile.
public object IamInstanceProfile { get; set; }
Property Value
System.Object
Remarks
ImageId
The ID of the AMI.
public string ImageId { get; set; }
Property Value
System.String
Remarks
Alternatively, you can specify a Systems Manager parameter, which will resolve to an AMI ID on launch.
Valid formats:
For more information, see Use a Systems Manager parameter to find an AMI in the Amazon Elastic Compute Cloud User Guide .
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
InstanceMarketOptions
The market (purchasing) option for the instances.
public object InstanceMarketOptions { get; set; }
Property Value
System.Object
Remarks
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 InstanceType
.
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 InstanceType
, you can't specify InstanceRequirements
.
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 .
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.
LicenseSpecifications
The license configurations.
public object LicenseSpecifications { get; set; }
Property Value
System.Object
Remarks
MaintenanceOptions
The maintenance options of your instance.
public object MaintenanceOptions { get; set; }
Property Value
System.Object
Remarks
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 .
Monitoring
The monitoring for the instance.
public object Monitoring { get; set; }
Property Value
System.Object
Remarks
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.
Placement
The placement for the instance.
public object Placement { get; set; }
Property Value
System.Object
Remarks
PrivateDnsNameOptions
The hostname type for EC2 instances launched into this subnet and how DNS A and AAAA record queries should be handled.
public object PrivateDnsNameOptions { get; set; }
Property Value
System.Object
Remarks
For more information, see Amazon EC2 instance hostname types in the Amazon Elastic Compute Cloud User Guide .
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 .
SecurityGroupIds
The IDs of the security groups.
public string[] SecurityGroupIds { get; set; }
Property Value
System.String[]
Remarks
You can specify the IDs of existing security groups and references to resources created by the stack template.
SecurityGroups
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.
TagSpecifications
The tags to apply to the resources that are created during instance launch.
public object TagSpecifications { get; set; }
Property Value
System.Object
Remarks
You can specify tags for the following resources only:
To tag a resource after it has been created, see CreateTags .
To tag the launch template itself, you must use the <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateLaunchTemplate.html">TagSpecification</a> parameter.
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 .