@aws-cdk_aws-batch-alpha.EcsJobDefinitionProps

interface EcsJobDefinitionProps ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.Batch.Alpha.EcsJobDefinitionProps
Gogithub.com/aws/aws-cdk-go/awscdkbatchalpha/v2#EcsJobDefinitionProps
Javasoftware.amazon.awscdk.services.batch.alpha.EcsJobDefinitionProps
Pythonaws_cdk.aws_batch_alpha.EcsJobDefinitionProps
TypeScript (source)@aws-cdk/aws-batch-alpha ยป EcsJobDefinitionProps

Props for EcsJobDefinition.

Example

import * as cdk from 'aws-cdk-lib';
import * as efs from 'aws-cdk-lib/aws-efs';

declare const myFileSystem: efs.IFileSystem;

const jobDefn = new batch.EcsJobDefinition(this, 'JobDefn', {
  container: new batch.EcsEc2ContainerDefinition(this, 'containerDefn', {
    image: ecs.ContainerImage.fromRegistry('public.ecr.aws/amazonlinux/amazonlinux:latest'),
    memory: cdk.Size.mebibytes(2048),
    cpu: 256,
    volumes: [batch.EcsVolume.efs({
      name: 'myVolume',
      fileSystem: myFileSystem,
      containerPath: '/Volumes/myVolume',
    })],
  }),
});

Properties

NameTypeDescription
container๐Ÿ”นIEcsContainerDefinitionThe container that this job will run.
jobDefinitionName?๐Ÿ”นstringThe 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.
propagateTags?๐Ÿ”นbooleanWhether to propogate tags from the JobDefinition to the ECS task that Batch spawns.
retryAttempts?๐Ÿ”นnumberThe number of times to retry a job.
retryStrategies?๐Ÿ”นRetryStrategy[]Defines the retry behavior for this job.
schedulingPriority?๐Ÿ”นnumberThe priority of this Job.
timeout?๐Ÿ”นDurationThe timeout time for jobs that are submitted with this job definition.

container๐Ÿ”น

Type: IEcsContainerDefinition

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.

See also: https://docs.aws.amazon.com/batch/latest/userguide/job_definition_parameters.html#parameters


propagateTags?๐Ÿ”น

Type: boolean (optional, default: false)

Whether to propogate 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: RetryStrategy[] (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.


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.