JobDefinitionProps

class aws_cdk.aws_batch.JobDefinitionProps(*, container, job_definition_name=None, node_props=None, parameters=None, platform_capabilities=None, retry_attempts=None, timeout=None)

Bases: object

(experimental) Construction properties of the {@link JobDefinition} construct.

Parameters
  • container (JobDefinitionContainer) – (experimental) An object with various properties specific to container-based jobs.

  • job_definition_name (Optional[str]) – (experimental) The name of the job definition. Up to 128 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed. Default: Cloudformation-generated name

  • node_props (Optional[IMultiNodeProps]) – (experimental) An object with various properties specific to multi-node parallel jobs. Default: - undefined

  • parameters (Optional[Mapping[str, str]]) – (experimental) When you submit a job, you can specify parameters that should replace the placeholders or override the default job definition parameters. Parameters in job submission requests take precedence over the defaults in a job definition. This allows you to use the same job definition for multiple jobs that use the same format, and programmatically change values in the command at submission time. Default: - undefined

  • platform_capabilities (Optional[Sequence[PlatformCapabilities]]) – (experimental) The platform capabilities required by the job definition. Default: - EC2

  • retry_attempts (Union[int, float, None]) – (experimental) The number of times to move a job to the RUNNABLE status. You may specify between 1 and 10 attempts. If the value of attempts is greater than one, the job is retried on failure the same number of attempts as the value. Default: 1

  • timeout (Optional[Duration]) – (experimental) The timeout configuration for jobs that are submitted with this job definition. You can specify a timeout duration after which AWS Batch terminates your jobs if they have not finished. Default: - undefined

Stability

experimental

Example:

import aws_cdk.aws_ssm as ssm


batch.JobDefinition(self, "job-def",
    container=batch.JobDefinitionContainer(
        image=ecs.EcrImage.from_registry("docker/whalesay"),
        log_configuration=batch.LogConfiguration(
            log_driver=batch.LogDriver.AWSLOGS,
            options={"awslogs-region": "us-east-1"},
            secret_options=[
                batch.ExposedSecret.from_parameters_store("xyz", ssm.StringParameter.from_string_parameter_name(self, "parameter", "xyz"))
            ]
        )
    )
)

Attributes

container

(experimental) An object with various properties specific to container-based jobs.

Stability

experimental

Return type

JobDefinitionContainer

job_definition_name

(experimental) The name of the job definition.

Up to 128 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed.

Default

Cloudformation-generated name

Stability

experimental

Return type

Optional[str]

node_props

(experimental) An object with various properties specific to multi-node parallel jobs.

Default
  • undefined

Stability

experimental

Return type

Optional[IMultiNodeProps]

parameters

(experimental) When you submit a job, you can specify parameters that should replace the placeholders or override the default job definition parameters.

Parameters in job submission requests take precedence over the defaults in a job definition. This allows you to use the same job definition for multiple jobs that use the same format, and programmatically change values in the command at submission time.

Default
  • undefined

Stability

experimental

Link

https://docs.aws.amazon.com/batch/latest/userguide/job_definition_parameters.html

Return type

Optional[Mapping[str, str]]

platform_capabilities

(experimental) The platform capabilities required by the job definition.

Default
  • EC2

Stability

experimental

Return type

Optional[List[PlatformCapabilities]]

retry_attempts

(experimental) The number of times to move a job to the RUNNABLE status.

You may specify between 1 and 10 attempts. If the value of attempts is greater than one, the job is retried on failure the same number of attempts as the value.

Default

1

Stability

experimental

Return type

Union[int, float, None]

timeout

(experimental) The timeout configuration for jobs that are submitted with this job definition.

You can specify a timeout duration after which AWS Batch terminates your jobs if they have not finished.

Default
  • undefined

Stability

experimental

Return type

Optional[Duration]