Class EcsTask
Start a task on an ECS cluster.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.Events.Targets
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class EcsTask : DeputyBase, IRuleTarget
Syntax (vb)
Public Class EcsTask
Inherits DeputyBase
Implements IRuleTarget
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.ECS;
ICluster cluster;
TaskDefinition taskDefinition;
var rule = new Rule(this, "Rule", new RuleProps {
Schedule = Schedule.Rate(Duration.Hours(1))
});
rule.AddTarget(new EcsTask(new EcsTaskProps {
Cluster = cluster,
TaskDefinition = taskDefinition,
TaskCount = 1,
// Overrides the cpu and memory values in the task definition
Cpu = "512",
Memory = "512"
}));
Synopsis
Constructors
Ecs |
|
Ecs |
Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Ecs |
Used by jsii to construct an instance of this class from DeputyProps |
Properties
Security |
The security groups associated with the task. |
Methods
Bind(IRule, String) | Allows using tasks as target of EventBridge events. |
Constructors
EcsTask(IEcsTaskProps)
EcsTask(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected EcsTask(ByRefValue reference)
Parameters
- reference Amazon.
JSII. Runtime. Deputy. By Ref Value The Javascript-owned object reference
EcsTask(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected EcsTask(DeputyBase.DeputyProps props)
Parameters
- props Amazon.
JSII. Runtime. Deputy. Deputy Base. Deputy Props The deputy props
Properties
SecurityGroups
The security groups associated with the task.
public virtual ISecurityGroup[] SecurityGroups { get; }
Property Value
Remarks
Only applicable with awsvpc network mode.
Default: - A new security group is created.
Methods
Bind(IRule, String)
Allows using tasks as target of EventBridge events.
public virtual IRuleTargetConfig Bind(IRule rule, string id = null)
Parameters
- rule IRule
- id System.
String
Returns