@aws-cdk_aws-batch-alpha.Action

enum Action ๐Ÿ”น

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

The Action to take when all specified conditions in a RetryStrategy are met.

Example

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

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,
  }),
  retryAttempts: 5,
  retryStrategies: [
    batch.RetryStrategy.of(batch.Action.EXIT, batch.Reason.CANNOT_PULL_CONTAINER),
  ],
});
jobDefn.addRetryStrategy(
  batch.RetryStrategy.of(batch.Action.EXIT, batch.Reason.SPOT_INSTANCE_RECLAIMED),
);
jobDefn.addRetryStrategy(
  batch.RetryStrategy.of(batch.Action.EXIT, batch.Reason.CANNOT_PULL_CONTAINER),
);
jobDefn.addRetryStrategy(
  batch.RetryStrategy.of(batch.Action.EXIT, batch.Reason.custom({
    onExitCode: '40*',
    onReason: 'some reason',
  })),
);

Members

NameDescription
EXIT ๐Ÿ”นThe job will not retry.
RETRY ๐Ÿ”นThe job will retry.

EXIT ๐Ÿ”น

The job will not retry.


RETRY ๐Ÿ”น

The job will retry.

It can be retried up to the number of times specified in retryAttempts.