Interface EcsFargateLaunchTargetOptions
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
EcsFargateLaunchTargetOptions.Jsii$Proxy
@Generated(value="jsii-pacmak/1.126.0 (build 206d44b)",
date="2026-02-03T13:58:32.219Z")
@Stability(Stable)
public interface EcsFargateLaunchTargetOptions
extends software.amazon.jsii.JsiiSerializable
Properties to define an ECS service.
Example:
IVpc vpc = Vpc.fromLookup(this, "Vpc", VpcLookupOptions.builder()
.isDefault(true)
.build());
Cluster cluster = Cluster.Builder.create(this, "FargateCluster").vpc(vpc).build();
TaskDefinition taskDefinition = TaskDefinition.Builder.create(this, "TD")
.memoryMiB("512")
.cpu("256")
.compatibility(Compatibility.FARGATE)
.build();
// Use custom() option - specify custom capacity provider strategy
EcsRunTask runTaskWithCustom = EcsRunTask.Builder.create(this, "RunTaskWithCustom")
.cluster(cluster)
.taskDefinition(taskDefinition)
.launchTarget(EcsFargateLaunchTarget.Builder.create()
.platformVersion(FargatePlatformVersion.VERSION1_4)
.capacityProviderOptions(CapacityProviderOptions.custom(List.of(CapacityProviderStrategy.builder().capacityProvider("FARGATE_SPOT").weight(2).base(1).build(), CapacityProviderStrategy.builder().capacityProvider("FARGATE").weight(1).build())))
.build())
.build();
// Use default() option - uses cluster's default capacity provider strategy
EcsRunTask runTaskWithDefault = EcsRunTask.Builder.create(this, "RunTaskWithDefault")
.cluster(cluster)
.taskDefinition(taskDefinition)
.launchTarget(EcsFargateLaunchTarget.Builder.create()
.platformVersion(FargatePlatformVersion.VERSION1_4)
.capacityProviderOptions(CapacityProviderOptions.default())
.build())
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forEcsFargateLaunchTargetOptionsstatic final classAn implementation forEcsFargateLaunchTargetOptions -
Method Summary
Modifier and TypeMethodDescriptionbuilder()default CapacityProviderOptionsThe capacity provider options to use for the task.Refers to a specific runtime environment for Fargate task infrastructure.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getPlatformVersion
Refers to a specific runtime environment for Fargate task infrastructure.Fargate platform version is a combination of the kernel and container runtime versions.
- See Also:
-
getCapacityProviderOptions
The capacity provider options to use for the task.This property allows you to set the capacity provider strategy for the task.
If you want to set the capacity provider strategy for the task, specify
CapacityProviderOptions.custom(). This is required to use the FARGATE_SPOT capacity provider.If you want to use the cluster's default capacity provider strategy, specify
CapacityProviderOptions.default().Default: - 'FARGATE' LaunchType running tasks on AWS Fargate On-Demand infrastructure is used without the capacity provider strategy.
-
builder
-