Class EcsEc2LaunchTarget
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.stepfunctions.tasks.EcsEc2LaunchTarget
- All Implemented Interfaces:
IEcsLaunchTarget
,software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:47.951Z")
@Stability(Stable)
public class EcsEc2LaunchTarget
extends software.amazon.jsii.JsiiObject
implements IEcsLaunchTarget
Configuration for running an ECS task on EC2.
Example:
IVpc vpc = Vpc.fromLookup(this, "Vpc", VpcLookupOptions.builder() .isDefault(true) .build()); Cluster cluster = Cluster.Builder.create(this, "Ec2Cluster").vpc(vpc).build(); cluster.addCapacity("DefaultAutoScalingGroup", AddCapacityOptions.builder() .instanceType(new InstanceType("t2.micro")) .vpcSubnets(SubnetSelection.builder().subnetType(SubnetType.PUBLIC).build()) .build()); TaskDefinition taskDefinition = TaskDefinition.Builder.create(this, "TD") .compatibility(Compatibility.EC2) .build(); taskDefinition.addContainer("TheContainer", ContainerDefinitionOptions.builder() .image(ContainerImage.fromRegistry("foo/bar")) .memoryLimitMiB(256) .build()); EcsRunTask runTask = EcsRunTask.Builder.create(this, "Run") .integrationPattern(IntegrationPattern.RUN_JOB) .cluster(cluster) .taskDefinition(taskDefinition) .launchTarget(EcsEc2LaunchTarget.Builder.create() .placementStrategies(List.of(PlacementStrategy.spreadAcrossInstances(), PlacementStrategy.packedByCpu(), PlacementStrategy.randomly())) .placementConstraints(List.of(PlacementConstraint.memberOf("blieptuut"))) .build()) .build();
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.stepfunctions.tasks.IEcsLaunchTarget
IEcsLaunchTarget.Jsii$Default, IEcsLaunchTarget.Jsii$Proxy
-
Constructor Summary
ModifierConstructorDescriptionprotected
EcsEc2LaunchTarget
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
EcsEc2LaunchTarget
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionbind
(EcsRunTask _task, LaunchTargetBindOptions launchTargetOptions) Called when the EC2 launch type is configured on RunTask.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
EcsEc2LaunchTarget
protected EcsEc2LaunchTarget(software.amazon.jsii.JsiiObjectRef objRef) -
EcsEc2LaunchTarget
protected EcsEc2LaunchTarget(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
EcsEc2LaunchTarget
- Parameters:
options
-
-
EcsEc2LaunchTarget
@Stability(Stable) public EcsEc2LaunchTarget()
-
-
Method Details
-
bind
@Stability(Stable) @NotNull public EcsLaunchTargetConfig bind(@NotNull EcsRunTask _task, @NotNull LaunchTargetBindOptions launchTargetOptions) Called when the EC2 launch type is configured on RunTask.- Specified by:
bind
in interfaceIEcsLaunchTarget
- Parameters:
_task
- This parameter is required.launchTargetOptions
- This parameter is required.
-