interface EcsJobDefinitionProps
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Batch.EcsJobDefinitionProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsbatch#EcsJobDefinitionProps |
Java | software.amazon.awscdk.services.batch.EcsJobDefinitionProps |
Python | aws_cdk.aws_batch.EcsJobDefinitionProps |
TypeScript (source) | aws-cdk-lib » aws_batch » EcsJobDefinitionProps |
Implements
Job
Props for EcsJobDefinition.
Example
const jobDefn = new batch.EcsJobDefinition(this, 'JobDefn', {
container: new batch.EcsFargateContainerDefinition(this, 'myFargateContainer', {
image: ecs.ContainerImage.fromRegistry('public.ecr.aws/amazonlinux/amazonlinux:latest'),
memory: cdk.Size.mebibytes(2048),
cpu: 256,
ephemeralStorageSize: cdk.Size.gibibytes(100),
fargateCpuArchitecture: ecs.CpuArchitecture.ARM64,
fargateOperatingSystemFamily: ecs.OperatingSystemFamily.LINUX,
}),
});
Properties
| Name | Type | Description |
|---|---|---|
| container | IEcs | The container that this job will run. |
| job | string | The name of this job definition. |
| parameters? | { [string]: any } | The default parameters passed to the container These parameters can be referenced in the command that you give to the container. |
| propagate | boolean | Whether to propagate tags from the JobDefinition to the ECS task that Batch spawns. |
| retry | number | The number of times to retry a job. |
| retry | Retry[] | Defines the retry behavior for this job. |
| scheduling | number | The priority of this Job. |
| skip | boolean | Specifies whether the previous revision of the job definition is retained in an active status after UPDATE events for the resource. |
| timeout? | Duration | The timeout time for jobs that are submitted with this job definition. |
container
Type:
IEcs
The container that this job will run.
jobDefinitionName?
Type:
string
(optional, default: generated by CloudFormation)
The name of this job definition.
parameters?
Type:
{ [string]: any }
(optional, default: none)
The default parameters passed to the container These parameters can be referenced in the command that you give to the container.
propagateTags?
Type:
boolean
(optional, default: false)
Whether to propagate tags from the JobDefinition to the ECS task that Batch spawns.
retryAttempts?
Type:
number
(optional, default: 1)
The number of times to retry a job.
The job is retried on failure the same number of attempts as the value.
retryStrategies?
Type:
Retry[]
(optional, default: no RetryStrategy)
Defines the retry behavior for this job.
schedulingPriority?
Type:
number
(optional, default: none)
The priority of this Job.
Only used in Fairshare Scheduling to decide which job to run first when there are multiple jobs with the same share identifier.
skipDeregisterOnUpdate?
Type:
boolean
(optional, default: undefined - AWS Batch default is false)
Specifies whether the previous revision of the job definition is retained in an active status after UPDATE events for the resource.
When the property is set to false, the previous revision of the job definition is de-registered after a new revision is created. When the property is set to true, the previous revision of the job definition is not de-registered.
timeout?
Type:
Duration
(optional, default: no timeout)
The timeout time for jobs that are submitted with this job definition.
After the amount of time you specify passes, Batch terminates your jobs if they aren't finished.

.NET
Go
Java
Python
TypeScript (