Class EcsTask
Start a task on an ECS cluster.
Inheritance
System.Object
EcsTask
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;
using Amazon.CDK.AWS.EC2;
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,
AssignPublicIp = true,
SubnetSelection = new SubnetSelection { SubnetType = SubnetType.PUBLIC }
}));
Synopsis
Constructors
EcsTask(IEcsTaskProps) | |
EcsTask(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
EcsTask(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
SecurityGroups | 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.ByRefValue
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.DeputyBase.DeputyProps
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