InstanceLaunchTemplateProperty Struct
The launch template configuration for Amazon ECS Managed Instances.
This defines how Amazon ECS launches Amazon EC2 instances, including the instance profile for your tasks, network and storage configuration, capacity options, and instance requirements for flexible instance type selection.
| Source | |
|---|---|
| Type last changed |
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ecs as ecs } from 'aws-cdk-lib';
const instanceLaunchTemplateProperty: ecs.CfnCapacityProvider.InstanceLaunchTemplateProperty = {
ec2InstanceProfileArn: 'ec2InstanceProfileArn',
networkConfiguration: {
securityGroups: ['securityGroups'],
subnets: ['subnets'],
},
// the properties below are optional
capacityOptionType: 'capacityOptionType',
capacityReservations: {
reservationGroupArn: 'reservationGroupArn',
reservationPreference: 'reservationPreference',
},
fipsEnabled: false,
instanceMetadataTagsPropagation: false,
instanceRequirements: {
memoryMiB: {
min: 123,
// the properties below are optional
max: 123,
},
vCpuCount: {
min: 123,
// the properties below are optional
max: 123,
},
// the properties below are optional
acceleratorCount: {
max: 123,
min: 123,
},
acceleratorManufacturers: ['acceleratorManufacturers'],
acceleratorNames: ['acceleratorNames'],
acceleratorTotalMemoryMiB: {
max: 123,
min: 123,
},
acceleratorTypes: ['acceleratorTypes'],
allowedInstanceTypes: ['allowedInstanceTypes'],
bareMetal: 'bareMetal',
baselineEbsBandwidthMbps: {
max: 123,
min: 123,
},
burstablePerformance: 'burstablePerformance',
cpuManufacturers: ['cpuManufacturers'],
excludedInstanceTypes: ['excludedInstanceTypes'],
instanceGenerations: ['instanceGenerations'],
localStorage: 'localStorage',
localStorageTypes: ['localStorageTypes'],
maxSpotPriceAsPercentageOfOptimalOnDemandPrice: 123,
memoryGiBPerVCpu: {
max: 123,
min: 123,
},
networkBandwidthGbps: {
max: 123,
min: 123,
},
networkInterfaceCount: {
max: 123,
min: 123,
},
onDemandMaxPricePercentageOverLowestPrice: 123,
requireHibernateSupport: false,
spotMaxPricePercentageOverLowestPrice: 123,
totalLocalStorageGb: {
max: 123,
min: 123,
},
},
localStorageConfiguration: {
useLocalStorage: false,
},
monitoring: 'monitoring',
nitroEnclavesEnabled: false,
storageConfiguration: {
storageSizeGiB: 123,
},
};
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ecs as ecs
instance_launch_template_property = ecs.CfnCapacityProvider.InstanceLaunchTemplateProperty(
ec2_instance_profile_arn="ec2InstanceProfileArn",
network_configuration=ecs.CfnCapacityProvider.ManagedInstancesNetworkConfigurationProperty(
security_groups=["securityGroups"],
subnets=["subnets"]
),
# the properties below are optional
capacity_option_type="capacityOptionType",
capacity_reservations=ecs.CfnCapacityProvider.CapacityReservationRequestProperty(
reservation_group_arn="reservationGroupArn",
reservation_preference="reservationPreference"
),
fips_enabled=False,
instance_metadata_tags_propagation=False,
instance_requirements=ecs.CfnCapacityProvider.InstanceRequirementsRequestProperty(
memory_mi_b=ecs.CfnCapacityProvider.MemoryMiBRequestProperty(
min=123,
# the properties below are optional
max=123
),
v_cpu_count=ecs.CfnCapacityProvider.VCpuCountRangeRequestProperty(
min=123,
# the properties below are optional
max=123
),
# the properties below are optional
accelerator_count=ecs.CfnCapacityProvider.AcceleratorCountRequestProperty(
max=123,
min=123
),
accelerator_manufacturers=["acceleratorManufacturers"],
accelerator_names=["acceleratorNames"],
accelerator_total_memory_mi_b=ecs.CfnCapacityProvider.AcceleratorTotalMemoryMiBRequestProperty(
max=123,
min=123
),
accelerator_types=["acceleratorTypes"],
allowed_instance_types=["allowedInstanceTypes"],
bare_metal="bareMetal",
baseline_ebs_bandwidth_mbps=ecs.CfnCapacityProvider.BaselineEbsBandwidthMbpsRequestProperty(
max=123,
min=123
),
burstable_performance="burstablePerformance",
cpu_manufacturers=["cpuManufacturers"],
excluded_instance_types=["excludedInstanceTypes"],
instance_generations=["instanceGenerations"],
local_storage="localStorage",
local_storage_types=["localStorageTypes"],
max_spot_price_as_percentage_of_optimal_on_demand_price=123,
memory_gi_b_per_v_cpu=ecs.CfnCapacityProvider.MemoryGiBPerVCpuRequestProperty(
max=123,
min=123
),
network_bandwidth_gbps=ecs.CfnCapacityProvider.NetworkBandwidthGbpsRequestProperty(
max=123,
min=123
),
network_interface_count=ecs.CfnCapacityProvider.NetworkInterfaceCountRequestProperty(
max=123,
min=123
),
on_demand_max_price_percentage_over_lowest_price=123,
require_hibernate_support=False,
spot_max_price_percentage_over_lowest_price=123,
total_local_storage_gb=ecs.CfnCapacityProvider.TotalLocalStorageGBRequestProperty(
max=123,
min=123
)
),
local_storage_configuration=ecs.CfnCapacityProvider.ManagedInstancesLocalStorageConfigurationProperty(
use_local_storage=False
),
monitoring="monitoring",
nitro_enclaves_enabled=False,
storage_configuration=ecs.CfnCapacityProvider.ManagedInstancesStorageConfigurationProperty(
storage_size_gi_b=123
)
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ecs.*;
InstanceLaunchTemplateProperty instanceLaunchTemplateProperty = InstanceLaunchTemplateProperty.builder()
.ec2InstanceProfileArn("ec2InstanceProfileArn")
.networkConfiguration(ManagedInstancesNetworkConfigurationProperty.builder()
.securityGroups(List.of("securityGroups"))
.subnets(List.of("subnets"))
.build())
// the properties below are optional
.capacityOptionType("capacityOptionType")
.capacityReservations(CapacityReservationRequestProperty.builder()
.reservationGroupArn("reservationGroupArn")
.reservationPreference("reservationPreference")
.build())
.fipsEnabled(false)
.instanceMetadataTagsPropagation(false)
.instanceRequirements(InstanceRequirementsRequestProperty.builder()
.memoryMiB(MemoryMiBRequestProperty.builder()
.min(123)
// the properties below are optional
.max(123)
.build())
.vCpuCount(VCpuCountRangeRequestProperty.builder()
.min(123)
// the properties below are optional
.max(123)
.build())
// the properties below are optional
.acceleratorCount(AcceleratorCountRequestProperty.builder()
.max(123)
.min(123)
.build())
.acceleratorManufacturers(List.of("acceleratorManufacturers"))
.acceleratorNames(List.of("acceleratorNames"))
.acceleratorTotalMemoryMiB(AcceleratorTotalMemoryMiBRequestProperty.builder()
.max(123)
.min(123)
.build())
.acceleratorTypes(List.of("acceleratorTypes"))
.allowedInstanceTypes(List.of("allowedInstanceTypes"))
.bareMetal("bareMetal")
.baselineEbsBandwidthMbps(BaselineEbsBandwidthMbpsRequestProperty.builder()
.max(123)
.min(123)
.build())
.burstablePerformance("burstablePerformance")
.cpuManufacturers(List.of("cpuManufacturers"))
.excludedInstanceTypes(List.of("excludedInstanceTypes"))
.instanceGenerations(List.of("instanceGenerations"))
.localStorage("localStorage")
.localStorageTypes(List.of("localStorageTypes"))
.maxSpotPriceAsPercentageOfOptimalOnDemandPrice(123)
.memoryGiBPerVCpu(MemoryGiBPerVCpuRequestProperty.builder()
.max(123)
.min(123)
.build())
.networkBandwidthGbps(NetworkBandwidthGbpsRequestProperty.builder()
.max(123)
.min(123)
.build())
.networkInterfaceCount(NetworkInterfaceCountRequestProperty.builder()
.max(123)
.min(123)
.build())
.onDemandMaxPricePercentageOverLowestPrice(123)
.requireHibernateSupport(false)
.spotMaxPricePercentageOverLowestPrice(123)
.totalLocalStorageGb(TotalLocalStorageGBRequestProperty.builder()
.max(123)
.min(123)
.build())
.build())
.localStorageConfiguration(ManagedInstancesLocalStorageConfigurationProperty.builder()
.useLocalStorage(false)
.build())
.monitoring("monitoring")
.nitroEnclavesEnabled(false)
.storageConfiguration(ManagedInstancesStorageConfigurationProperty.builder()
.storageSizeGiB(123)
.build())
.build();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ECS;
var instanceLaunchTemplateProperty = new InstanceLaunchTemplateProperty {
Ec2InstanceProfileArn = "ec2InstanceProfileArn",
NetworkConfiguration = new ManagedInstancesNetworkConfigurationProperty {
SecurityGroups = new [] { "securityGroups" },
Subnets = new [] { "subnets" }
},
// the properties below are optional
CapacityOptionType = "capacityOptionType",
CapacityReservations = new CapacityReservationRequestProperty {
ReservationGroupArn = "reservationGroupArn",
ReservationPreference = "reservationPreference"
},
FipsEnabled = false,
InstanceMetadataTagsPropagation = false,
InstanceRequirements = new InstanceRequirementsRequestProperty {
MemoryMiB = new MemoryMiBRequestProperty {
Min = 123,
// the properties below are optional
Max = 123
},
VCpuCount = new VCpuCountRangeRequestProperty {
Min = 123,
// the properties below are optional
Max = 123
},
// the properties below are optional
AcceleratorCount = new AcceleratorCountRequestProperty {
Max = 123,
Min = 123
},
AcceleratorManufacturers = new [] { "acceleratorManufacturers" },
AcceleratorNames = new [] { "acceleratorNames" },
AcceleratorTotalMemoryMiB = new AcceleratorTotalMemoryMiBRequestProperty {
Max = 123,
Min = 123
},
AcceleratorTypes = new [] { "acceleratorTypes" },
AllowedInstanceTypes = new [] { "allowedInstanceTypes" },
BareMetal = "bareMetal",
BaselineEbsBandwidthMbps = new BaselineEbsBandwidthMbpsRequestProperty {
Max = 123,
Min = 123
},
BurstablePerformance = "burstablePerformance",
CpuManufacturers = new [] { "cpuManufacturers" },
ExcludedInstanceTypes = new [] { "excludedInstanceTypes" },
InstanceGenerations = new [] { "instanceGenerations" },
LocalStorage = "localStorage",
LocalStorageTypes = new [] { "localStorageTypes" },
MaxSpotPriceAsPercentageOfOptimalOnDemandPrice = 123,
MemoryGiBPerVCpu = new MemoryGiBPerVCpuRequestProperty {
Max = 123,
Min = 123
},
NetworkBandwidthGbps = new NetworkBandwidthGbpsRequestProperty {
Max = 123,
Min = 123
},
NetworkInterfaceCount = new NetworkInterfaceCountRequestProperty {
Max = 123,
Min = 123
},
OnDemandMaxPricePercentageOverLowestPrice = 123,
RequireHibernateSupport = false,
SpotMaxPricePercentageOverLowestPrice = 123,
TotalLocalStorageGb = new TotalLocalStorageGBRequestProperty {
Max = 123,
Min = 123
}
},
LocalStorageConfiguration = new ManagedInstancesLocalStorageConfigurationProperty {
UseLocalStorage = false
},
Monitoring = "monitoring",
NitroEnclavesEnabled = false,
StorageConfiguration = new ManagedInstancesStorageConfigurationProperty {
StorageSizeGiB = 123
}
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
instanceLaunchTemplateProperty := &InstanceLaunchTemplateProperty{
Ec2InstanceProfileArn: jsii.String("ec2InstanceProfileArn"),
NetworkConfiguration: &ManagedInstancesNetworkConfigurationProperty{
SecurityGroups: []*string{
jsii.String("securityGroups"),
},
Subnets: []*string{
jsii.String("subnets"),
},
},
// the properties below are optional
CapacityOptionType: jsii.String("capacityOptionType"),
CapacityReservations: &CapacityReservationRequestProperty{
ReservationGroupArn: jsii.String("reservationGroupArn"),
ReservationPreference: jsii.String("reservationPreference"),
},
FipsEnabled: jsii.Boolean(false),
InstanceMetadataTagsPropagation: jsii.Boolean(false),
InstanceRequirements: &InstanceRequirementsRequestProperty{
MemoryMiB: &MemoryMiBRequestProperty{
Min: jsii.Number(123),
// the properties below are optional
Max: jsii.Number(123),
},
VCpuCount: &VCpuCountRangeRequestProperty{
Min: jsii.Number(123),
// the properties below are optional
Max: jsii.Number(123),
},
// the properties below are optional
AcceleratorCount: &AcceleratorCountRequestProperty{
Max: jsii.Number(123),
Min: jsii.Number(123),
},
AcceleratorManufacturers: []*string{
jsii.String("acceleratorManufacturers"),
},
AcceleratorNames: []*string{
jsii.String("acceleratorNames"),
},
AcceleratorTotalMemoryMiB: &AcceleratorTotalMemoryMiBRequestProperty{
Max: jsii.Number(123),
Min: jsii.Number(123),
},
AcceleratorTypes: []*string{
jsii.String("acceleratorTypes"),
},
AllowedInstanceTypes: []*string{
jsii.String("allowedInstanceTypes"),
},
BareMetal: jsii.String("bareMetal"),
BaselineEbsBandwidthMbps: &BaselineEbsBandwidthMbpsRequestProperty{
Max: jsii.Number(123),
Min: jsii.Number(123),
},
BurstablePerformance: jsii.String("burstablePerformance"),
CpuManufacturers: []*string{
jsii.String("cpuManufacturers"),
},
ExcludedInstanceTypes: []*string{
jsii.String("excludedInstanceTypes"),
},
InstanceGenerations: []*string{
jsii.String("instanceGenerations"),
},
LocalStorage: jsii.String("localStorage"),
LocalStorageTypes: []*string{
jsii.String("localStorageTypes"),
},
MaxSpotPriceAsPercentageOfOptimalOnDemandPrice: jsii.Number(123),
MemoryGiBPerVCpu: &MemoryGiBPerVCpuRequestProperty{
Max: jsii.Number(123),
Min: jsii.Number(123),
},
NetworkBandwidthGbps: &NetworkBandwidthGbpsRequestProperty{
Max: jsii.Number(123),
Min: jsii.Number(123),
},
NetworkInterfaceCount: &NetworkInterfaceCountRequestProperty{
Max: jsii.Number(123),
Min: jsii.Number(123),
},
OnDemandMaxPricePercentageOverLowestPrice: jsii.Number(123),
RequireHibernateSupport: jsii.Boolean(false),
SpotMaxPricePercentageOverLowestPrice: jsii.Number(123),
TotalLocalStorageGb: &TotalLocalStorageGBRequestProperty{
Max: jsii.Number(123),
Min: jsii.Number(123),
},
},
LocalStorageConfiguration: &ManagedInstancesLocalStorageConfigurationProperty{
UseLocalStorage: jsii.Boolean(false),
},
Monitoring: jsii.String("monitoring"),
NitroEnclavesEnabled: jsii.Boolean(false),
StorageConfiguration: &ManagedInstancesStorageConfigurationProperty{
StorageSizeGiB: jsii.Number(123),
},
}
Properties
capacityOptionTypeoptionalstringcapacity_option_typeoptionalstrcapacityOptionTypeoptionalStringCapacityOptionTypeoptionalstringCapacityOptionTypeoptional*string #notes
This determines whether Amazon ECS launches On-Demand or Spot Instances for your managed instance capacity provider.
Valid values are:
ON_DEMAND- Launches standard On-Demand Instances. On-Demand Instances provide predictable pricing and availability.SPOT- Launches Spot Instances that use spare Amazon EC2 capacity at reduced cost. Spot Instances can be interrupted by Amazon EC2 with a two-minute notification when the capacity is needed back.
The default is On-Demand
For more information about Amazon EC2 capacity options, see Instance purchasing options in the Amazon EC2 User Guide .
capacityReservationsoptionalIResolvable | CfnCapacityProvider.capacity_reservationsoptionaltyping.Union[IResolvable, CapacityReservationRequestProperty]capacityReservationsoptionalIResolvableCapacityReservationsoptionalIResolvableCapacityReservationsoptionalinterface{} #ec2InstanceProfileArnstringec2_instance_profile_arnstrec2InstanceProfileArnStringEc2InstanceProfileArnstringEc2InstanceProfileArn*string required #notes
This instance profile must include the necessary permissions for your tasks to access AWS services and resources.
For more information, see Amazon ECS instance profile for Managed Instances in the Amazon ECS Developer Guide .
fipsEnabledoptionalboolean | IResolvablefips_enabledoptionaltyping.Union[bool, IResolvable]fipsEnabledoptionalBooleanFipsEnabledoptionalboolFipsEnabledoptionalinterface{} #instanceMetadataTagsPropagationoptionalboolean | IResolvableinstance_metadata_tags_propagationoptionaltyping.Union[bool, IResolvable]instanceMetadataTagsPropagationoptionalBooleanInstanceMetadataTagsPropagationoptionalboolInstanceMetadataTagsPropagationoptionalinterface{} #instanceRequirementsoptionalIResolvable | CfnCapacityProvider.instance_requirementsoptionaltyping.Union[IResolvable, InstanceRequirementsRequestProperty]instanceRequirementsoptionalIResolvableInstanceRequirementsoptionalIResolvableInstanceRequirementsoptionalinterface{} #- The instance types
- Instance requirements such as vCPU count, memory, network performance, and accelerator specifications
Amazon ECS automatically selects the instances that match the specified criteria.
localStorageConfigurationoptionalIResolvable | CfnCapacityProvider.local_storage_configurationoptionaltyping.Union[IResolvable, ManagedInstancesLocalStorageConfigurationProperty]localStorageConfigurationoptionalIResolvableLocalStorageConfigurationoptionalIResolvableLocalStorageConfigurationoptionalinterface{} #monitoringoptionalstringmonitoringoptionalstrmonitoringoptionalStringMonitoringoptionalstringMonitoringoptional*string #notes
By default, your managed instance is configured for basic monitoring. You can optionally enable detailed monitoring to help you more quickly identify and act on operational issues. You can enable or turn off detailed monitoring at launch or when the managed instance is running or stopped. For more information, see Detailed monitoring for Amazon ECS Managed Instances in the Amazon ECS Developer Guide.
networkConfigurationIResolvable | CfnCapacityProvider.network_configurationtyping.Union[IResolvable, ManagedInstancesNetworkConfigurationProperty]networkConfigurationIResolvableNetworkConfigurationIResolvableNetworkConfigurationinterface{} required #This specifies the subnets and security groups that instances use for network connectivity.
nitroEnclavesEnabledoptionalboolean | IResolvablenitro_enclaves_enabledoptionaltyping.Union[bool, IResolvable]nitroEnclavesEnabledoptionalBooleanNitroEnclavesEnabledoptionalboolNitroEnclavesEnabledoptionalinterface{} #storageConfigurationoptionalIResolvable | CfnCapacityProvider.storage_configurationoptionaltyping.Union[IResolvable, ManagedInstancesStorageConfigurationProperty]storageConfigurationoptionalIResolvableStorageConfigurationoptionalIResolvableStorageConfigurationoptionalinterface{} #This defines the root volume size and type for the instances.