interface ScheduledFargateTaskImageOptions
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.ECS.Patterns.ScheduledFargateTaskImageOptions |
Java | software.amazon.awscdk.services.ecs.patterns.ScheduledFargateTaskImageOptions |
Python | aws_cdk.aws_ecs_patterns.ScheduledFargateTaskImageOptions |
TypeScript (source) | @aws-cdk/aws-ecs-patterns » ScheduledFargateTaskImageOptions |
The properties for the ScheduledFargateTask using an image.
Example
declare const cluster: ecs.Cluster;
const scheduledFargateTask = new ecsPatterns.ScheduledFargateTask(this, 'ScheduledFargateTask', {
cluster,
scheduledFargateTaskImageOptions: {
image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'),
memoryLimitMiB: 512,
},
schedule: appscaling.Schedule.expression('rate(1 minute)'),
platformVersion: ecs.FargatePlatformVersion.LATEST,
});
Properties
Name | Type | Description |
---|---|---|
image | Container | The image used to start a container. |
command? | string[] | The command that is passed to the container. |
cpu? | number | The number of cpu units used by the task. |
environment? | { [string]: string } | The environment variables to pass to the container. |
log | Log | The log driver to use. |
memory | number | The hard limit (in MiB) of memory to present to the container. |
secrets? | { [string]: Secret } | The secret to expose to the container as an environment variable. |
image
Type:
Container
The image used to start a container.
Image or taskDefinition must be specified, but not both.
command?
Type:
string[]
(optional, default: CMD value built into container image.)
The command that is passed to the container.
If you provide a shell command as a single string, you have to quote command-line arguments.
cpu?
Type:
number
(optional, default: 256)
The number of cpu units used by the task.
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.
environment?
Type:
{ [string]: string }
(optional, default: none)
The environment variables to pass to the container.
logDriver?
Type:
Log
(optional, default: AwsLogDriver if enableLogging is true)
The log driver to use.
memoryLimitMiB?
Type:
number
(optional, default: 512)
The hard limit (in MiB) of memory to present to the container.
If your container attempts to exceed the allocated memory, the container is terminated.
secrets?
Type:
{ [string]:
Secret
}
(optional, default: No secret environment variables.)
The secret to expose to the container as an environment variable.