Class ScheduledEc2Task
A scheduled EC2 task that will be initiated off of CloudWatch Events.
Inherited Members
Namespace: Amazon.CDK.AWS.ECS.Patterns
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class ScheduledEc2Task : ScheduledTaskBase
Syntax (vb)
Public Class ScheduledEc2Task
Inherits ScheduledTaskBase
Remarks
ExampleMetadata: infused
Examples
// Instantiate an Amazon EC2 Task to run at a scheduled interval
Cluster cluster;
var ecsScheduledTask = new ScheduledEc2Task(this, "ScheduledTask", new ScheduledEc2TaskProps {
Cluster = cluster,
ScheduledEc2TaskImageOptions = new ScheduledEc2TaskImageOptions {
Image = ContainerImage.FromRegistry("amazon/amazon-ecs-sample"),
MemoryLimitMiB = 256,
Environment = new Dictionary<string, string> { { "name", "TRIGGER" }, { "value", "CloudWatch Events" } }
},
Schedule = Schedule.Expression("rate(1 minute)"),
Enabled = true,
RuleName = "sample-scheduled-task-rule"
});
Synopsis
Constructors
ScheduledEc2Task(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
ScheduledEc2Task(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
ScheduledEc2Task(Construct, String, IScheduledEc2TaskProps) | Constructs a new instance of the ScheduledEc2Task class. |
Properties
Task | The ECS task in this construct. |
TaskDefinition | The EC2 task definition in this construct. |
Constructors
ScheduledEc2Task(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected ScheduledEc2Task(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
ScheduledEc2Task(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected ScheduledEc2Task(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
ScheduledEc2Task(Construct, String, IScheduledEc2TaskProps)
Constructs a new instance of the ScheduledEc2Task class.
public ScheduledEc2Task(Construct scope, string id, IScheduledEc2TaskProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props IScheduledEc2TaskProps
Properties
Task
TaskDefinition
The EC2 task definition in this construct.
public virtual Ec2TaskDefinition TaskDefinition { get; }
Property Value