@Generated(value="jsii-pacmak/1.72.0 (build 4b8828b)", date="2023-01-03T16:22:40.505Z") @Stability(value=Stable) public class EcsEc2LaunchTarget extends software.amazon.jsii.JsiiObject implements IEcsLaunchTarget
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();
| Modifier and Type | Class and Description |
|---|---|
static class |
EcsEc2LaunchTarget.Builder
A fluent builder for
EcsEc2LaunchTarget. |
software.amazon.jsii.JsiiObject.InitializationModeIEcsLaunchTarget.Jsii$Default, IEcsLaunchTarget.Jsii$Proxy| Modifier | Constructor and Description |
|---|---|
|
EcsEc2LaunchTarget() |
|
EcsEc2LaunchTarget(EcsEc2LaunchTargetOptions options) |
protected |
EcsEc2LaunchTarget(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
EcsEc2LaunchTarget(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
EcsLaunchTargetConfig |
bind(EcsRunTask _task,
LaunchTargetBindOptions launchTargetOptions)
Called when the EC2 launch type is configured on RunTask.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected EcsEc2LaunchTarget(software.amazon.jsii.JsiiObjectRef objRef)
protected EcsEc2LaunchTarget(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public EcsEc2LaunchTarget(@Nullable
EcsEc2LaunchTargetOptions options)
options - @Stability(value=Stable) public EcsEc2LaunchTarget()
@Stability(value=Stable) @NotNull public EcsLaunchTargetConfig bind(@NotNull EcsRunTask _task, @NotNull LaunchTargetBindOptions launchTargetOptions)
bind in interface IEcsLaunchTarget_task - This parameter is required.launchTargetOptions - This parameter is required.Copyright © 2023. All rights reserved.