Interface IScheduledEc2TaskProps
The properties for the ScheduledEc2Task task.
Inherited Members
Namespace: Amazon.CDK.AWS.ECS.Patterns
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IScheduledEc2TaskProps : IScheduledTaskBaseProps
Syntax (vb)
Public Interface IScheduledEc2TaskProps
Inherits IScheduledTaskBaseProps
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
Properties
ScheduledEc2TaskDefinitionOptions | The properties to define if using an existing TaskDefinition in this construct. |
ScheduledEc2TaskImageOptions | The properties to define if the construct is to create a TaskDefinition. |
Properties
ScheduledEc2TaskDefinitionOptions
The properties to define if using an existing TaskDefinition in this construct.
virtual IScheduledEc2TaskDefinitionOptions ScheduledEc2TaskDefinitionOptions { get; }
Property Value
IScheduledEc2TaskDefinitionOptions
Remarks
ScheduledEc2TaskDefinitionOptions or ScheduledEc2TaskImageOptions must be defined, but not both.
Default: none
ScheduledEc2TaskImageOptions
The properties to define if the construct is to create a TaskDefinition.
virtual IScheduledEc2TaskImageOptions ScheduledEc2TaskImageOptions { get; }
Property Value
Remarks
ScheduledEc2TaskDefinitionOptions or ScheduledEc2TaskImageOptions must be defined, but not both.
Default: none