Class EcsRunTask
Run a Task on ECS or Fargate.
Inherited Members
Namespace: Amazon.CDK.AWS.StepFunctions.Tasks
Assembly: Amazon.CDK.AWS.StepFunctions.Tasks.dll
Syntax (csharp)
public class EcsRunTask : TaskStateBase, IConstruct, IDependable, IChainable, INextable, IConnectable
Syntax (vb)
Public Class EcsRunTask
Inherits TaskStateBase
Implements IConstruct, IDependable, IChainable, INextable, IConnectable
Remarks
ExampleMetadata: infused
Examples
var vpc = Vpc.FromLookup(this, "Vpc", new VpcLookupOptions {
IsDefault = true
});
var cluster = new Cluster(this, "Ec2Cluster", new ClusterProps { Vpc = vpc });
cluster.AddCapacity("DefaultAutoScalingGroup", new AddCapacityOptions {
InstanceType = new InstanceType("t2.micro"),
VpcSubnets = new SubnetSelection { SubnetType = SubnetType.PUBLIC }
});
var taskDefinition = new TaskDefinition(this, "TD", new TaskDefinitionProps {
Compatibility = Compatibility.EC2
});
taskDefinition.AddContainer("TheContainer", new ContainerDefinitionOptions {
Image = ContainerImage.FromRegistry("foo/bar"),
MemoryLimitMiB = 256
});
var runTask = new EcsRunTask(this, "Run", new EcsRunTaskProps {
IntegrationPattern = IntegrationPattern.RUN_JOB,
Cluster = cluster,
TaskDefinition = taskDefinition,
LaunchTarget = new EcsEc2LaunchTarget(new EcsEc2LaunchTargetOptions {
PlacementStrategies = new [] { PlacementStrategy.SpreadAcrossInstances(), PlacementStrategy.PackedByCpu(), PlacementStrategy.Randomly() },
PlacementConstraints = new [] { PlacementConstraint.MemberOf("blieptuut") }
})
});
Synopsis
Constructors
EcsRunTask(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
EcsRunTask(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
EcsRunTask(Construct, String, IEcsRunTaskProps) |
Properties
Connections | Manage allowed network traffic for this service. |
TaskMetrics | |
TaskPolicies |
Constructors
EcsRunTask(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected EcsRunTask(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
EcsRunTask(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected EcsRunTask(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
EcsRunTask(Construct, String, IEcsRunTaskProps)
public EcsRunTask(Construct scope, string id, IEcsRunTaskProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props IEcsRunTaskProps
Properties
Connections
Manage allowed network traffic for this service.
public virtual Connections_ Connections { get; }
Property Value
TaskMetrics
protected override ITaskMetricsConfig TaskMetrics { get; }
Property Value
Overrides
TaskPolicies
protected override PolicyStatement[] TaskPolicies { get; }
Property Value
Overrides
Implements
Constructs.IConstruct