Interface IScheduledEc2TaskImageOptions
The properties for the ScheduledEc2Task using an image.
Inherited Members
Namespace: Amazon.CDK.AWS.ECS.Patterns
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IScheduledEc2TaskImageOptions : IScheduledTaskImageProps
Syntax (vb)
Public Interface IScheduledEc2TaskImageOptions
Inherits IScheduledTaskImageProps
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
Cpu | The minimum number of CPU units to reserve for the container. |
MemoryLimitMiB | The hard limit (in MiB) of memory to present to the container. |
MemoryReservationMiB | The soft limit (in MiB) of memory to reserve for the container. |
Properties
Cpu
The minimum number of CPU units to reserve for the container.
virtual Nullable<double> Cpu { get; }
Property Value
System.Nullable<System.Double>
Remarks
Default: none
MemoryLimitMiB
The hard limit (in MiB) of memory to present to the container.
virtual Nullable<double> MemoryLimitMiB { get; }
Property Value
System.Nullable<System.Double>
Remarks
If your container attempts to exceed the allocated memory, the container is terminated.
At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services.
Default: - No memory limit.
MemoryReservationMiB
The soft limit (in MiB) of memory to reserve for the container.
virtual Nullable<double> MemoryReservationMiB { get; }
Property Value
System.Nullable<System.Double>
Remarks
When system memory is under contention, Docker attempts to keep the container memory within the limit. If the container requires more memory, it can consume up to the value specified by the Memory property or all of the available memory on the container instance—whichever comes first.
At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services.
Default: - No memory reserved.