Class EcsTask
Start a task on an ECS cluster.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.Events.Targets
Assembly: Amazon.CDK.AWS.Events.Targets.dll
Syntax (csharp)
public class EcsTask : DeputyBase, IRuleTarget
Syntax (vb)
Public Class EcsTask
Inherits DeputyBase
Implements IRuleTarget
Remarks
ExampleMetadata: fixture=basic infused
Examples
using Amazon.CDK.AWS.Events;
using Amazon.CDK.AWS.Events.Targets;
using Amazon.CDK.AWS.ECS;
using Amazon.CDK.AWS.IAM;
Cluster cluster;
TaskDefinition taskDefinition;
Role role;
var ecsTaskTarget = new EcsTask(new EcsTaskProps { Cluster = cluster, TaskDefinition = taskDefinition, Role = role });
new Rule(this, "ScheduleRule", new RuleProps {
Schedule = Schedule.Cron(new CronOptions { Minute = "0", Hour = "4" }),
Targets = new [] { ecsTaskTarget }
});
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
SecurityGroup | (deprecated) The security group associated with the task. |
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
SecurityGroup
(deprecated) The security group associated with the task.
public virtual ISecurityGroup SecurityGroup { get; }
Property Value
Remarks
Only applicable with awsvpc network mode.
Default: - A new security group is created.
Stability: Deprecated
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