CfnJobDefinition

class aws_cdk.aws_batch.CfnJobDefinition(scope, id, *, type, container_properties=None, job_definition_name=None, node_properties=None, parameters=None, platform_capabilities=None, propagate_tags=None, retry_strategy=None, scheduling_priority=None, tags=None, timeout=None)

Bases: CfnResource

A CloudFormation AWS::Batch::JobDefinition.

The AWS::Batch::JobDefinition resource specifies the parameters for an AWS Batch job definition. For more information, see Job Definitions in the ** .

CloudformationResource

AWS::Batch::JobDefinition

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-batch-jobdefinition.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_batch as batch

# options: Any
# parameters: Any
# tags: Any

cfn_job_definition = batch.CfnJobDefinition(self, "MyCfnJobDefinition",
    type="type",

    # the properties below are optional
    container_properties=batch.CfnJobDefinition.ContainerPropertiesProperty(
        image="image",

        # the properties below are optional
        command=["command"],
        environment=[batch.CfnJobDefinition.EnvironmentProperty(
            name="name",
            value="value"
        )],
        execution_role_arn="executionRoleArn",
        fargate_platform_configuration=batch.CfnJobDefinition.FargatePlatformConfigurationProperty(
            platform_version="platformVersion"
        ),
        instance_type="instanceType",
        job_role_arn="jobRoleArn",
        linux_parameters=batch.CfnJobDefinition.LinuxParametersProperty(
            devices=[batch.CfnJobDefinition.DeviceProperty(
                container_path="containerPath",
                host_path="hostPath",
                permissions=["permissions"]
            )],
            init_process_enabled=False,
            max_swap=123,
            shared_memory_size=123,
            swappiness=123,
            tmpfs=[batch.CfnJobDefinition.TmpfsProperty(
                container_path="containerPath",
                size=123,

                # the properties below are optional
                mount_options=["mountOptions"]
            )]
        ),
        log_configuration=batch.CfnJobDefinition.LogConfigurationProperty(
            log_driver="logDriver",

            # the properties below are optional
            options=options,
            secret_options=[batch.CfnJobDefinition.SecretProperty(
                name="name",
                value_from="valueFrom"
            )]
        ),
        memory=123,
        mount_points=[batch.CfnJobDefinition.MountPointsProperty(
            container_path="containerPath",
            read_only=False,
            source_volume="sourceVolume"
        )],
        network_configuration=batch.CfnJobDefinition.NetworkConfigurationProperty(
            assign_public_ip="assignPublicIp"
        ),
        privileged=False,
        readonly_root_filesystem=False,
        resource_requirements=[batch.CfnJobDefinition.ResourceRequirementProperty(
            type="type",
            value="value"
        )],
        secrets=[batch.CfnJobDefinition.SecretProperty(
            name="name",
            value_from="valueFrom"
        )],
        ulimits=[batch.CfnJobDefinition.UlimitProperty(
            hard_limit=123,
            name="name",
            soft_limit=123
        )],
        user="user",
        vcpus=123,
        volumes=[batch.CfnJobDefinition.VolumesProperty(
            efs_volume_configuration=batch.CfnJobDefinition.EfsVolumeConfigurationProperty(
                file_system_id="fileSystemId",

                # the properties below are optional
                authorization_config=batch.CfnJobDefinition.AuthorizationConfigProperty(
                    access_point_id="accessPointId",
                    iam="iam"
                ),
                root_directory="rootDirectory",
                transit_encryption="transitEncryption",
                transit_encryption_port=123
            ),
            host=batch.CfnJobDefinition.VolumesHostProperty(
                source_path="sourcePath"
            ),
            name="name"
        )]
    ),
    job_definition_name="jobDefinitionName",
    node_properties=batch.CfnJobDefinition.NodePropertiesProperty(
        main_node=123,
        node_range_properties=[batch.CfnJobDefinition.NodeRangePropertyProperty(
            target_nodes="targetNodes",

            # the properties below are optional
            container=batch.CfnJobDefinition.ContainerPropertiesProperty(
                image="image",

                # the properties below are optional
                command=["command"],
                environment=[batch.CfnJobDefinition.EnvironmentProperty(
                    name="name",
                    value="value"
                )],
                execution_role_arn="executionRoleArn",
                fargate_platform_configuration=batch.CfnJobDefinition.FargatePlatformConfigurationProperty(
                    platform_version="platformVersion"
                ),
                instance_type="instanceType",
                job_role_arn="jobRoleArn",
                linux_parameters=batch.CfnJobDefinition.LinuxParametersProperty(
                    devices=[batch.CfnJobDefinition.DeviceProperty(
                        container_path="containerPath",
                        host_path="hostPath",
                        permissions=["permissions"]
                    )],
                    init_process_enabled=False,
                    max_swap=123,
                    shared_memory_size=123,
                    swappiness=123,
                    tmpfs=[batch.CfnJobDefinition.TmpfsProperty(
                        container_path="containerPath",
                        size=123,

                        # the properties below are optional
                        mount_options=["mountOptions"]
                    )]
                ),
                log_configuration=batch.CfnJobDefinition.LogConfigurationProperty(
                    log_driver="logDriver",

                    # the properties below are optional
                    options=options,
                    secret_options=[batch.CfnJobDefinition.SecretProperty(
                        name="name",
                        value_from="valueFrom"
                    )]
                ),
                memory=123,
                mount_points=[batch.CfnJobDefinition.MountPointsProperty(
                    container_path="containerPath",
                    read_only=False,
                    source_volume="sourceVolume"
                )],
                network_configuration=batch.CfnJobDefinition.NetworkConfigurationProperty(
                    assign_public_ip="assignPublicIp"
                ),
                privileged=False,
                readonly_root_filesystem=False,
                resource_requirements=[batch.CfnJobDefinition.ResourceRequirementProperty(
                    type="type",
                    value="value"
                )],
                secrets=[batch.CfnJobDefinition.SecretProperty(
                    name="name",
                    value_from="valueFrom"
                )],
                ulimits=[batch.CfnJobDefinition.UlimitProperty(
                    hard_limit=123,
                    name="name",
                    soft_limit=123
                )],
                user="user",
                vcpus=123,
                volumes=[batch.CfnJobDefinition.VolumesProperty(
                    efs_volume_configuration=batch.CfnJobDefinition.EfsVolumeConfigurationProperty(
                        file_system_id="fileSystemId",

                        # the properties below are optional
                        authorization_config=batch.CfnJobDefinition.AuthorizationConfigProperty(
                            access_point_id="accessPointId",
                            iam="iam"
                        ),
                        root_directory="rootDirectory",
                        transit_encryption="transitEncryption",
                        transit_encryption_port=123
                    ),
                    host=batch.CfnJobDefinition.VolumesHostProperty(
                        source_path="sourcePath"
                    ),
                    name="name"
                )]
            )
        )],
        num_nodes=123
    ),
    parameters=parameters,
    platform_capabilities=["platformCapabilities"],
    propagate_tags=False,
    retry_strategy=batch.CfnJobDefinition.RetryStrategyProperty(
        attempts=123,
        evaluate_on_exit=[batch.CfnJobDefinition.EvaluateOnExitProperty(
            action="action",

            # the properties below are optional
            on_exit_code="onExitCode",
            on_reason="onReason",
            on_status_reason="onStatusReason"
        )]
    ),
    scheduling_priority=123,
    tags=tags,
    timeout=batch.CfnJobDefinition.TimeoutProperty(
        attempt_duration_seconds=123
    )
)

Create a new AWS::Batch::JobDefinition.

Parameters
  • scope (Construct) –

    • scope in which this resource is defined.

  • id (str) –

    • scoped id of the resource.

  • type (str) – The type of job definition. For more information about multi-node parallel jobs, see Creating a multi-node parallel job definition in the AWS Batch User Guide . .. epigraph:: If the job is run on Fargate resources, then multinode isn’t supported.

  • container_properties (Union[IResolvable, ContainerPropertiesProperty, Dict[str, Any], None]) – An object with various properties specific to container-based jobs.

  • job_definition_name (Optional[str]) – The name of the job definition.

  • node_properties (Union[IResolvable, NodePropertiesProperty, Dict[str, Any], None]) – An object with various properties specific to multi-node parallel jobs. .. epigraph:: If the job runs on Fargate resources, then you must not specify nodeProperties ; use containerProperties instead.

  • parameters (Optional[Any]) – Default parameters or parameter substitution placeholders that are set in the job definition. Parameters are specified as a key-value pair mapping. Parameters in a SubmitJob request override any corresponding parameter defaults from the job definition. For more information about specifying parameters, see Job definition parameters in the AWS Batch User Guide .

  • platform_capabilities (Optional[Sequence[str]]) – The platform capabilities required by the job definition. If no value is specified, it defaults to EC2 . Jobs run on Fargate resources specify FARGATE .

  • propagate_tags (Union[bool, IResolvable, None]) – Specifies whether to propagate the tags from the job or job definition to the corresponding Amazon ECS task. If no value is specified, the tags aren’t propagated. Tags can only be propagated to the tasks during task creation. For tags with the same name, job tags are given priority over job definitions tags. If the total number of combined tags from the job and job definition is over 50, the job is moved to the FAILED state.

  • retry_strategy (Union[IResolvable, RetryStrategyProperty, Dict[str, Any], None]) – The retry strategy to use for failed jobs that are submitted with this job definition.

  • scheduling_priority (Union[int, float, None]) – The scheduling priority of the job definition. This only affects jobs in job queues with a fair share policy. Jobs with a higher scheduling priority are scheduled before jobs with a lower scheduling priority.

  • tags (Optional[Any]) – The tags applied to the job definition.

  • timeout (Union[IResolvable, TimeoutProperty, Dict[str, Any], None]) – 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 haven’t finished.

Methods

add_deletion_override(path)

Syntactic sugar for addOverride(path, undefined).

Parameters

path (str) – The path of the value to delete.

Return type

None

add_depends_on(target)

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

Parameters

target (CfnResource) –

Return type

None

add_metadata(key, value)

Add a value to the CloudFormation Resource Metadata.

Parameters
  • key (str) –

  • value (Any) –

See

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

Return type

None

add_override(path, value)

Adds an override to the synthesized CloudFormation resource.

To add a property override, either use addPropertyOverride or prefix path with “Properties.” (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example:

cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"])
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")

would add the overrides Example:

"Properties": {
   "GlobalSecondaryIndexes": [
     {
       "Projection": {
         "NonKeyAttributes": [ "myattribute" ]
         ...
       }
       ...
     },
     {
       "ProjectionType": "INCLUDE"
       ...
     },
   ]
   ...
}

The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.

Parameters
  • path (str) –

    • The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.

  • value (Any) –

    • The value. Could be primitive or complex.

Return type

None

add_property_deletion_override(property_path)

Adds an override that deletes the value of a property from the resource definition.

Parameters

property_path (str) – The path to the property.

Return type

None

add_property_override(property_path, value)

Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

Parameters
  • property_path (str) – The path of the property.

  • value (Any) – The value.

Return type

None

apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)

Sets the deletion policy of the resource based on the removal policy specified.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters
  • policy (Optional[RemovalPolicy]) –

  • apply_to_update_replace_policy (Optional[bool]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: true

  • default (Optional[RemovalPolicy]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resoure, please consult that specific resource’s documentation.

Return type

None

get_att(attribute_name)

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

Parameters

attribute_name (str) – The name of the attribute.

Return type

Reference

get_metadata(key)

Retrieve a value value from the CloudFormation Resource Metadata.

Parameters

key (str) –

See

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

Return type

Any

inspect(inspector)

Examines the CloudFormation resource and discloses attributes.

Parameters

inspector (TreeInspector) –

  • tree inspector to collect and process attributes.

Return type

None

override_logical_id(new_logical_id)

Overrides the auto-generated logical ID with a specific ID.

Parameters

new_logical_id (str) – The new logical ID to use for this stack element.

Return type

None

to_string()

Returns a string representation of this construct.

Return type

str

Returns

a string representation of this resource

Attributes

CFN_RESOURCE_TYPE_NAME = 'AWS::Batch::JobDefinition'
cfn_options

Options for this resource, such as condition, update policy etc.

Return type

ICfnResourceOptions

cfn_resource_type

AWS resource type.

Return type

str

container_properties

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

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-batch-jobdefinition.html#cfn-batch-jobdefinition-containerproperties

Return type

Union[IResolvable, ContainerPropertiesProperty, None]

creation_stack

return:

the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.

Return type

List[str]

job_definition_name

The name of the job definition.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-batch-jobdefinition.html#cfn-batch-jobdefinition-jobdefinitionname

Return type

Optional[str]

logical_id

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Return type

str

Returns

the logical ID as a stringified token. This value will only get resolved during synthesis.

node

The construct tree node associated with this construct.

Return type

ConstructNode

node_properties

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

If the job runs on Fargate resources, then you must not specify nodeProperties ; use containerProperties instead.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-batch-jobdefinition.html#cfn-batch-jobdefinition-nodeproperties

Return type

Union[IResolvable, NodePropertiesProperty, None]

parameters

Default parameters or parameter substitution placeholders that are set in the job definition.

Parameters are specified as a key-value pair mapping. Parameters in a SubmitJob request override any corresponding parameter defaults from the job definition. For more information about specifying parameters, see Job definition parameters in the AWS Batch User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-batch-jobdefinition.html#cfn-batch-jobdefinition-parameters

Return type

Any

platform_capabilities

The platform capabilities required by the job definition.

If no value is specified, it defaults to EC2 . Jobs run on Fargate resources specify FARGATE .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-batch-jobdefinition.html#cfn-batch-jobdefinition-platformcapabilities

Return type

Optional[List[str]]

propagate_tags

Specifies whether to propagate the tags from the job or job definition to the corresponding Amazon ECS task.

If no value is specified, the tags aren’t propagated. Tags can only be propagated to the tasks during task creation. For tags with the same name, job tags are given priority over job definitions tags. If the total number of combined tags from the job and job definition is over 50, the job is moved to the FAILED state.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-batch-jobdefinition.html#cfn-batch-jobdefinition-propagatetags

Return type

Union[bool, IResolvable, None]

ref

Return a string that will be resolved to a CloudFormation { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

Return type

str

retry_strategy

The retry strategy to use for failed jobs that are submitted with this job definition.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-batch-jobdefinition.html#cfn-batch-jobdefinition-retrystrategy

Return type

Union[IResolvable, RetryStrategyProperty, None]

scheduling_priority

The scheduling priority of the job definition.

This only affects jobs in job queues with a fair share policy. Jobs with a higher scheduling priority are scheduled before jobs with a lower scheduling priority.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-batch-jobdefinition.html#cfn-batch-jobdefinition-schedulingpriority

Return type

Union[int, float, None]

stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

Return type

Stack

tags

The tags applied to the job definition.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-batch-jobdefinition.html#cfn-batch-jobdefinition-tags

Return type

TagManager

timeout

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 haven’t finished.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-batch-jobdefinition.html#cfn-batch-jobdefinition-timeout

Return type

Union[IResolvable, TimeoutProperty, None]

type

The type of job definition.

For more information about multi-node parallel jobs, see Creating a multi-node parallel job definition in the AWS Batch User Guide . .. epigraph:

If the job is run on Fargate resources, then ``multinode`` isn't supported.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-batch-jobdefinition.html#cfn-batch-jobdefinition-type

Return type

str

Static Methods

classmethod is_cfn_element(x)

Returns true if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

Parameters

x (Any) –

Return type

bool

Returns

The construct as a stack element or undefined if it is not a stack element.

classmethod is_cfn_resource(construct)

Check whether the given construct is a CfnResource.

Parameters

construct (IConstruct) –

Return type

bool

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool

AuthorizationConfigProperty

class CfnJobDefinition.AuthorizationConfigProperty(*, access_point_id=None, iam=None)

Bases: object

The authorization configuration details for the Amazon EFS file system.

Parameters
  • access_point_id (Optional[str]) – The Amazon EFS access point ID to use. If an access point is specified, the root directory value specified in the EFSVolumeConfiguration must either be omitted or set to / which will enforce the path set on the EFS access point. If an access point is used, transit encryption must be enabled in the EFSVolumeConfiguration . For more information, see Working with Amazon EFS access points in the Amazon Elastic File System User Guide .

  • iam (Optional[str]) – Whether or not to use the AWS Batch job IAM role defined in a job definition when mounting the Amazon EFS file system. If enabled, transit encryption must be enabled in the EFSVolumeConfiguration . If this parameter is omitted, the default value of DISABLED is used. For more information, see Using Amazon EFS access points in the AWS Batch User Guide . EFS IAM authorization requires that TransitEncryption be ENABLED and that a JobRoleArn is specified.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-authorizationconfig.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_batch as batch

authorization_config_property = batch.CfnJobDefinition.AuthorizationConfigProperty(
    access_point_id="accessPointId",
    iam="iam"
)

Attributes

access_point_id

The Amazon EFS access point ID to use.

If an access point is specified, the root directory value specified in the EFSVolumeConfiguration must either be omitted or set to / which will enforce the path set on the EFS access point. If an access point is used, transit encryption must be enabled in the EFSVolumeConfiguration . For more information, see Working with Amazon EFS access points in the Amazon Elastic File System User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-authorizationconfig.html#cfn-batch-jobdefinition-authorizationconfig-accesspointid

Return type

Optional[str]

iam

Whether or not to use the AWS Batch job IAM role defined in a job definition when mounting the Amazon EFS file system.

If enabled, transit encryption must be enabled in the EFSVolumeConfiguration . If this parameter is omitted, the default value of DISABLED is used. For more information, see Using Amazon EFS access points in the AWS Batch User Guide . EFS IAM authorization requires that TransitEncryption be ENABLED and that a JobRoleArn is specified.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-authorizationconfig.html#cfn-batch-jobdefinition-authorizationconfig-iam

Return type

Optional[str]

ContainerPropertiesProperty

class CfnJobDefinition.ContainerPropertiesProperty(*, image, command=None, environment=None, execution_role_arn=None, fargate_platform_configuration=None, instance_type=None, job_role_arn=None, linux_parameters=None, log_configuration=None, memory=None, mount_points=None, network_configuration=None, privileged=None, readonly_root_filesystem=None, resource_requirements=None, secrets=None, ulimits=None, user=None, vcpus=None, volumes=None)

Bases: object

Container properties are used in job definitions to describe the container that’s launched as part of a job.

Parameters
  • image (str) – The image used to start a container. This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with *repository-url* / *image* : *tag* . Up to 255 letters (uppercase and lowercase), numbers, hyphens, underscores, colons, periods, forward slashes, and number signs are allowed. This parameter maps to Image in the Create a container section of the Docker Remote API and the IMAGE parameter of docker run . .. epigraph:: Docker image architecture must match the processor architecture of the compute resources that they’re scheduled on. For example, ARM-based Docker images can only run on ARM-based compute resources. - Images in Amazon ECR Public repositories use the full registry/repository[:tag] or registry/repository[@digest] naming conventions. For example, public.ecr.aws/ *registry_alias* / *my-web-app* : *latest* . - Images in Amazon ECR repositories use the full registry and repository URI (for example, 012345678910.dkr.ecr.<region-name>.amazonaws.com/<repository-name> ). - Images in official repositories on Docker Hub use a single name (for example, ubuntu or mongo ). - Images in other repositories on Docker Hub are qualified with an organization name (for example, amazon/amazon-ecs-agent ). - Images in other online repositories are qualified further by a domain name (for example, quay.io/assemblyline/ubuntu ).

  • command (Optional[Sequence[str]]) –

    The command that’s passed to the container. This parameter maps to Cmd in the Create a container section of the Docker Remote API and the COMMAND parameter to docker run . For more information, see https://docs.docker.com/engine/reference/builder/#cmd .

  • environment (Union[IResolvable, Sequence[Union[IResolvable, EnvironmentProperty, Dict[str, Any]]], None]) –

    The environment variables to pass to a container. This parameter maps to Env in the Create a container section of the Docker Remote API and the --env option to docker run . .. epigraph:: We don’t recommend using plaintext environment variables for sensitive information, such as credential data. > Environment variables must not start with AWS_BATCH ; this naming convention is reserved for variables that are set by the AWS Batch service.

  • execution_role_arn (Optional[str]) – The Amazon Resource Name (ARN) of the execution role that AWS Batch can assume. For jobs that run on Fargate resources, you must provide an execution role. For more information, see AWS Batch execution IAM role in the AWS Batch User Guide .

  • fargate_platform_configuration (Union[IResolvable, FargatePlatformConfigurationProperty, Dict[str, Any], None]) – The platform configuration for jobs that are running on Fargate resources. Jobs that are running on EC2 resources must not specify this parameter.

  • instance_type (Optional[str]) – The instance type to use for a multi-node parallel job. All node groups in a multi-node parallel job must use the same instance type. .. epigraph:: This parameter isn’t applicable to single-node container jobs or jobs that run on Fargate resources, and shouldn’t be provided.

  • job_role_arn (Optional[str]) – The Amazon Resource Name (ARN) of the IAM role that the container can assume for AWS permissions. For more information, see IAM roles for tasks in the Amazon Elastic Container Service Developer Guide .

  • linux_parameters (Union[IResolvable, LinuxParametersProperty, Dict[str, Any], None]) – Linux-specific modifications that are applied to the container, such as details for device mappings.

  • log_configuration (Union[IResolvable, LogConfigurationProperty, Dict[str, Any], None]) –

    The log configuration specification for the container. This parameter maps to LogConfig in the Create a container section of the Docker Remote API and the --log-driver option to docker run . By default, containers use the same logging driver that the Docker daemon uses. However the container might use a different logging driver than the Docker daemon by specifying a log driver with this parameter in the container definition. To use a different logging driver for a container, the log system must be configured properly on the container instance (or on a different log server for remote logging options). For more information on the options for different supported log drivers, see Configure logging drivers in the Docker documentation. .. epigraph:: AWS Batch currently supports a subset of the logging drivers available to the Docker daemon (shown in the LogConfiguration data type). This parameter requires version 1.18 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log into your container instance and run the following command: sudo docker version | grep "Server API version" .. epigraph:: The Amazon ECS container agent running on a container instance must register the logging drivers available on that instance with the ECS_AVAILABLE_LOGGING_DRIVERS environment variable before containers placed on that instance can use these log configuration options. For more information, see Amazon ECS container agent configuration in the Amazon Elastic Container Service Developer Guide .

  • memory (Union[int, float, None]) – This parameter is deprecated, use resourceRequirements to specify the memory requirements for the job definition. It’s not supported for jobs running on Fargate resources. For jobs running on EC2 resources, it specifies the memory hard limit (in MiB) for a container. If your container attempts to exceed the specified number, it’s terminated. You must specify at least 4 MiB of memory for a job using this parameter. The memory hard limit can be specified in several places. It must be specified for each node at least once.

  • mount_points (Union[IResolvable, Sequence[Union[IResolvable, MountPointsProperty, Dict[str, Any]]], None]) –

    The mount points for data volumes in your container. This parameter maps to Volumes in the Create a container section of the Docker Remote API and the --volume option to docker run .

  • network_configuration (Union[IResolvable, NetworkConfigurationProperty, Dict[str, Any], None]) – The network configuration for jobs that are running on Fargate resources. Jobs that are running on EC2 resources must not specify this parameter.

  • privileged (Union[bool, IResolvable, None]) –

    When this parameter is true, the container is given elevated permissions on the host container instance (similar to the root user). This parameter maps to Privileged in the Create a container section of the Docker Remote API and the --privileged option to docker run . The default value is false. .. epigraph:: This parameter isn’t applicable to jobs that are running on Fargate resources and shouldn’t be provided, or specified as false.

  • readonly_root_filesystem (Union[bool, IResolvable, None]) –

    When this parameter is true, the container is given read-only access to its root file system. This parameter maps to ReadonlyRootfs in the Create a container section of the Docker Remote API and the --read-only option to docker run .

  • resource_requirements (Union[IResolvable, Sequence[Union[IResolvable, ResourceRequirementProperty, Dict[str, Any]]], None]) – The type and amount of resources to assign to a container. The supported resources include GPU , MEMORY , and VCPU .

  • secrets (Union[IResolvable, Sequence[Union[IResolvable, SecretProperty, Dict[str, Any]]], None]) – The secrets for the container. For more information, see Specifying sensitive data in the AWS Batch User Guide .

  • ulimits (Union[IResolvable, Sequence[Union[IResolvable, UlimitProperty, Dict[str, Any]]], None]) –

    A list of ulimits to set in the container. This parameter maps to Ulimits in the Create a container section of the Docker Remote API and the --ulimit option to docker run . .. epigraph:: This parameter isn’t applicable to jobs that are running on Fargate resources and shouldn’t be provided.

  • user (Optional[str]) –

    The user name to use inside the container. This parameter maps to User in the Create a container section of the Docker Remote API and the --user option to docker run .

  • vcpus (Union[int, float, None]) –

    This parameter is deprecated, use resourceRequirements to specify the vCPU requirements for the job definition. It’s not supported for jobs running on Fargate resources. For jobs running on EC2 resources, it specifies the number of vCPUs reserved for the job. Each vCPU is equivalent to 1,024 CPU shares. This parameter maps to CpuShares in the Create a container section of the Docker Remote API and the --cpu-shares option to docker run . The number of vCPUs must be specified but can be specified in several places. You must specify it at least once for each node.

  • volumes (Union[IResolvable, Sequence[Union[IResolvable, VolumesProperty, Dict[str, Any]]], None]) – A list of data volumes used in a job.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_batch as batch

# options: Any

container_properties_property = batch.CfnJobDefinition.ContainerPropertiesProperty(
    image="image",

    # the properties below are optional
    command=["command"],
    environment=[batch.CfnJobDefinition.EnvironmentProperty(
        name="name",
        value="value"
    )],
    execution_role_arn="executionRoleArn",
    fargate_platform_configuration=batch.CfnJobDefinition.FargatePlatformConfigurationProperty(
        platform_version="platformVersion"
    ),
    instance_type="instanceType",
    job_role_arn="jobRoleArn",
    linux_parameters=batch.CfnJobDefinition.LinuxParametersProperty(
        devices=[batch.CfnJobDefinition.DeviceProperty(
            container_path="containerPath",
            host_path="hostPath",
            permissions=["permissions"]
        )],
        init_process_enabled=False,
        max_swap=123,
        shared_memory_size=123,
        swappiness=123,
        tmpfs=[batch.CfnJobDefinition.TmpfsProperty(
            container_path="containerPath",
            size=123,

            # the properties below are optional
            mount_options=["mountOptions"]
        )]
    ),
    log_configuration=batch.CfnJobDefinition.LogConfigurationProperty(
        log_driver="logDriver",

        # the properties below are optional
        options=options,
        secret_options=[batch.CfnJobDefinition.SecretProperty(
            name="name",
            value_from="valueFrom"
        )]
    ),
    memory=123,
    mount_points=[batch.CfnJobDefinition.MountPointsProperty(
        container_path="containerPath",
        read_only=False,
        source_volume="sourceVolume"
    )],
    network_configuration=batch.CfnJobDefinition.NetworkConfigurationProperty(
        assign_public_ip="assignPublicIp"
    ),
    privileged=False,
    readonly_root_filesystem=False,
    resource_requirements=[batch.CfnJobDefinition.ResourceRequirementProperty(
        type="type",
        value="value"
    )],
    secrets=[batch.CfnJobDefinition.SecretProperty(
        name="name",
        value_from="valueFrom"
    )],
    ulimits=[batch.CfnJobDefinition.UlimitProperty(
        hard_limit=123,
        name="name",
        soft_limit=123
    )],
    user="user",
    vcpus=123,
    volumes=[batch.CfnJobDefinition.VolumesProperty(
        efs_volume_configuration=batch.CfnJobDefinition.EfsVolumeConfigurationProperty(
            file_system_id="fileSystemId",

            # the properties below are optional
            authorization_config=batch.CfnJobDefinition.AuthorizationConfigProperty(
                access_point_id="accessPointId",
                iam="iam"
            ),
            root_directory="rootDirectory",
            transit_encryption="transitEncryption",
            transit_encryption_port=123
        ),
        host=batch.CfnJobDefinition.VolumesHostProperty(
            source_path="sourcePath"
        ),
        name="name"
    )]
)

Attributes

command

The command that’s passed to the container.

This parameter maps to Cmd in the Create a container section of the Docker Remote API and the COMMAND parameter to docker run . For more information, see https://docs.docker.com/engine/reference/builder/#cmd .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties.html#cfn-batch-jobdefinition-containerproperties-command

Return type

Optional[List[str]]

environment

The environment variables to pass to a container.

This parameter maps to Env in the Create a container section of the Docker Remote API and the --env option to docker run . .. epigraph:

We don't recommend using plaintext environment variables for sensitive information, such as credential data. > Environment variables must not start with ``AWS_BATCH`` ; this naming convention is reserved for variables that are set by the AWS Batch service.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties.html#cfn-batch-jobdefinition-containerproperties-environment

Return type

Union[IResolvable, List[Union[IResolvable, EnvironmentProperty]], None]

execution_role_arn

The Amazon Resource Name (ARN) of the execution role that AWS Batch can assume.

For jobs that run on Fargate resources, you must provide an execution role. For more information, see AWS Batch execution IAM role in the AWS Batch User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties.html#cfn-batch-jobdefinition-containerproperties-executionrolearn

Return type

Optional[str]

fargate_platform_configuration

The platform configuration for jobs that are running on Fargate resources.

Jobs that are running on EC2 resources must not specify this parameter.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties.html#cfn-batch-jobdefinition-containerproperties-fargateplatformconfiguration

Return type

Union[IResolvable, FargatePlatformConfigurationProperty, None]

image

The image used to start a container.

This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with *repository-url* / *image* : *tag* . Up to 255 letters (uppercase and lowercase), numbers, hyphens, underscores, colons, periods, forward slashes, and number signs are allowed. This parameter maps to Image in the Create a container section of the Docker Remote API and the IMAGE parameter of docker run . .. epigraph:

Docker image architecture must match the processor architecture of the compute resources that they're scheduled on. For example, ARM-based Docker images can only run on ARM-based compute resources.
  • Images in Amazon ECR Public repositories use the full registry/repository[:tag] or registry/repository[@digest] naming conventions. For example, public.ecr.aws/ *registry_alias* / *my-web-app* : *latest* .

  • Images in Amazon ECR repositories use the full registry and repository URI (for example, 012345678910.dkr.ecr.<region-name>.amazonaws.com/<repository-name> ).

  • Images in official repositories on Docker Hub use a single name (for example, ubuntu or mongo ).

  • Images in other repositories on Docker Hub are qualified with an organization name (for example, amazon/amazon-ecs-agent ).

  • Images in other online repositories are qualified further by a domain name (for example, quay.io/assemblyline/ubuntu ).

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties.html#cfn-batch-jobdefinition-containerproperties-image

Return type

str

instance_type

The instance type to use for a multi-node parallel job.

All node groups in a multi-node parallel job must use the same instance type. .. epigraph:

This parameter isn't applicable to single-node container jobs or jobs that run on Fargate resources, and shouldn't be provided.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties.html#cfn-batch-jobdefinition-containerproperties-instancetype

Return type

Optional[str]

job_role_arn

The Amazon Resource Name (ARN) of the IAM role that the container can assume for AWS permissions.

For more information, see IAM roles for tasks in the Amazon Elastic Container Service Developer Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties.html#cfn-batch-jobdefinition-containerproperties-jobrolearn

Return type

Optional[str]

linux_parameters

Linux-specific modifications that are applied to the container, such as details for device mappings.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties.html#cfn-batch-jobdefinition-containerproperties-linuxparameters

Return type

Union[IResolvable, LinuxParametersProperty, None]

log_configuration

The log configuration specification for the container.

This parameter maps to LogConfig in the Create a container section of the Docker Remote API and the --log-driver option to docker run . By default, containers use the same logging driver that the Docker daemon uses. However the container might use a different logging driver than the Docker daemon by specifying a log driver with this parameter in the container definition. To use a different logging driver for a container, the log system must be configured properly on the container instance (or on a different log server for remote logging options). For more information on the options for different supported log drivers, see Configure logging drivers in the Docker documentation. .. epigraph:

AWS Batch currently supports a subset of the logging drivers available to the Docker daemon (shown in the ``LogConfiguration`` data type).

This parameter requires version 1.18 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log into your container instance and run the following command: sudo docker version | grep "Server API version" .. epigraph:

The Amazon ECS container agent running on a container instance must register the logging drivers available on that instance with the ``ECS_AVAILABLE_LOGGING_DRIVERS`` environment variable before containers placed on that instance can use these log configuration options. For more information, see `Amazon ECS container agent configuration <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html>`_ in the *Amazon Elastic Container Service Developer Guide* .
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties.html#cfn-batch-jobdefinition-containerproperties-logconfiguration

Return type

Union[IResolvable, LogConfigurationProperty, None]

memory

This parameter is deprecated, use resourceRequirements to specify the memory requirements for the job definition.

It’s not supported for jobs running on Fargate resources. For jobs running on EC2 resources, it specifies the memory hard limit (in MiB) for a container. If your container attempts to exceed the specified number, it’s terminated. You must specify at least 4 MiB of memory for a job using this parameter. The memory hard limit can be specified in several places. It must be specified for each node at least once.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties.html#cfn-batch-jobdefinition-containerproperties-memory

Return type

Union[int, float, None]

mount_points

The mount points for data volumes in your container.

This parameter maps to Volumes in the Create a container section of the Docker Remote API and the --volume option to docker run .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties.html#cfn-batch-jobdefinition-containerproperties-mountpoints

Return type

Union[IResolvable, List[Union[IResolvable, MountPointsProperty]], None]

network_configuration

The network configuration for jobs that are running on Fargate resources.

Jobs that are running on EC2 resources must not specify this parameter.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties.html#cfn-batch-jobdefinition-containerproperties-networkconfiguration

Return type

Union[IResolvable, NetworkConfigurationProperty, None]

privileged

When this parameter is true, the container is given elevated permissions on the host container instance (similar to the root user).

This parameter maps to Privileged in the Create a container section of the Docker Remote API and the --privileged option to docker run . The default value is false. .. epigraph:

This parameter isn't applicable to jobs that are running on Fargate resources and shouldn't be provided, or specified as false.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties.html#cfn-batch-jobdefinition-containerproperties-privileged

Return type

Union[bool, IResolvable, None]

readonly_root_filesystem

When this parameter is true, the container is given read-only access to its root file system.

This parameter maps to ReadonlyRootfs in the Create a container section of the Docker Remote API and the --read-only option to docker run .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties.html#cfn-batch-jobdefinition-containerproperties-readonlyrootfilesystem

Return type

Union[bool, IResolvable, None]

resource_requirements

The type and amount of resources to assign to a container.

The supported resources include GPU , MEMORY , and VCPU .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties.html#cfn-batch-jobdefinition-containerproperties-resourcerequirements

Return type

Union[IResolvable, List[Union[IResolvable, ResourceRequirementProperty]], None]

secrets

The secrets for the container.

For more information, see Specifying sensitive data in the AWS Batch User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties.html#cfn-batch-jobdefinition-containerproperties-secrets

Return type

Union[IResolvable, List[Union[IResolvable, SecretProperty]], None]

ulimits

A list of ulimits to set in the container.

This parameter maps to Ulimits in the Create a container section of the Docker Remote API and the --ulimit option to docker run . .. epigraph:

This parameter isn't applicable to jobs that are running on Fargate resources and shouldn't be provided.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties.html#cfn-batch-jobdefinition-containerproperties-ulimits

Return type

Union[IResolvable, List[Union[IResolvable, UlimitProperty]], None]

user

The user name to use inside the container.

This parameter maps to User in the Create a container section of the Docker Remote API and the --user option to docker run .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties.html#cfn-batch-jobdefinition-containerproperties-user

Return type

Optional[str]

vcpus

This parameter is deprecated, use resourceRequirements to specify the vCPU requirements for the job definition.

It’s not supported for jobs running on Fargate resources. For jobs running on EC2 resources, it specifies the number of vCPUs reserved for the job.

Each vCPU is equivalent to 1,024 CPU shares. This parameter maps to CpuShares in the Create a container section of the Docker Remote API and the --cpu-shares option to docker run . The number of vCPUs must be specified but can be specified in several places. You must specify it at least once for each node.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties.html#cfn-batch-jobdefinition-containerproperties-vcpus

Return type

Union[int, float, None]

volumes

A list of data volumes used in a job.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties.html#cfn-batch-jobdefinition-containerproperties-volumes

Return type

Union[IResolvable, List[Union[IResolvable, VolumesProperty]], None]

DeviceProperty

class CfnJobDefinition.DeviceProperty(*, container_path=None, host_path=None, permissions=None)

Bases: object

An object representing a container instance host device.

This object isn’t applicable to jobs that are running on Fargate resources and shouldn’t be provided.

Parameters
  • container_path (Optional[str]) – The path inside the container that’s used to expose the host device. By default, the hostPath value is used.

  • host_path (Optional[str]) – The path for the device on the host container instance.

  • permissions (Optional[Sequence[str]]) – The explicit permissions to provide to the container for the device. By default, the container has permissions for read , write , and mknod for the device.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-device.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_batch as batch

device_property = batch.CfnJobDefinition.DeviceProperty(
    container_path="containerPath",
    host_path="hostPath",
    permissions=["permissions"]
)

Attributes

container_path

The path inside the container that’s used to expose the host device.

By default, the hostPath value is used.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-device.html#cfn-batch-jobdefinition-device-containerpath

Return type

Optional[str]

host_path

The path for the device on the host container instance.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-device.html#cfn-batch-jobdefinition-device-hostpath

Return type

Optional[str]

permissions

The explicit permissions to provide to the container for the device.

By default, the container has permissions for read , write , and mknod for the device.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-device.html#cfn-batch-jobdefinition-device-permissions

Return type

Optional[List[str]]

EfsVolumeConfigurationProperty

class CfnJobDefinition.EfsVolumeConfigurationProperty(*, file_system_id, authorization_config=None, root_directory=None, transit_encryption=None, transit_encryption_port=None)

Bases: object

This is used when you’re using an Amazon Elastic File System file system for job storage.

For more information, see Amazon EFS Volumes in the AWS Batch User Guide .

Parameters
  • file_system_id (str) – The Amazon EFS file system ID to use.

  • authorization_config (Union[IResolvable, AuthorizationConfigProperty, Dict[str, Any], None]) – The authorization configuration details for the Amazon EFS file system.

  • root_directory (Optional[str]) – The directory within the Amazon EFS file system to mount as the root directory inside the host. If this parameter is omitted, the root of the Amazon EFS volume is used instead. Specifying / has the same effect as omitting this parameter. The maximum length is 4,096 characters. .. epigraph:: If an EFS access point is specified in the authorizationConfig , the root directory parameter must either be omitted or set to / , which enforces the path set on the Amazon EFS access point.

  • transit_encryption (Optional[str]) – Determines whether to enable encryption for Amazon EFS data in transit between the Amazon ECS host and the Amazon EFS server. Transit encryption must be enabled if Amazon EFS IAM authorization is used. If this parameter is omitted, the default value of DISABLED is used. For more information, see Encrypting data in transit in the Amazon Elastic File System User Guide .

  • transit_encryption_port (Union[int, float, None]) – The port to use when sending encrypted data between the Amazon ECS host and the Amazon EFS server. If you don’t specify a transit encryption port, it uses the port selection strategy that the Amazon EFS mount helper uses. The value must be between 0 and 65,535. For more information, see EFS mount helper in the Amazon Elastic File System User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-efsvolumeconfiguration.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_batch as batch

efs_volume_configuration_property = batch.CfnJobDefinition.EfsVolumeConfigurationProperty(
    file_system_id="fileSystemId",

    # the properties below are optional
    authorization_config=batch.CfnJobDefinition.AuthorizationConfigProperty(
        access_point_id="accessPointId",
        iam="iam"
    ),
    root_directory="rootDirectory",
    transit_encryption="transitEncryption",
    transit_encryption_port=123
)

Attributes

authorization_config

The authorization configuration details for the Amazon EFS file system.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-efsvolumeconfiguration.html#cfn-batch-jobdefinition-efsvolumeconfiguration-authorizationconfig

Return type

Union[IResolvable, AuthorizationConfigProperty, None]

file_system_id

The Amazon EFS file system ID to use.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-efsvolumeconfiguration.html#cfn-batch-jobdefinition-efsvolumeconfiguration-filesystemid

Return type

str

root_directory

The directory within the Amazon EFS file system to mount as the root directory inside the host.

If this parameter is omitted, the root of the Amazon EFS volume is used instead. Specifying / has the same effect as omitting this parameter. The maximum length is 4,096 characters. .. epigraph:

If an EFS access point is specified in the ``authorizationConfig`` , the root directory parameter must either be omitted or set to ``/`` , which enforces the path set on the Amazon EFS access point.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-efsvolumeconfiguration.html#cfn-batch-jobdefinition-efsvolumeconfiguration-rootdirectory

Return type

Optional[str]

transit_encryption

Determines whether to enable encryption for Amazon EFS data in transit between the Amazon ECS host and the Amazon EFS server.

Transit encryption must be enabled if Amazon EFS IAM authorization is used. If this parameter is omitted, the default value of DISABLED is used. For more information, see Encrypting data in transit in the Amazon Elastic File System User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-efsvolumeconfiguration.html#cfn-batch-jobdefinition-efsvolumeconfiguration-transitencryption

Return type

Optional[str]

transit_encryption_port

The port to use when sending encrypted data between the Amazon ECS host and the Amazon EFS server.

If you don’t specify a transit encryption port, it uses the port selection strategy that the Amazon EFS mount helper uses. The value must be between 0 and 65,535. For more information, see EFS mount helper in the Amazon Elastic File System User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-efsvolumeconfiguration.html#cfn-batch-jobdefinition-efsvolumeconfiguration-transitencryptionport

Return type

Union[int, float, None]

EnvironmentProperty

class CfnJobDefinition.EnvironmentProperty(*, name=None, value=None)

Bases: object

The Environment property type specifies environment variables to use in a job definition.

Parameters
  • name (Optional[str]) – The name of the environment variable.

  • value (Optional[str]) – The value of the environment variable.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-environment.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_batch as batch

environment_property = batch.CfnJobDefinition.EnvironmentProperty(
    name="name",
    value="value"
)

Attributes

name

The name of the environment variable.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-environment.html#cfn-batch-jobdefinition-environment-name

Return type

Optional[str]

value

The value of the environment variable.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-environment.html#cfn-batch-jobdefinition-environment-value

Return type

Optional[str]

EvaluateOnExitProperty

class CfnJobDefinition.EvaluateOnExitProperty(*, action, on_exit_code=None, on_reason=None, on_status_reason=None)

Bases: object

Specifies a set of conditions to be met, and an action to take ( RETRY or EXIT ) if all conditions are met.

Parameters
  • action (str) – Specifies the action to take if all of the specified conditions ( onStatusReason , onReason , and onExitCode ) are met. The values aren’t case sensitive.

  • on_exit_code (Optional[str]) – Contains a glob pattern to match against the decimal representation of the ExitCode returned for a job. The pattern can be up to 512 characters in length. It can contain only numbers, and can optionally end with an asterisk (*) so that only the start of the string needs to be an exact match. The string can be between 1 and 512 characters in length.

  • on_reason (Optional[str]) – Contains a glob pattern to match against the Reason returned for a job. The pattern can be up to 512 characters in length. It can contain letters, numbers, periods (.), colons (:), and white space (including spaces and tabs). It can optionally end with an asterisk (*) so that only the start of the string needs to be an exact match. The string can be between 1 and 512 characters in length.

  • on_status_reason (Optional[str]) – Contains a glob pattern to match against the StatusReason returned for a job. The pattern can be up to 512 characters in length. It can contain letters, numbers, periods (.), colons (:), and white space (including spaces or tabs). It can optionally end with an asterisk (*) so that only the start of the string needs to be an exact match. The string can be between 1 and 512 characters in length.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-evaluateonexit.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_batch as batch

evaluate_on_exit_property = batch.CfnJobDefinition.EvaluateOnExitProperty(
    action="action",

    # the properties below are optional
    on_exit_code="onExitCode",
    on_reason="onReason",
    on_status_reason="onStatusReason"
)

Attributes

action

Specifies the action to take if all of the specified conditions ( onStatusReason , onReason , and onExitCode ) are met.

The values aren’t case sensitive.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-evaluateonexit.html#cfn-batch-jobdefinition-evaluateonexit-action

Return type

str

on_exit_code

Contains a glob pattern to match against the decimal representation of the ExitCode returned for a job.

The pattern can be up to 512 characters in length. It can contain only numbers, and can optionally end with an asterisk (*) so that only the start of the string needs to be an exact match.

The string can be between 1 and 512 characters in length.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-evaluateonexit.html#cfn-batch-jobdefinition-evaluateonexit-onexitcode

Return type

Optional[str]

on_reason

Contains a glob pattern to match against the Reason returned for a job.

The pattern can be up to 512 characters in length. It can contain letters, numbers, periods (.), colons (:), and white space (including spaces and tabs). It can optionally end with an asterisk (*) so that only the start of the string needs to be an exact match.

The string can be between 1 and 512 characters in length.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-evaluateonexit.html#cfn-batch-jobdefinition-evaluateonexit-onreason

Return type

Optional[str]

on_status_reason

Contains a glob pattern to match against the StatusReason returned for a job.

The pattern can be up to 512 characters in length. It can contain letters, numbers, periods (.), colons (:), and white space (including spaces or tabs). It can optionally end with an asterisk (*) so that only the start of the string needs to be an exact match.

The string can be between 1 and 512 characters in length.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-evaluateonexit.html#cfn-batch-jobdefinition-evaluateonexit-onstatusreason

Return type

Optional[str]

FargatePlatformConfigurationProperty

class CfnJobDefinition.FargatePlatformConfigurationProperty(*, platform_version=None)

Bases: object

The platform configuration for jobs that are running on Fargate resources.

Jobs that run on EC2 resources must not specify this parameter.

Parameters

platform_version (Optional[str]) – The AWS Fargate platform version where the jobs are running. A platform version is specified only for jobs that are running on Fargate resources. If one isn’t specified, the LATEST platform version is used by default. This uses a recent, approved version of the AWS Fargate platform for compute resources. For more information, see AWS Fargate platform versions in the Amazon Elastic Container Service Developer Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties-fargateplatformconfiguration.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_batch as batch

fargate_platform_configuration_property = batch.CfnJobDefinition.FargatePlatformConfigurationProperty(
    platform_version="platformVersion"
)

Attributes

platform_version

The AWS Fargate platform version where the jobs are running.

A platform version is specified only for jobs that are running on Fargate resources. If one isn’t specified, the LATEST platform version is used by default. This uses a recent, approved version of the AWS Fargate platform for compute resources. For more information, see AWS Fargate platform versions in the Amazon Elastic Container Service Developer Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties-fargateplatformconfiguration.html#cfn-batch-jobdefinition-containerproperties-fargateplatformconfiguration-platformversion

Return type

Optional[str]

LinuxParametersProperty

class CfnJobDefinition.LinuxParametersProperty(*, devices=None, init_process_enabled=None, max_swap=None, shared_memory_size=None, swappiness=None, tmpfs=None)

Bases: object

Linux-specific modifications that are applied to the container, such as details for device mappings.

Parameters
  • devices (Union[IResolvable, Sequence[Union[IResolvable, DeviceProperty, Dict[str, Any]]], None]) –

    Any host devices to expose to the container. This parameter maps to Devices in the Create a container section of the Docker Remote API and the --device option to docker run . .. epigraph:: This parameter isn’t applicable to jobs that are running on Fargate resources and shouldn’t be provided.

  • init_process_enabled (Union[bool, IResolvable, None]) –

    If true, run an init process inside the container that forwards signals and reaps processes. This parameter maps to the --init option to docker run . This parameter requires version 1.25 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log into your container instance and run the following command: sudo docker version | grep "Server API version"

  • max_swap (Union[int, float, None]) –

    The total amount of swap memory (in MiB) a container can use. This parameter is translated to the --memory-swap option to docker run where the value is the sum of the container memory plus the maxSwap value. For more information, see `--memory-swap details <https://docs.aws.amazon.com/https://docs.docker.com/config/containers/resource_constraints/#–memory-swap-details>`_ in the Docker documentation. If a maxSwap value of 0 is specified, the container doesn’t use swap. Accepted values are 0 or any positive integer. If the maxSwap parameter is omitted, the container doesn’t use the swap configuration for the container instance it is running on. A maxSwap value must be set for the swappiness parameter to be used. .. epigraph:: This parameter isn’t applicable to jobs that are running on Fargate resources and shouldn’t be provided.

  • shared_memory_size (Union[int, float, None]) –

    The value for the size (in MiB) of the /dev/shm volume. This parameter maps to the --shm-size option to docker run . .. epigraph:: This parameter isn’t applicable to jobs that are running on Fargate resources and shouldn’t be provided.

  • swappiness (Union[int, float, None]) –

    This allows you to tune a container’s memory swappiness behavior. A swappiness value of 0 causes swapping not to happen unless absolutely necessary. A swappiness value of 100 causes pages to be swapped very aggressively. Accepted values are whole numbers between 0 and 100 . If the swappiness parameter isn’t specified, a default value of 60 is used. If a value isn’t specified for maxSwap , then this parameter is ignored. If maxSwap is set to 0, the container doesn’t use swap. This parameter maps to the --memory-swappiness option to docker run . Consider the following when you use a per-container swap configuration. - Swap space must be enabled and allocated on the container instance for the containers to use. .. epigraph:: The Amazon ECS optimized AMIs don’t have swap enabled by default. You must enable swap on the instance to use this feature. For more information, see Instance store swap volumes in the Amazon EC2 User Guide for Linux Instances or How do I allocate memory to work as swap space in an Amazon EC2 instance by using a swap file? - The swap space parameters are only supported for job definitions using EC2 resources. - If the maxSwap and swappiness parameters are omitted from a job definition, each container will have a default swappiness value of 60, and the total swap usage will be limited to two times the memory reservation of the container. .. epigraph:: This parameter isn’t applicable to jobs that are running on Fargate resources and shouldn’t be provided.

  • tmpfs (Union[IResolvable, Sequence[Union[IResolvable, TmpfsProperty, Dict[str, Any]]], None]) –

    The container path, mount options, and size (in MiB) of the tmpfs mount. This parameter maps to the --tmpfs option to docker run . .. epigraph:: This parameter isn’t applicable to jobs that are running on Fargate resources and shouldn’t be provided.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties-linuxparameters.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_batch as batch

linux_parameters_property = batch.CfnJobDefinition.LinuxParametersProperty(
    devices=[batch.CfnJobDefinition.DeviceProperty(
        container_path="containerPath",
        host_path="hostPath",
        permissions=["permissions"]
    )],
    init_process_enabled=False,
    max_swap=123,
    shared_memory_size=123,
    swappiness=123,
    tmpfs=[batch.CfnJobDefinition.TmpfsProperty(
        container_path="containerPath",
        size=123,

        # the properties below are optional
        mount_options=["mountOptions"]
    )]
)

Attributes

devices

Any host devices to expose to the container.

This parameter maps to Devices in the Create a container section of the Docker Remote API and the --device option to docker run . .. epigraph:

This parameter isn't applicable to jobs that are running on Fargate resources and shouldn't be provided.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties-linuxparameters.html#cfn-batch-jobdefinition-containerproperties-linuxparameters-devices

Return type

Union[IResolvable, List[Union[IResolvable, DeviceProperty]], None]

init_process_enabled

If true, run an init process inside the container that forwards signals and reaps processes.

This parameter maps to the --init option to docker run . This parameter requires version 1.25 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log into your container instance and run the following command: sudo docker version | grep "Server API version"

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties-linuxparameters.html#cfn-batch-jobdefinition-containerproperties-linuxparameters-initprocessenabled

Return type

Union[bool, IResolvable, None]

max_swap

The total amount of swap memory (in MiB) a container can use.

This parameter is translated to the --memory-swap option to docker run where the value is the sum of the container memory plus the maxSwap value. For more information, see `--memory-swap details <https://docs.aws.amazon.com/https://docs.docker.com/config/containers/resource_constraints/#–memory-swap-details>`_ in the Docker documentation.

If a maxSwap value of 0 is specified, the container doesn’t use swap. Accepted values are 0 or any positive integer. If the maxSwap parameter is omitted, the container doesn’t use the swap configuration for the container instance it is running on. A maxSwap value must be set for the swappiness parameter to be used. .. epigraph:

This parameter isn't applicable to jobs that are running on Fargate resources and shouldn't be provided.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties-linuxparameters.html#cfn-batch-jobdefinition-containerproperties-linuxparameters-maxswap

Return type

Union[int, float, None]

shared_memory_size

The value for the size (in MiB) of the /dev/shm volume.

This parameter maps to the --shm-size option to docker run . .. epigraph:

This parameter isn't applicable to jobs that are running on Fargate resources and shouldn't be provided.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties-linuxparameters.html#cfn-batch-jobdefinition-containerproperties-linuxparameters-sharedmemorysize

Return type

Union[int, float, None]

swappiness

This allows you to tune a container’s memory swappiness behavior.

A swappiness value of 0 causes swapping not to happen unless absolutely necessary. A swappiness value of 100 causes pages to be swapped very aggressively. Accepted values are whole numbers between 0 and 100 . If the swappiness parameter isn’t specified, a default value of 60 is used. If a value isn’t specified for maxSwap , then this parameter is ignored. If maxSwap is set to 0, the container doesn’t use swap. This parameter maps to the --memory-swappiness option to docker run .

Consider the following when you use a per-container swap configuration.

  • Swap space must be enabled and allocated on the container instance for the containers to use.

The Amazon ECS optimized AMIs don’t have swap enabled by default. You must enable swap on the instance to use this feature. For more information, see Instance store swap volumes in the Amazon EC2 User Guide for Linux Instances or How do I allocate memory to work as swap space in an Amazon EC2 instance by using a swap file?

  • The swap space parameters are only supported for job definitions using EC2 resources.

  • If the maxSwap and swappiness parameters are omitted from a job definition, each container will have a default swappiness value of 60, and the total swap usage will be limited to two times the memory reservation of the container.

This parameter isn’t applicable to jobs that are running on Fargate resources and shouldn’t be provided.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties-linuxparameters.html#cfn-batch-jobdefinition-containerproperties-linuxparameters-swappiness

Return type

Union[int, float, None]

tmpfs

The container path, mount options, and size (in MiB) of the tmpfs mount.

This parameter maps to the --tmpfs option to docker run . .. epigraph:

This parameter isn't applicable to jobs that are running on Fargate resources and shouldn't be provided.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties-linuxparameters.html#cfn-batch-jobdefinition-containerproperties-linuxparameters-tmpfs

Return type

Union[IResolvable, List[Union[IResolvable, TmpfsProperty]], None]

LogConfigurationProperty

class CfnJobDefinition.LogConfigurationProperty(*, log_driver, options=None, secret_options=None)

Bases: object

Log configuration options to send to a custom log driver for the container.

Parameters
  • log_driver (str) – The log driver to use for the container. The valid values listed for this parameter are log drivers that the Amazon ECS container agent can communicate with by default. The supported log drivers are awslogs , fluentd , gelf , json-file , journald , logentries , syslog , and splunk . .. epigraph:: Jobs that are running on Fargate resources are restricted to the awslogs and splunk log drivers. - awslogs - Specifies the Amazon CloudWatch Logs logging driver. For more information, see Using the awslogs log driver in the AWS Batch User Guide and Amazon CloudWatch Logs logging driver in the Docker documentation. - fluentd - Specifies the Fluentd logging driver. For more information, including usage and options, see Fluentd logging driver in the Docker documentation. - gelf - Specifies the Graylog Extended Format (GELF) logging driver. For more information, including usage and options, see Graylog Extended Format logging driver in the Docker documentation. - journald - Specifies the journald logging driver. For more information, including usage and options, see Journald logging driver in the Docker documentation. - json-file - Specifies the JSON file logging driver. For more information, including usage and options, see JSON File logging driver in the Docker documentation. - splunk - Specifies the Splunk logging driver. For more information, including usage and options, see Splunk logging driver in the Docker documentation. - syslog - Specifies the syslog logging driver. For more information, including usage and options, see Syslog logging driver in the Docker documentation. .. epigraph:: If you have a custom driver that’s not listed earlier that you want to work with the Amazon ECS container agent, you can fork the Amazon ECS container agent project that’s available on GitHub and customize it to work with that driver. We encourage you to submit pull requests for changes that you want to have included. However, Amazon Web Services doesn’t currently support running modified copies of this software. This parameter requires version 1.18 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log into your container instance and run the following command: sudo docker version | grep "Server API version"

  • options (Optional[Any]) – The configuration options to send to the log driver. This parameter requires version 1.19 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log into your container instance and run the following command: sudo docker version | grep "Server API version"

  • secret_options (Union[IResolvable, Sequence[Union[IResolvable, SecretProperty, Dict[str, Any]]], None]) –

    The secrets to pass to the log configuration. For more information, see Specifying sensitive data in the AWS Batch User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties-logconfiguration.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_batch as batch

# options: Any

log_configuration_property = batch.CfnJobDefinition.LogConfigurationProperty(
    log_driver="logDriver",

    # the properties below are optional
    options=options,
    secret_options=[batch.CfnJobDefinition.SecretProperty(
        name="name",
        value_from="valueFrom"
    )]
)

Attributes

log_driver

The log driver to use for the container.

The valid values listed for this parameter are log drivers that the Amazon ECS container agent can communicate with by default.

The supported log drivers are awslogs , fluentd , gelf , json-file , journald , logentries , syslog , and splunk . .. epigraph:

Jobs that are running on Fargate resources are restricted to the ``awslogs`` and ``splunk`` log drivers.
  • awslogs - Specifies the Amazon CloudWatch Logs logging driver. For more information, see Using the awslogs log driver in the AWS Batch User Guide and Amazon CloudWatch Logs logging driver in the Docker documentation.

  • fluentd - Specifies the Fluentd logging driver. For more information, including usage and options, see Fluentd logging driver in the Docker documentation.

  • gelf - Specifies the Graylog Extended Format (GELF) logging driver. For more information, including usage and options, see Graylog Extended Format logging driver in the Docker documentation.

  • journald - Specifies the journald logging driver. For more information, including usage and options, see Journald logging driver in the Docker documentation.

  • json-file - Specifies the JSON file logging driver. For more information, including usage and options, see JSON File logging driver in the Docker documentation.

  • splunk - Specifies the Splunk logging driver. For more information, including usage and options, see Splunk logging driver in the Docker documentation.

  • syslog - Specifies the syslog logging driver. For more information, including usage and options, see Syslog logging driver in the Docker documentation.

If you have a custom driver that’s not listed earlier that you want to work with the Amazon ECS container agent, you can fork the Amazon ECS container agent project that’s available on GitHub and customize it to work with that driver. We encourage you to submit pull requests for changes that you want to have included. However, Amazon Web Services doesn’t currently support running modified copies of this software.

This parameter requires version 1.18 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log into your container instance and run the following command: sudo docker version | grep "Server API version"

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties-logconfiguration.html#cfn-batch-jobdefinition-containerproperties-logconfiguration-logdriver

Return type

str

options

The configuration options to send to the log driver.

This parameter requires version 1.19 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log into your container instance and run the following command: sudo docker version | grep "Server API version"

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties-logconfiguration.html#cfn-batch-jobdefinition-containerproperties-logconfiguration-options

Return type

Any

secret_options

The secrets to pass to the log configuration.

For more information, see Specifying sensitive data in the AWS Batch User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties-logconfiguration.html#cfn-batch-jobdefinition-containerproperties-logconfiguration-secretoptions

Return type

Union[IResolvable, List[Union[IResolvable, SecretProperty]], None]

MountPointsProperty

class CfnJobDefinition.MountPointsProperty(*, container_path=None, read_only=None, source_volume=None)

Bases: object

Details on a Docker volume mount point that’s used in a job’s container properties.

This parameter maps to Volumes in the Create a container section of the Docker Remote API and the --volume option to docker run.

Parameters
  • container_path (Optional[str]) – The path on the container where the host volume is mounted.

  • read_only (Union[bool, IResolvable, None]) – If this value is true , the container has read-only access to the volume. Otherwise, the container can write to the volume. The default value is false .

  • source_volume (Optional[str]) – The name of the volume to mount.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-mountpoints.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_batch as batch

mount_points_property = batch.CfnJobDefinition.MountPointsProperty(
    container_path="containerPath",
    read_only=False,
    source_volume="sourceVolume"
)

Attributes

container_path

The path on the container where the host volume is mounted.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-mountpoints.html#cfn-batch-jobdefinition-mountpoints-containerpath

Return type

Optional[str]

read_only

If this value is true , the container has read-only access to the volume.

Otherwise, the container can write to the volume. The default value is false .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-mountpoints.html#cfn-batch-jobdefinition-mountpoints-readonly

Return type

Union[bool, IResolvable, None]

source_volume

The name of the volume to mount.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-mountpoints.html#cfn-batch-jobdefinition-mountpoints-sourcevolume

Return type

Optional[str]

NetworkConfigurationProperty

class CfnJobDefinition.NetworkConfigurationProperty(*, assign_public_ip=None)

Bases: object

The network configuration for jobs that are running on Fargate resources.

Jobs that are running on EC2 resources must not specify this parameter.

Parameters

assign_public_ip (Optional[str]) – Indicates whether the job should have a public IP address. For a job that is running on Fargate resources in a private subnet to send outbound traffic to the internet (for example, to pull container images), the private subnet requires a NAT gateway be attached to route requests to the internet. For more information, see Amazon ECS task networking . The default value is “DISABLED”.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties-networkconfiguration.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_batch as batch

network_configuration_property = batch.CfnJobDefinition.NetworkConfigurationProperty(
    assign_public_ip="assignPublicIp"
)

Attributes

assign_public_ip

Indicates whether the job should have a public IP address.

For a job that is running on Fargate resources in a private subnet to send outbound traffic to the internet (for example, to pull container images), the private subnet requires a NAT gateway be attached to route requests to the internet. For more information, see Amazon ECS task networking . The default value is “DISABLED”.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties-networkconfiguration.html#cfn-batch-jobdefinition-containerproperties-networkconfiguration-assignpublicip

Return type

Optional[str]

NodePropertiesProperty

class CfnJobDefinition.NodePropertiesProperty(*, main_node, node_range_properties, num_nodes)

Bases: object

An object representing the node properties of a multi-node parallel job.

Parameters
  • main_node (Union[int, float]) – Specifies the node index for the main node of a multi-node parallel job. This node index value must be fewer than the number of nodes.

  • node_range_properties (Union[IResolvable, Sequence[Union[IResolvable, NodeRangePropertyProperty, Dict[str, Any]]]]) – A list of node ranges and their properties associated with a multi-node parallel job.

  • num_nodes (Union[int, float]) – The number of nodes associated with a multi-node parallel job.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-nodeproperties.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_batch as batch

# options: Any

node_properties_property = batch.CfnJobDefinition.NodePropertiesProperty(
    main_node=123,
    node_range_properties=[batch.CfnJobDefinition.NodeRangePropertyProperty(
        target_nodes="targetNodes",

        # the properties below are optional
        container=batch.CfnJobDefinition.ContainerPropertiesProperty(
            image="image",

            # the properties below are optional
            command=["command"],
            environment=[batch.CfnJobDefinition.EnvironmentProperty(
                name="name",
                value="value"
            )],
            execution_role_arn="executionRoleArn",
            fargate_platform_configuration=batch.CfnJobDefinition.FargatePlatformConfigurationProperty(
                platform_version="platformVersion"
            ),
            instance_type="instanceType",
            job_role_arn="jobRoleArn",
            linux_parameters=batch.CfnJobDefinition.LinuxParametersProperty(
                devices=[batch.CfnJobDefinition.DeviceProperty(
                    container_path="containerPath",
                    host_path="hostPath",
                    permissions=["permissions"]
                )],
                init_process_enabled=False,
                max_swap=123,
                shared_memory_size=123,
                swappiness=123,
                tmpfs=[batch.CfnJobDefinition.TmpfsProperty(
                    container_path="containerPath",
                    size=123,

                    # the properties below are optional
                    mount_options=["mountOptions"]
                )]
            ),
            log_configuration=batch.CfnJobDefinition.LogConfigurationProperty(
                log_driver="logDriver",

                # the properties below are optional
                options=options,
                secret_options=[batch.CfnJobDefinition.SecretProperty(
                    name="name",
                    value_from="valueFrom"
                )]
            ),
            memory=123,
            mount_points=[batch.CfnJobDefinition.MountPointsProperty(
                container_path="containerPath",
                read_only=False,
                source_volume="sourceVolume"
            )],
            network_configuration=batch.CfnJobDefinition.NetworkConfigurationProperty(
                assign_public_ip="assignPublicIp"
            ),
            privileged=False,
            readonly_root_filesystem=False,
            resource_requirements=[batch.CfnJobDefinition.ResourceRequirementProperty(
                type="type",
                value="value"
            )],
            secrets=[batch.CfnJobDefinition.SecretProperty(
                name="name",
                value_from="valueFrom"
            )],
            ulimits=[batch.CfnJobDefinition.UlimitProperty(
                hard_limit=123,
                name="name",
                soft_limit=123
            )],
            user="user",
            vcpus=123,
            volumes=[batch.CfnJobDefinition.VolumesProperty(
                efs_volume_configuration=batch.CfnJobDefinition.EfsVolumeConfigurationProperty(
                    file_system_id="fileSystemId",

                    # the properties below are optional
                    authorization_config=batch.CfnJobDefinition.AuthorizationConfigProperty(
                        access_point_id="accessPointId",
                        iam="iam"
                    ),
                    root_directory="rootDirectory",
                    transit_encryption="transitEncryption",
                    transit_encryption_port=123
                ),
                host=batch.CfnJobDefinition.VolumesHostProperty(
                    source_path="sourcePath"
                ),
                name="name"
            )]
        )
    )],
    num_nodes=123
)

Attributes

main_node

Specifies the node index for the main node of a multi-node parallel job.

This node index value must be fewer than the number of nodes.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-nodeproperties.html#cfn-batch-jobdefinition-nodeproperties-mainnode

Return type

Union[int, float]

node_range_properties

A list of node ranges and their properties associated with a multi-node parallel job.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-nodeproperties.html#cfn-batch-jobdefinition-nodeproperties-noderangeproperties

Return type

Union[IResolvable, List[Union[IResolvable, NodeRangePropertyProperty]]]

num_nodes

The number of nodes associated with a multi-node parallel job.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-nodeproperties.html#cfn-batch-jobdefinition-nodeproperties-numnodes

Return type

Union[int, float]

NodeRangePropertyProperty

class CfnJobDefinition.NodeRangePropertyProperty(*, target_nodes, container=None)

Bases: object

An object representing the properties of the node range for a multi-node parallel job.

Parameters
  • target_nodes (str) – The range of nodes, using node index values. A range of 0:3 indicates nodes with index values of 0 through 3 . If the starting range value is omitted ( :n ), then 0 is used to start the range. If the ending range value is omitted ( n: ), then the highest possible node index is used to end the range. Your accumulative node ranges must account for all nodes ( 0:n ). You can nest node ranges, for example 0:10 and 4:5 , in which case the 4:5 range properties override the 0:10 properties.

  • container (Union[IResolvable, ContainerPropertiesProperty, Dict[str, Any], None]) – The container details for the node range.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-noderangeproperty.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_batch as batch

# options: Any

node_range_property_property = batch.CfnJobDefinition.NodeRangePropertyProperty(
    target_nodes="targetNodes",

    # the properties below are optional
    container=batch.CfnJobDefinition.ContainerPropertiesProperty(
        image="image",

        # the properties below are optional
        command=["command"],
        environment=[batch.CfnJobDefinition.EnvironmentProperty(
            name="name",
            value="value"
        )],
        execution_role_arn="executionRoleArn",
        fargate_platform_configuration=batch.CfnJobDefinition.FargatePlatformConfigurationProperty(
            platform_version="platformVersion"
        ),
        instance_type="instanceType",
        job_role_arn="jobRoleArn",
        linux_parameters=batch.CfnJobDefinition.LinuxParametersProperty(
            devices=[batch.CfnJobDefinition.DeviceProperty(
                container_path="containerPath",
                host_path="hostPath",
                permissions=["permissions"]
            )],
            init_process_enabled=False,
            max_swap=123,
            shared_memory_size=123,
            swappiness=123,
            tmpfs=[batch.CfnJobDefinition.TmpfsProperty(
                container_path="containerPath",
                size=123,

                # the properties below are optional
                mount_options=["mountOptions"]
            )]
        ),
        log_configuration=batch.CfnJobDefinition.LogConfigurationProperty(
            log_driver="logDriver",

            # the properties below are optional
            options=options,
            secret_options=[batch.CfnJobDefinition.SecretProperty(
                name="name",
                value_from="valueFrom"
            )]
        ),
        memory=123,
        mount_points=[batch.CfnJobDefinition.MountPointsProperty(
            container_path="containerPath",
            read_only=False,
            source_volume="sourceVolume"
        )],
        network_configuration=batch.CfnJobDefinition.NetworkConfigurationProperty(
            assign_public_ip="assignPublicIp"
        ),
        privileged=False,
        readonly_root_filesystem=False,
        resource_requirements=[batch.CfnJobDefinition.ResourceRequirementProperty(
            type="type",
            value="value"
        )],
        secrets=[batch.CfnJobDefinition.SecretProperty(
            name="name",
            value_from="valueFrom"
        )],
        ulimits=[batch.CfnJobDefinition.UlimitProperty(
            hard_limit=123,
            name="name",
            soft_limit=123
        )],
        user="user",
        vcpus=123,
        volumes=[batch.CfnJobDefinition.VolumesProperty(
            efs_volume_configuration=batch.CfnJobDefinition.EfsVolumeConfigurationProperty(
                file_system_id="fileSystemId",

                # the properties below are optional
                authorization_config=batch.CfnJobDefinition.AuthorizationConfigProperty(
                    access_point_id="accessPointId",
                    iam="iam"
                ),
                root_directory="rootDirectory",
                transit_encryption="transitEncryption",
                transit_encryption_port=123
            ),
            host=batch.CfnJobDefinition.VolumesHostProperty(
                source_path="sourcePath"
            ),
            name="name"
        )]
    )
)

Attributes

container

The container details for the node range.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-noderangeproperty.html#cfn-batch-jobdefinition-noderangeproperty-container

Return type

Union[IResolvable, ContainerPropertiesProperty, None]

target_nodes

The range of nodes, using node index values.

A range of 0:3 indicates nodes with index values of 0 through 3 . If the starting range value is omitted ( :n ), then 0 is used to start the range. If the ending range value is omitted ( n: ), then the highest possible node index is used to end the range. Your accumulative node ranges must account for all nodes ( 0:n ). You can nest node ranges, for example 0:10 and 4:5 , in which case the 4:5 range properties override the 0:10 properties.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-noderangeproperty.html#cfn-batch-jobdefinition-noderangeproperty-targetnodes

Return type

str

ResourceRequirementProperty

class CfnJobDefinition.ResourceRequirementProperty(*, type=None, value=None)

Bases: object

The type and amount of a resource to assign to a container.

The supported resources include GPU , MEMORY , and VCPU .

Parameters
  • type (Optional[str]) – The type of resource to assign to a container. The supported resources include GPU , MEMORY , and VCPU .

  • value (Optional[str]) –

    The quantity of the specified resource to reserve for the container. The values vary based on the type specified. - type=”GPU” - The number of physical GPUs to reserve for the container. The number of GPUs reserved for all containers in a job shouldn’t exceed the number of available GPUs on the compute resource that the job is launched on. .. epigraph:: GPUs are not available for jobs that are running on Fargate resources. - type=”MEMORY” - The memory hard limit (in MiB) present to the container. This parameter is supported for jobs that are running on EC2 resources. If your container attempts to exceed the memory specified, the container is terminated. This parameter maps to Memory in the Create a container section of the Docker Remote API and the --memory option to docker run . You must specify at least 4 MiB of memory for a job. This is required but can be specified in several places for multi-node parallel (MNP) jobs. It must be specified for each node at least once. This parameter maps to Memory in the Create a container section of the Docker Remote API and the --memory option to docker run . .. epigraph:: If you’re trying to maximize your resource utilization by providing your jobs as much memory as possible for a particular instance type, see Memory management in the AWS Batch User Guide . For jobs that are running on Fargate resources, then value is the hard limit (in MiB), and must match one of the supported values and the VCPU values must be one of the values supported for that memory value. - value = 512 - VCPU = 0.25 - value = 1024 - VCPU = 0.25 or 0.5 - value = 2048 - VCPU = 0.25, 0.5, or 1 - value = 3072 - VCPU = 0.5, or 1 - value = 4096 - VCPU = 0.5, 1, or 2 - value = 5120, 6144, or 7168 - VCPU = 1 or 2 - value = 8192 - VCPU = 1, 2, or 4 - value = 9216, 10240, 11264, 12288, 13312, 14336, 15360, or 16384 - VCPU = 2 or 4 - value = 17408, 18432, 19456, 20480, 21504, 22528, 23552, 24576, 25600, 26624, 27648, 28672, 29696, or 30720 - VCPU = 4 - type=”VCPU” - The number of vCPUs reserved for the container. This parameter maps to CpuShares in the Create a container section of the Docker Remote API and the --cpu-shares option to docker run . Each vCPU is equivalent to 1,024 CPU shares. For EC2 resources, you must specify at least one vCPU. This is required but can be specified in several places; it must be specified for each node at least once. For jobs that are running on Fargate resources, then value must match one of the supported values and the MEMORY values must be one of the values supported for that VCPU value. The supported values are 0.25, 0.5, 1, 2, and 4 - value = 0.25 - MEMORY = 512, 1024, or 2048 - value = 0.5 - MEMORY = 1024, 2048, 3072, or 4096 - value = 1 - MEMORY = 2048, 3072, 4096, 5120, 6144, 7168, or 8192 - value = 2 - MEMORY = 4096, 5120, 6144, 7168, 8192, 9216, 10240, 11264, 12288, 13312, 14336, 15360, or 16384 - value = 4 - MEMORY = 8192, 9216, 10240, 11264, 12288, 13312, 14336, 15360, 16384, 17408, 18432, 19456, 20480, 21504, 22528, 23552, 24576, 25600, 26624, 27648, 28672, 29696, or 30720

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-resourcerequirement.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_batch as batch

resource_requirement_property = batch.CfnJobDefinition.ResourceRequirementProperty(
    type="type",
    value="value"
)

Attributes

type

The type of resource to assign to a container.

The supported resources include GPU , MEMORY , and VCPU .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-resourcerequirement.html#cfn-batch-jobdefinition-resourcerequirement-type

Return type

Optional[str]

value

The quantity of the specified resource to reserve for the container. The values vary based on the type specified.

  • type=”GPU” - The number of physical GPUs to reserve for the container. The number of GPUs reserved for all containers in a job shouldn’t exceed the number of available GPUs on the compute resource that the job is launched on.

GPUs are not available for jobs that are running on Fargate resources.

  • type=”MEMORY” - The memory hard limit (in MiB) present to the container. This parameter is supported for jobs that are running on EC2 resources. If your container attempts to exceed the memory specified, the container is terminated. This parameter maps to Memory in the Create a container section of the Docker Remote API and the --memory option to docker run . You must specify at least 4 MiB of memory for a job. This is required but can be specified in several places for multi-node parallel (MNP) jobs. It must be specified for each node at least once. This parameter maps to Memory in the Create a container section of the Docker Remote API and the --memory option to docker run .

If you’re trying to maximize your resource utilization by providing your jobs as much memory as possible for a particular instance type, see Memory management in the AWS Batch User Guide .

For jobs that are running on Fargate resources, then value is the hard limit (in MiB), and must match one of the supported values and the VCPU values must be one of the values supported for that memory value.

  • value = 512 - VCPU = 0.25

  • value = 1024 - VCPU = 0.25 or 0.5

  • value = 2048 - VCPU = 0.25, 0.5, or 1

  • value = 3072 - VCPU = 0.5, or 1

  • value = 4096 - VCPU = 0.5, 1, or 2

  • value = 5120, 6144, or 7168 - VCPU = 1 or 2

  • value = 8192 - VCPU = 1, 2, or 4

  • value = 9216, 10240, 11264, 12288, 13312, 14336, 15360, or 16384 - VCPU = 2 or 4

  • value = 17408, 18432, 19456, 20480, 21504, 22528, 23552, 24576, 25600, 26624, 27648, 28672, 29696, or 30720 - VCPU = 4

  • type=”VCPU” - The number of vCPUs reserved for the container. This parameter maps to CpuShares in the Create a container section of the Docker Remote API and the --cpu-shares option to docker run . Each vCPU is equivalent to 1,024 CPU shares. For EC2 resources, you must specify at least one vCPU. This is required but can be specified in several places; it must be specified for each node at least once.

For jobs that are running on Fargate resources, then value must match one of the supported values and the MEMORY values must be one of the values supported for that VCPU value. The supported values are 0.25, 0.5, 1, 2, and 4

  • value = 0.25 - MEMORY = 512, 1024, or 2048

  • value = 0.5 - MEMORY = 1024, 2048, 3072, or 4096

  • value = 1 - MEMORY = 2048, 3072, 4096, 5120, 6144, 7168, or 8192

  • value = 2 - MEMORY = 4096, 5120, 6144, 7168, 8192, 9216, 10240, 11264, 12288, 13312, 14336, 15360, or 16384

  • value = 4 - MEMORY = 8192, 9216, 10240, 11264, 12288, 13312, 14336, 15360, 16384, 17408, 18432, 19456, 20480, 21504, 22528, 23552, 24576, 25600, 26624, 27648, 28672, 29696, or 30720

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-resourcerequirement.html#cfn-batch-jobdefinition-resourcerequirement-value

Return type

Optional[str]

RetryStrategyProperty

class CfnJobDefinition.RetryStrategyProperty(*, attempts=None, evaluate_on_exit=None)

Bases: object

The retry strategy associated with a job.

For more information, see Automated job retries in the AWS Batch User Guide .

Parameters
  • attempts (Union[int, float, None]) – The number of times to move a job to the RUNNABLE status. You can 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.

  • evaluate_on_exit (Union[IResolvable, Sequence[Union[IResolvable, EvaluateOnExitProperty, Dict[str, Any]]], None]) – Array of up to 5 objects that specify conditions under which the job should be retried or failed. If this parameter is specified, then the attempts parameter must also be specified.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-retrystrategy.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_batch as batch

retry_strategy_property = batch.CfnJobDefinition.RetryStrategyProperty(
    attempts=123,
    evaluate_on_exit=[batch.CfnJobDefinition.EvaluateOnExitProperty(
        action="action",

        # the properties below are optional
        on_exit_code="onExitCode",
        on_reason="onReason",
        on_status_reason="onStatusReason"
    )]
)

Attributes

attempts

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

You can 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.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-retrystrategy.html#cfn-batch-jobdefinition-retrystrategy-attempts

Return type

Union[int, float, None]

evaluate_on_exit

Array of up to 5 objects that specify conditions under which the job should be retried or failed.

If this parameter is specified, then the attempts parameter must also be specified.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-retrystrategy.html#cfn-batch-jobdefinition-retrystrategy-evaluateonexit

Return type

Union[IResolvable, List[Union[IResolvable, EvaluateOnExitProperty]], None]

SecretProperty

class CfnJobDefinition.SecretProperty(*, name, value_from)

Bases: object

An object representing the secret to expose to your container.

Secrets can be exposed to a container in the following ways:

  • To inject sensitive data into your containers as environment variables, use the secrets container definition parameter.

  • To reference sensitive information in the log configuration of a container, use the secretOptions container definition parameter.

For more information, see Specifying sensitive data in the AWS Batch User Guide .

Parameters
  • name (str) – The name of the secret.

  • value_from (str) – The secret to expose to the container. The supported values are either the full ARN of the AWS Secrets Manager secret or the full ARN of the parameter in the AWS Systems Manager Parameter Store. .. epigraph:: If the AWS Systems Manager Parameter Store parameter exists in the same Region as the job you’re launching, then you can use either the full ARN or name of the parameter. If the parameter exists in a different Region, then the full ARN must be specified.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-secret.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_batch as batch

secret_property = batch.CfnJobDefinition.SecretProperty(
    name="name",
    value_from="valueFrom"
)

Attributes

name

The name of the secret.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-secret.html#cfn-batch-jobdefinition-secret-name

Return type

str

value_from

The secret to expose to the container.

The supported values are either the full ARN of the AWS Secrets Manager secret or the full ARN of the parameter in the AWS Systems Manager Parameter Store. .. epigraph:

If the AWS Systems Manager Parameter Store parameter exists in the same Region as the job you're launching, then you can use either the full ARN or name of the parameter. If the parameter exists in a different Region, then the full ARN must be specified.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-secret.html#cfn-batch-jobdefinition-secret-valuefrom

Return type

str

TimeoutProperty

class CfnJobDefinition.TimeoutProperty(*, attempt_duration_seconds=None)

Bases: object

An object representing a job timeout configuration.

Parameters

attempt_duration_seconds (Union[int, float, None]) – The time duration in seconds (measured from the job attempt’s startedAt timestamp) after which AWS Batch terminates your jobs if they have not finished. The minimum value for the timeout is 60 seconds.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-timeout.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_batch as batch

timeout_property = batch.CfnJobDefinition.TimeoutProperty(
    attempt_duration_seconds=123
)

Attributes

attempt_duration_seconds

The time duration in seconds (measured from the job attempt’s startedAt timestamp) after which AWS Batch terminates your jobs if they have not finished.

The minimum value for the timeout is 60 seconds.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-timeout.html#cfn-batch-jobdefinition-timeout-attemptdurationseconds

Return type

Union[int, float, None]

TmpfsProperty

class CfnJobDefinition.TmpfsProperty(*, container_path, size, mount_options=None)

Bases: object

The container path, mount options, and size of the tmpfs mount.

This object isn’t applicable to jobs that are running on Fargate resources.

Parameters
  • container_path (str) – The absolute file path in the container where the tmpfs volume is mounted.

  • size (Union[int, float]) – The size (in MiB) of the tmpfs volume.

  • mount_options (Optional[Sequence[str]]) – The list of tmpfs volume mount options. Valid values: ” defaults ” | ” ro ” | ” rw ” | ” suid ” | ” nosuid ” | ” dev ” | ” nodev ” | ” exec ” | ” noexec ” | ” sync ” | ” async ” | ” dirsync ” | ” remount ” | ” mand ” | ” nomand ” | ” atime ” | ” noatime ” | ” diratime ” | ” nodiratime ” | ” bind ” | ” rbind" | "unbindable" | "runbindable" | "private" | "rprivate" | "shared" | "rshared" | "slave" | "rslave" | "relatime ” | ” norelatime ” | ” strictatime ” | ” nostrictatime ” | ” mode ” | ” uid ” | ” gid ” | ” nr_inodes ” | ” nr_blocks ” | ” mpol

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-tmpfs.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_batch as batch

tmpfs_property = batch.CfnJobDefinition.TmpfsProperty(
    container_path="containerPath",
    size=123,

    # the properties below are optional
    mount_options=["mountOptions"]
)

Attributes

container_path

The absolute file path in the container where the tmpfs volume is mounted.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-tmpfs.html#cfn-batch-jobdefinition-tmpfs-containerpath

Return type

str

mount_options

The list of tmpfs volume mount options.

Valid values: ” defaults ” | ” ro ” | ” rw ” | ” suid ” | ” nosuid ” | ” dev ” | ” nodev ” | ” exec ” | ” noexec ” | ” sync ” | ” async ” | ” dirsync ” | ” remount ” | ” mand ” | ” nomand ” | ” atime ” | ” noatime ” | ” diratime ” | ” nodiratime ” | ” bind ” | ” rbind" | "unbindable" | "runbindable" | "private" | "rprivate" | "shared" | "rshared" | "slave" | "rslave" | "relatime ” | ” norelatime ” | ” strictatime ” | ” nostrictatime ” | ” mode ” | ” uid ” | ” gid ” | ” nr_inodes ” | ” nr_blocks ” | ” mpol

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-tmpfs.html#cfn-batch-jobdefinition-tmpfs-mountoptions

Return type

Optional[List[str]]

size

The size (in MiB) of the tmpfs volume.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-tmpfs.html#cfn-batch-jobdefinition-tmpfs-size

Return type

Union[int, float]

UlimitProperty

class CfnJobDefinition.UlimitProperty(*, hard_limit, name, soft_limit)

Bases: object

The ulimit settings to pass to the container.

This object isn’t applicable to jobs that are running on Fargate resources.

Parameters
  • hard_limit (Union[int, float]) – The hard limit for the ulimit type.

  • name (str) – The type of the ulimit .

  • soft_limit (Union[int, float]) – The soft limit for the ulimit type.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-ulimit.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_batch as batch

ulimit_property = batch.CfnJobDefinition.UlimitProperty(
    hard_limit=123,
    name="name",
    soft_limit=123
)

Attributes

hard_limit

The hard limit for the ulimit type.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-ulimit.html#cfn-batch-jobdefinition-ulimit-hardlimit

Return type

Union[int, float]

name

The type of the ulimit .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-ulimit.html#cfn-batch-jobdefinition-ulimit-name

Return type

str

soft_limit

The soft limit for the ulimit type.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-ulimit.html#cfn-batch-jobdefinition-ulimit-softlimit

Return type

Union[int, float]

VolumesHostProperty

class CfnJobDefinition.VolumesHostProperty(*, source_path=None)

Bases: object

Determine whether your data volume persists on the host container instance and where it is stored.

If this parameter is empty, then the Docker daemon assigns a host path for your data volume, but the data isn’t guaranteed to persist after the containers associated with it stop running.

Parameters

source_path (Optional[str]) – The path on the host container instance that’s presented to the container. If this parameter is empty, then the Docker daemon has assigned a host path for you. If this parameter contains a file location, then the data volume persists at the specified location on the host container instance until you delete it manually. If the source path location doesn’t exist on the host container instance, the Docker daemon creates it. If the location does exist, the contents of the source path folder are exported. .. epigraph:: This parameter isn’t applicable to jobs that run on Fargate resources and shouldn’t be provided.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-volumeshost.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_batch as batch

volumes_host_property = batch.CfnJobDefinition.VolumesHostProperty(
    source_path="sourcePath"
)

Attributes

source_path

The path on the host container instance that’s presented to the container.

If this parameter is empty, then the Docker daemon has assigned a host path for you. If this parameter contains a file location, then the data volume persists at the specified location on the host container instance until you delete it manually. If the source path location doesn’t exist on the host container instance, the Docker daemon creates it. If the location does exist, the contents of the source path folder are exported. .. epigraph:

This parameter isn't applicable to jobs that run on Fargate resources and shouldn't be provided.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-volumeshost.html#cfn-batch-jobdefinition-volumeshost-sourcepath

Return type

Optional[str]

VolumesProperty

class CfnJobDefinition.VolumesProperty(*, efs_volume_configuration=None, host=None, name=None)

Bases: object

A list of volumes associated with the job.

Parameters
  • efs_volume_configuration (Union[IResolvable, EfsVolumeConfigurationProperty, Dict[str, Any], None]) –

    This is used when you’re using an Amazon Elastic File System file system for job storage. For more information, see Amazon EFS Volumes in the AWS Batch User Guide .

  • host (Union[IResolvable, VolumesHostProperty, Dict[str, Any], None]) – The contents of the host parameter determine whether your data volume persists on the host container instance and where it is stored. If the host parameter is empty, then the Docker daemon assigns a host path for your data volume. However, the data isn’t guaranteed to persist after the containers associated with it stop running. .. epigraph:: This parameter isn’t applicable to jobs that are running on Fargate resources and shouldn’t be provided.

  • name (Optional[str]) – The name of the volume. It can be up to 255 letters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_). This name is referenced in the sourceVolume parameter of container definition mountPoints .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-volumes.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_batch as batch

volumes_property = batch.CfnJobDefinition.VolumesProperty(
    efs_volume_configuration=batch.CfnJobDefinition.EfsVolumeConfigurationProperty(
        file_system_id="fileSystemId",

        # the properties below are optional
        authorization_config=batch.CfnJobDefinition.AuthorizationConfigProperty(
            access_point_id="accessPointId",
            iam="iam"
        ),
        root_directory="rootDirectory",
        transit_encryption="transitEncryption",
        transit_encryption_port=123
    ),
    host=batch.CfnJobDefinition.VolumesHostProperty(
        source_path="sourcePath"
    ),
    name="name"
)

Attributes

efs_volume_configuration

This is used when you’re using an Amazon Elastic File System file system for job storage.

For more information, see Amazon EFS Volumes in the AWS Batch User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-volumes.html#cfn-batch-jobdefinition-volumes-efsvolumeconfiguration

Return type

Union[IResolvable, EfsVolumeConfigurationProperty, None]

host

The contents of the host parameter determine whether your data volume persists on the host container instance and where it is stored.

If the host parameter is empty, then the Docker daemon assigns a host path for your data volume. However, the data isn’t guaranteed to persist after the containers associated with it stop running. .. epigraph:

This parameter isn't applicable to jobs that are running on Fargate resources and shouldn't be provided.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-volumes.html#cfn-batch-jobdefinition-volumes-host

Return type

Union[IResolvable, VolumesHostProperty, None]

name

The name of the volume.

It can be up to 255 letters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_). This name is referenced in the sourceVolume parameter of container definition mountPoints .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-volumes.html#cfn-batch-jobdefinition-volumes-name

Return type

Optional[str]