Skip to content
v2.276.0

JobStateTimeLimitAction Struct ​

Specifies an action that AWS Batch will take after the job has remained at the head of the queue in the specified state for longer than the specified time.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_batch as batch } from 'aws-cdk-lib';
const jobStateTimeLimitAction: batch.JobStateTimeLimitAction = {
  maxTime: cdk.Duration.minutes(30),
  reason: batch.JobStateTimeLimitActionsReason.INSUFFICIENT_INSTANCE_CAPACITY,

  // the properties below are optional
  action: batch.JobStateTimeLimitActionsAction.CANCEL,
  state: batch.JobStateTimeLimitActionsState.RUNNABLE,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
from aws_cdk import aws_batch as batch

job_state_time_limit_action = batch.JobStateTimeLimitAction(
    max_time=cdk.Duration.minutes(30),
    reason=batch.JobStateTimeLimitActionsReason.INSUFFICIENT_INSTANCE_CAPACITY,

    # the properties below are optional
    action=batch.JobStateTimeLimitActionsAction.CANCEL,
    state=batch.JobStateTimeLimitActionsState.RUNNABLE
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.batch.*;

JobStateTimeLimitAction jobStateTimeLimitAction = JobStateTimeLimitAction.builder()
        .maxTime(Duration.minutes(30))
        .reason(JobStateTimeLimitActionsReason.INSUFFICIENT_INSTANCE_CAPACITY)

        // the properties below are optional
        .action(JobStateTimeLimitActionsAction.CANCEL)
        .state(JobStateTimeLimitActionsState.RUNNABLE)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.Batch;

var jobStateTimeLimitAction = new JobStateTimeLimitAction {
    MaxTime = Duration.Minutes(30),
    Reason = JobStateTimeLimitActionsReason.INSUFFICIENT_INSTANCE_CAPACITY,

    // the properties below are optional
    Action = JobStateTimeLimitActionsAction.CANCEL,
    State = JobStateTimeLimitActionsState.RUNNABLE
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

jobStateTimeLimitAction := &JobStateTimeLimitAction{
	MaxTime: cdk.Duration_Minutes(jsii.Number(30)),
	Reason: awscdk.Aws_batch.JobStateTimeLimitActionsReason_INSUFFICIENT_INSTANCE_CAPACITY,

	// the properties below are optional
	Action: awscdk.*Aws_batch.JobStateTimeLimitActionsAction_CANCEL,
	State: awscdk.*Aws_batch.JobStateTimeLimitActionsState_RUNNABLE,
}

Properties ​

The action to take when a job is at the head of the job queue in the specified state for the specified period of time.

Default: JobStateTimeLimitActionsAction.CANCEL

maxTimeDurationmax_timeDurationmaxTimeDurationMaxTimeDurationMaxTimeDurationrequired#
The approximate amount of time, that must pass with the job in the specified state before the action is taken.

The minimum value is 10 minutes and the maximum value is 24 hours.

The state of the job needed to trigger the action.

Default: JobStateTimeLimitActionsState.RUNNABLE