AWS Batch

AWS Batch Task state.

class rhodes.states.services.batch.AwsBatch(title, *, Comment=None, JobDefinition=None, JobName=None, JobQueue=None, Parameters=None, ArrayProperties=None, ContainerOverrides=None, DependsOn=None, RetryStrategy=None, Timeout=None, Next=None, End=None, InputPath=JsonPath(path=Root()), OutputPath=JsonPath(path=Root()), ResultPath=JsonPath(path=Root()), Retry=None, Catch=None, TimeoutSeconds=None, HeartbeatSeconds=None, Pattern=<IntegrationPattern.REQUEST_RESPONSE: ''>)[source]

Bases: rhodes.states.State

Submit an AWS Batch job from a job definition.

See service docs for more details.

Parameters:
  • JobDefinition – The job definition used by this job. This value can be one of name, name:revision, or the Amazon Resource Name (ARN) for the job definition. If name is specified without a revision then the latest active revision is used.
  • JobName – The name of the job. The first character must be alphanumeric, and up to 128 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed.
  • JobQueue – The job queue into which the job is submitted. You can specify either the name or the Amazon Resource Name (ARN) of the queue.
  • Parameters – Additional parameters passed to the job. These replace parameter substitution placeholders that are set in the job definition. Parameters are specified as a key and value pair mapping. Parameters in a SubmitJob request override any corresponding parameter defaults from the job definition.
  • ArrayProperties – The array properties for the submitted job, such as the size of the array. The array size can be between 2 and 10,000. If you specify array properties for a job, it becomes an array job.
  • ContainerOverrides – A list of container overrides in JSON format. These specify the name of a container in the specified job definition and the overrides it should receive. You can override the default command for a container with a command override. You can also override existing environment variables on a container or add new environment variables to it with an environment override.
  • DependsOn – A list of dependencies for the job. A job can depend upon a maximum of 20 jobs.
  • RetryStrategy – The retry strategy to use for failed jobs from this SubmitJob operation. When a retry strategy is specified here, it overrides the retry strategy defined in the job definition.
  • Timeout – The timeout configuration for this SubmitJob operation. If a job is terminated due to a timeout, it is not retried. The minimum value for the timeout is 60 seconds. This configuration overrides any timeout configuration specified in the job definition. For array jobs, child jobs have the same timeout configuration as the parent job.
  • title (str) – Name of state in state machine
  • Comment (str) – Human-readable description of the state (default: '')
  • Next – The state that will follow this state
  • End (bool) – This state is a terminal state
  • InputPath (JsonPath) – The portion of the state input data to be used as input for the state (default: JsonPath(path=Root()))
  • OutputPath (JsonPath) – The portion of the state input data to be passed to the next state (default: JsonPath(path=Root()))
  • ResultPath (JsonPath) – Where in the state input data to place the results of this state (default: JsonPath(path=Root()))
  • Retry
  • Catch
  • TimeoutSeconds (int) – Maximum time that this state is allowed to run
  • HeartbeatSeconds (int) – Maximum time allowed between heartbeat responses from state
  • Pattern (IntegrationPattern) – Step Functions integration pattern (default: <IntegrationPattern.REQUEST_RESPONSE: ''>)
end()

Make this state a terminal state.

member_of = None
promote(path)

Add a Pass state after this state that promotes a path in the input to this state’s ResultPath.

Path must start with a path relative this state’s ResultPath as indicated by a @. prefix.

Parameters:path (Union[str, Enum, JSONPath, JsonPath]) – Path to promote
Return type:Pass
then(next_state)

Set the next state in this state machine.

to_dict() → Dict[KT, VT]

Serialize state as a dictionary.

Return type:Dict