Class ScheduledFargateTaskImageOptions
The properties for the ScheduledFargateTask using an image.
Inheritance
Namespace: Amazon.CDK.AWS.ECS.Patterns
Assembly: Amazon.CDK.AWS.ECS.Patterns.dll
Syntax (csharp)
public class ScheduledFargateTaskImageOptions : Object, IScheduledFargateTaskImageOptions, IScheduledTaskImageProps
Syntax (vb)
Public Class ScheduledFargateTaskImageOptions
Inherits Object
Implements IScheduledFargateTaskImageOptions, IScheduledTaskImageProps
Remarks
ExampleMetadata: infused
Examples
Cluster cluster;
var scheduledFargateTask = new ScheduledFargateTask(this, "ScheduledFargateTask", new ScheduledFargateTaskProps {
Cluster = cluster,
ScheduledFargateTaskImageOptions = new ScheduledFargateTaskImageOptions {
Image = ContainerImage.FromRegistry("amazon/amazon-ecs-sample"),
MemoryLimitMiB = 512
},
Schedule = Schedule.Expression("rate(1 minute)"),
PlatformVersion = FargatePlatformVersion.LATEST
});
Synopsis
Constructors
ScheduledFargateTaskImageOptions() |
Properties
Command | The command that is passed to the container. |
Cpu | The number of cpu units used by the task. |
Environment | The environment variables to pass to the container. |
Image | The image used to start a container. |
LogDriver | The log driver to use. |
MemoryLimitMiB | The hard limit (in MiB) of memory to present to the container. |
Secrets | The secret to expose to the container as an environment variable. |
Constructors
ScheduledFargateTaskImageOptions()
public ScheduledFargateTaskImageOptions()
Properties
Command
The command that is passed to the container.
public string[] Command { get; set; }
Property Value
System.String[]
Remarks
If you provide a shell command as a single string, you have to quote command-line arguments.
Default: - CMD value built into container image.
Cpu
The number of cpu units used by the task.
public Nullable<double> Cpu { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
Valid values, which determines your range of valid values for the memory parameter:
256 (.25 vCPU) - Available memory values: 0.5GB, 1GB, 2GB
512 (.5 vCPU) - Available memory values: 1GB, 2GB, 3GB, 4GB
1024 (1 vCPU) - Available memory values: 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB
2048 (2 vCPU) - Available memory values: Between 4GB and 16GB in 1GB increments
4096 (4 vCPU) - Available memory values: Between 8GB and 30GB in 1GB increments
This default is set in the underlying FargateTaskDefinition construct.
Default: 256
Environment
The environment variables to pass to the container.
public IDictionary<string, string> Environment { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String>
Remarks
Default: none
Image
The image used to start a container.
public ContainerImage Image { get; set; }
Property Value
Remarks
Image or taskDefinition must be specified, but not both.
Default: - none
LogDriver
The log driver to use.
public LogDriver LogDriver { get; set; }
Property Value
Remarks
Default: - AwsLogDriver if enableLogging is true
MemoryLimitMiB
The hard limit (in MiB) of memory to present to the container.
public Nullable<double> MemoryLimitMiB { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
If your container attempts to exceed the allocated memory, the container is terminated.
Default: 512
Secrets
The secret to expose to the container as an environment variable.
public IDictionary<string, Secret> Secrets { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, Secret>
Remarks
Default: - No secret environment variables.