CfnJobDefinition

class aws_cdk.aws_batch.CfnJobDefinition(scope, id, *, type, container_properties=None, ecs_properties=None, eks_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

The AWS::Batch::JobDefinition resource specifies the parameters for an AWS Batch job definition.

For more information, see Job Definitions in the ** .

See:

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

CloudformationResource:

AWS::Batch::JobDefinition

ExampleMetadata:

fixture=_generated

Example:

:type scope: :py:class:`~constructs.Construct`
:param scope: Scope in which this resource is defined.
:type id: :py:class:`str`
:param id: Construct identifier for this resource (unique in its scope).
:type type: :py:class:`str`
:param type: The type of job definition. For more information about multi-node parallel jobs, see `Creating a multi-node parallel job definition <https://docs.aws.amazon.com/batch/latest/userguide/multi-node-job-def.html>`_ in the *AWS Batch User Guide* . - If the value is ``container`` , then one of the following is required: ``containerProperties`` , ``ecsProperties`` , or ``eksProperties`` . - If the value is ``multinode`` , then ``nodeProperties`` is required. .. epigraph:: If the job is run on Fargate resources, then ``multinode`` isn't supported.
:type container_properties: :py:data:`~typing.Union`\[:py:class:`~aws_cdk.IResolvable`, :py:class:`~aws_cdk.aws_batch.CfnJobDefinition.ContainerPropertiesProperty`, :py:class:`~typing.Dict`\[:py:class:`str`, :py:data:`~typing.Any`], :py:obj:`None`]
:param container_properties: An object with properties specific to Amazon ECS-based jobs. When ``containerProperties`` is used in the job definition, it can't be used in addition to ``eksProperties`` , ``ecsProperties`` , or ``nodeProperties`` .
:type ecs_properties: :py:data:`~typing.Union`\[:py:class:`~aws_cdk.IResolvable`, :py:class:`~aws_cdk.aws_batch.CfnJobDefinition.EcsPropertiesProperty`, :py:class:`~typing.Dict`\[:py:class:`str`, :py:data:`~typing.Any`], :py:obj:`None`]
:param ecs_properties: An object that contains the properties for the Amazon ECS resources of a job.When ``ecsProperties`` is used in the job definition, it can't be used in addition to ``containerProperties`` , ``eksProperties`` , or ``nodeProperties`` .
:type eks_properties: :py:data:`~typing.Union`\[:py:class:`~aws_cdk.IResolvable`, :py:class:`~aws_cdk.aws_batch.CfnJobDefinition.EksPropertiesProperty`, :py:class:`~typing.Dict`\[:py:class:`str`, :py:data:`~typing.Any`], :py:obj:`None`]
:param eks_properties: An object with properties that are specific to Amazon EKS-based jobs. When ``eksProperties`` is used in the job definition, it can't be used in addition to ``containerProperties`` , ``ecsProperties`` , or ``nodeProperties`` .
:type job_definition_name: :py:data:`~typing.Optional`\[:py:class:`str`]
:param job_definition_name: The name of the job definition.
:type node_properties: :py:data:`~typing.Union`\[:py:class:`~aws_cdk.IResolvable`, :py:class:`~aws_cdk.aws_batch.CfnJobDefinition.NodePropertiesProperty`, :py:class:`~typing.Dict`\[:py:class:`str`, :py:data:`~typing.Any`], :py:obj:`None`]
:param node_properties: An object with properties that are specific to multi-node parallel jobs. When ``nodeProperties`` is used in the job definition, it can't be used in addition to ``containerProperties`` , ``ecsProperties`` , or ``eksProperties`` . .. epigraph:: If the job runs on Fargate resources, don't specify ``nodeProperties`` . Use ``containerProperties`` instead.
:type parameters: :py:data:`~typing.Optional`\[:py:data:`~typing.Any`]
:param 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 <https://docs.aws.amazon.com/batch/latest/userguide/job_definition_parameters.html>`_ in the *AWS Batch User Guide* .
:type platform_capabilities: :py:data:`~typing.Optional`\[:py:class:`~typing.Sequence`\[:py:class:`str`]]
:param 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`` .
:type propagate_tags: :py:data:`~typing.Union`\[:py:class:`bool`, :py:class:`~aws_cdk.IResolvable`, :py:obj:`None`]
:param 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 when the tasks are created. 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.
:type retry_strategy: :py:data:`~typing.Union`\[:py:class:`~aws_cdk.IResolvable`, :py:class:`~aws_cdk.aws_batch.CfnJobDefinition.RetryStrategyProperty`, :py:class:`~typing.Dict`\[:py:class:`str`, :py:data:`~typing.Any`], :py:obj:`None`]
:param retry_strategy: The retry strategy to use for failed jobs that are submitted with this job definition.
:type scheduling_priority: :py:data:`~typing.Union`\[:py:class:`int`, :py:class:`float`, :py:obj:`None`]
:param 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.
:type tags: :py:data:`~typing.Optional`\[:py:data:`~typing.Any`]
:param tags: The tags that are applied to the job definition.
:type timeout: :py:data:`~typing.Union`\[:py:class:`~aws_cdk.IResolvable`, :py:class:`~aws_cdk.aws_batch.CfnJobDefinition.TimeoutProperty`, :py:class:`~typing.Dict`\[:py:class:`str`, :py:data:`~typing.Any`], :py:obj:`None`]
:param timeout: The timeout time for jobs that are submitted with this job definition. After the amount of time you specify passes, AWS Batch terminates your jobs if they aren'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_dependency(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_depends_on(target)

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

Parameters:

target (CfnResource) –

Deprecated:

use addDependency

Stability:

deprecated

Return type:

None

add_metadata(key, value)

Add a value to the CloudFormation Resource Metadata.

Parameters:
  • key (str) –

  • value (Any) –

See:

Return type:

None

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.

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 intermediate 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). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT). A list of resources that support this policy can be found in the following link:

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 resource, please consult that specific resource’s documentation.

See:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options

Return type:

None

get_att(attribute_name, type_hint=None)

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.

  • type_hint (Optional[ResolutionTypeHint]) –

Return type:

Reference

get_metadata(key)

Retrieve a value value from the CloudFormation Resource Metadata.

Parameters:

key (str) –

See:

Return type:

Any

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.

inspect(inspector)

Examines the CloudFormation resource and discloses attributes.

Parameters:

inspector (TreeInspector) – tree inspector to collect and process attributes.

Return type:

None

obtain_dependencies()

Retrieves an array of resources this resource depends on.

This assembles dependencies on resources across stacks (including nested stacks) automatically.

Return type:

List[Union[Stack, CfnResource]]

obtain_resource_dependencies()

Get a shallow copy of dependencies between this resource and other resources in the same stack.

Return type:

List[CfnResource]

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

remove_dependency(target)

Indicates that this resource no longer depends on another resource.

This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.

Parameters:

target (CfnResource) –

Return type:

None

replace_dependency(target, new_target)

Replaces one dependency with another.

Parameters:
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'
attr_id

Id

Type:

cloudformationAttribute

cfn_options

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

cfn_resource_type

AWS resource type.

container_properties

An object with properties specific to Amazon ECS-based jobs.

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.

ecs_properties

An object that contains the properties for the Amazon ECS resources of a job.When ecsProperties is used in the job definition, it can’t be used in addition to containerProperties , eksProperties , or nodeProperties .

eks_properties

An object with properties that are specific to Amazon EKS-based jobs.

job_definition_name

The name of the job definition.

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).

Returns:

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

node

The tree node.

node_properties

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

parameters

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

platform_capabilities

The platform capabilities required by the job definition.

propagate_tags

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

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 }).

retry_strategy

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

scheduling_priority

The scheduling priority of the job definition.

stack

The stack in which this element is defined.

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

tags

Tag Manager which manages the tags for this resource.

tags_raw

The tags that are applied to the job definition.

timeout

The timeout time for jobs that are submitted with this job definition.

type

The type of job definition.

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(x)

Check whether the given object is a CfnResource.

Parameters:

x (Any) –

Return type:

bool

classmethod is_construct(x)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Construct.

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 enforces 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.

See:

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.
from aws_cdk import 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 enforces 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 .

See:

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

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.

See:

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

ContainerPropertiesProperty

class CfnJobDefinition.ContainerPropertiesProperty(*, image, command=None, environment=None, ephemeral_storage=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, repository_credentials=None, resource_requirements=None, runtime_platform=None, secrets=None, ulimits=None, user=None, vcpus=None, volumes=None)

Bases: object

Container properties are used for Amazon ECS based job definitions.

These properties to describe the container that’s launched as part of a job.

Parameters:
  • image (str) – Required. 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* . It can be 255 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), underscores (_), colons (:), periods (.), forward slashes (/), and number signs (#). 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, 123456789012.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 cannot start with “ AWS_BATCH “. This naming convention is reserved for variables that AWS Batch sets.

  • ephemeral_storage (Union[IResolvable, EphemeralStorageProperty, Dict[str, Any], None]) – The amount of ephemeral storage to allocate for the task. This parameter is used to expand the total amount of ephemeral storage available, beyond the default amount, for tasks hosted on AWS Fargate .

  • 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 Amazon 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 in to 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 that run on Amazon 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 Amazon 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 .

  • repository_credentials (Union[IResolvable, RepositoryCredentialsProperty, Dict[str, Any], None]) – The private repository authentication credentials to use.

  • 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 .

  • runtime_platform (Union[IResolvable, RuntimePlatformProperty, Dict[str, Any], None]) – An object that represents the compute environment architecture for AWS Batch jobs on Fargate.

  • 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 Amazon 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.

See:

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.
from aws_cdk import 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"
    )],
    ephemeral_storage=batch.CfnJobDefinition.EphemeralStorageProperty(
        size_in_gi_b=123
    ),
    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,
    repository_credentials=batch.CfnJobDefinition.RepositoryCredentialsProperty(
        credentials_parameter="credentialsParameter"
    ),
    resource_requirements=[batch.CfnJobDefinition.ResourceRequirementProperty(
        type="type",
        value="value"
    )],
    runtime_platform=batch.CfnJobDefinition.RuntimePlatformProperty(
        cpu_architecture="cpuArchitecture",
        operating_system_family="operatingSystemFamily"
    ),
    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 .

See:

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

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 cannot start with " ``AWS_BATCH`` ". This naming convention is reserved for variables that AWS Batch sets.
See:

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

ephemeral_storage

The amount of ephemeral storage to allocate for the task.

This parameter is used to expand the total amount of ephemeral storage available, beyond the default amount, for tasks hosted on AWS Fargate .

See:

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

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 .

See:

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

fargate_platform_configuration

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

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

See:

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

image

Required.

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* . It can be 255 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), underscores (_), colons (:), periods (.), forward slashes (/), and number signs (#). 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, 123456789012.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 ).

See:

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

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.
See:

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

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 .

See:

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

linux_parameters

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

See:

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

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 <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties-logconfiguration.html>`_ 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 in to 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* .
See:

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

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 that run on Amazon 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.

See:

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

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 .

See:

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

network_configuration

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

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

See:

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

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.
See:

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

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 .

See:

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

repository_credentials

The private repository authentication credentials to use.

See:

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

resource_requirements

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

The supported resources include GPU , MEMORY , and VCPU .

See:

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

runtime_platform

An object that represents the compute environment architecture for AWS Batch jobs on Fargate.

See:

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

secrets

The secrets for the container.

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

See:

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

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.
See:

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

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 .

See:

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

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 Amazon 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.

See:

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

volumes

A list of data volumes used in a job.

See:

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

DeviceProperty

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

Bases: object

An object that represents 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.

See:

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.
from aws_cdk import 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.

See:

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

host_path

The path for the device on the host container instance.

See:

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

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.

See:

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

EcsPropertiesProperty

class CfnJobDefinition.EcsPropertiesProperty(*, task_properties)

Bases: object

An object that contains the properties for the Amazon ECS resources of a job.

Parameters:

task_properties (Union[IResolvable, Sequence[Union[IResolvable, EcsTaskPropertiesProperty, Dict[str, Any]]]]) – An object that contains the properties for the Amazon ECS task definition of a job. .. epigraph:: This object is currently limited to one element.

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

# options: Any

ecs_properties_property = batch.CfnJobDefinition.EcsPropertiesProperty(
    task_properties=[batch.CfnJobDefinition.EcsTaskPropertiesProperty(
        containers=[batch.CfnJobDefinition.TaskContainerPropertiesProperty(
            image="image",

            # the properties below are optional
            command=["command"],
            depends_on=[batch.CfnJobDefinition.TaskContainerDependencyProperty(
                condition="condition",
                container_name="containerName"
            )],
            environment=[batch.CfnJobDefinition.EnvironmentProperty(
                name="name",
                value="value"
            )],
            essential=False,
            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"
                )]
            ),
            mount_points=[batch.CfnJobDefinition.MountPointsProperty(
                container_path="containerPath",
                read_only=False,
                source_volume="sourceVolume"
            )],
            name="name",
            privileged=False,
            readonly_root_filesystem=False,
            repository_credentials=batch.CfnJobDefinition.RepositoryCredentialsProperty(
                credentials_parameter="credentialsParameter"
            ),
            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"
        )],
        ephemeral_storage=batch.CfnJobDefinition.EphemeralStorageProperty(
            size_in_gi_b=123
        ),
        execution_role_arn="executionRoleArn",
        ipc_mode="ipcMode",
        network_configuration=batch.CfnJobDefinition.NetworkConfigurationProperty(
            assign_public_ip="assignPublicIp"
        ),
        pid_mode="pidMode",
        platform_version="platformVersion",
        runtime_platform=batch.CfnJobDefinition.RuntimePlatformProperty(
            cpu_architecture="cpuArchitecture",
            operating_system_family="operatingSystemFamily"
        ),
        task_role_arn="taskRoleArn",
        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

task_properties

An object that contains the properties for the Amazon ECS task definition of a job.

This object is currently limited to one element.

See:

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

EcsTaskPropertiesProperty

class CfnJobDefinition.EcsTaskPropertiesProperty(*, containers=None, ephemeral_storage=None, execution_role_arn=None, ipc_mode=None, network_configuration=None, pid_mode=None, platform_version=None, runtime_platform=None, task_role_arn=None, volumes=None)

Bases: object

The properties for a task definition that describes the container and volume definitions of an Amazon ECS task.

You can specify which Docker images to use, the required resources, and other configurations related to launching the task definition through an Amazon ECS service or task.

Parameters:
  • containers (Union[IResolvable, Sequence[Union[IResolvable, TaskContainerPropertiesProperty, Dict[str, Any]]], None]) – This object is a list of containers.

  • ephemeral_storage (Union[IResolvable, EphemeralStorageProperty, Dict[str, Any], None]) – The amount of ephemeral storage to allocate for the task. This parameter is used to expand the total amount of ephemeral storage available, beyond the default amount, for tasks hosted on AWS Fargate .

  • 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 .

  • ipc_mode (Optional[str]) – The IPC resource namespace to use for the containers in the task. The valid values are host , task , or none . If host is specified, all containers within the tasks that specified the host IPC mode on the same container instance share the same IPC resources with the host Amazon EC2 instance. If task is specified, all containers within the specified task share the same IPC resources. If none is specified, the IPC resources within the containers of a task are private, and are not shared with other containers in a task or on the container instance. If no value is specified, then the IPC resource namespace sharing depends on the Docker daemon setting on the container instance. For more information, see IPC settings in the Docker run reference.

  • 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 Amazon EC2 resources must not specify this parameter.

  • pid_mode (Optional[str]) – The process namespace to use for the containers in the task. The valid values are host or task . For example, monitoring sidecars might need pidMode to access information about other containers running in the same task. If host is specified, all containers within the tasks that specified the host PID mode on the same container instance share the process namespace with the host Amazon EC2 instance. If task is specified, all containers within the specified task share the same process namespace. If no value is specified, the default is a private namespace for each container. For more information, see PID settings in the Docker run reference.

  • platform_version (Optional[str]) – The 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 Fargate platform for compute resources. For more information, see AWS Fargate platform versions in the Amazon Elastic Container Service Developer Guide .

  • runtime_platform (Union[IResolvable, RuntimePlatformProperty, Dict[str, Any], None]) – An object that represents the compute environment architecture for AWS Batch jobs on Fargate.

  • task_role_arn (Optional[str]) – The Amazon Resource Name (ARN) that’s associated with the Amazon ECS task. .. epigraph:: This is object is comparable to ContainerProperties:jobRoleArn .

  • volumes (Union[IResolvable, Sequence[Union[IResolvable, VolumesProperty, Dict[str, Any]]], None]) – A list of volumes that are associated with the job.

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

# options: Any

ecs_task_properties_property = batch.CfnJobDefinition.EcsTaskPropertiesProperty(
    containers=[batch.CfnJobDefinition.TaskContainerPropertiesProperty(
        image="image",

        # the properties below are optional
        command=["command"],
        depends_on=[batch.CfnJobDefinition.TaskContainerDependencyProperty(
            condition="condition",
            container_name="containerName"
        )],
        environment=[batch.CfnJobDefinition.EnvironmentProperty(
            name="name",
            value="value"
        )],
        essential=False,
        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"
            )]
        ),
        mount_points=[batch.CfnJobDefinition.MountPointsProperty(
            container_path="containerPath",
            read_only=False,
            source_volume="sourceVolume"
        )],
        name="name",
        privileged=False,
        readonly_root_filesystem=False,
        repository_credentials=batch.CfnJobDefinition.RepositoryCredentialsProperty(
            credentials_parameter="credentialsParameter"
        ),
        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"
    )],
    ephemeral_storage=batch.CfnJobDefinition.EphemeralStorageProperty(
        size_in_gi_b=123
    ),
    execution_role_arn="executionRoleArn",
    ipc_mode="ipcMode",
    network_configuration=batch.CfnJobDefinition.NetworkConfigurationProperty(
        assign_public_ip="assignPublicIp"
    ),
    pid_mode="pidMode",
    platform_version="platformVersion",
    runtime_platform=batch.CfnJobDefinition.RuntimePlatformProperty(
        cpu_architecture="cpuArchitecture",
        operating_system_family="operatingSystemFamily"
    ),
    task_role_arn="taskRoleArn",
    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

containers

This object is a list of containers.

See:

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

ephemeral_storage

The amount of ephemeral storage to allocate for the task.

This parameter is used to expand the total amount of ephemeral storage available, beyond the default amount, for tasks hosted on AWS Fargate .

See:

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

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 .

See:

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

ipc_mode

The IPC resource namespace to use for the containers in the task.

The valid values are host , task , or none .

If host is specified, all containers within the tasks that specified the host IPC mode on the same container instance share the same IPC resources with the host Amazon EC2 instance.

If task is specified, all containers within the specified task share the same IPC resources.

If none is specified, the IPC resources within the containers of a task are private, and are not shared with other containers in a task or on the container instance.

If no value is specified, then the IPC resource namespace sharing depends on the Docker daemon setting on the container instance. For more information, see IPC settings in the Docker run reference.

See:

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

network_configuration

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

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

See:

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

pid_mode

The process namespace to use for the containers in the task.

The valid values are host or task . For example, monitoring sidecars might need pidMode to access information about other containers running in the same task.

If host is specified, all containers within the tasks that specified the host PID mode on the same container instance share the process namespace with the host Amazon EC2 instance.

If task is specified, all containers within the specified task share the same process namespace.

If no value is specified, the default is a private namespace for each container. For more information, see PID settings in the Docker run reference.

See:

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

platform_version

The 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 Fargate platform for compute resources. For more information, see AWS Fargate platform versions in the Amazon Elastic Container Service Developer Guide .

See:

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

runtime_platform

An object that represents the compute environment architecture for AWS Batch jobs on Fargate.

See:

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

task_role_arn

The Amazon Resource Name (ARN) that’s associated with the Amazon ECS task.

This is object is comparable to ContainerProperties:jobRoleArn .

See:

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

volumes

A list of volumes that are associated with the job.

See:

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

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 .

See:

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.
from aws_cdk import 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.

See:

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

file_system_id

The Amazon EFS file system ID to use.

See:

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

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.
See:

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

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 .

See:

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

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 .

See:

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

EksContainerEnvironmentVariableProperty

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

Bases: object

An environment variable.

Parameters:
  • name (str) – The name of the environment variable.

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

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

eks_container_environment_variable_property = batch.CfnJobDefinition.EksContainerEnvironmentVariableProperty(
    name="name",

    # the properties below are optional
    value="value"
)

Attributes

name

The name of the environment variable.

See:

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

value

The value of the environment variable.

See:

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

EksContainerProperty

class CfnJobDefinition.EksContainerProperty(*, image, args=None, command=None, env=None, image_pull_policy=None, name=None, resources=None, security_context=None, volume_mounts=None)

Bases: object

EKS container properties are used in job definitions for Amazon EKS based job definitions to describe the properties for a container node in the pod that’s launched as part of a job.

This can’t be specified for Amazon ECS based job definitions.

Parameters:
  • image (str) – The Docker image used to start the container.

  • args (Optional[Sequence[str]]) – An array of arguments to the entrypoint. If this isn’t specified, the CMD of the container image is used. This corresponds to the args member in the Entrypoint portion of the Pod in Kubernetes. Environment variable references are expanded using the container’s environment. If the referenced environment variable doesn’t exist, the reference in the command isn’t changed. For example, if the reference is to “ $(NAME1) “ and the NAME1 environment variable doesn’t exist, the command string will remain “ $(NAME1) .” $$ is replaced with $ , and the resulting string isn’t expanded. For example, $$(VAR_NAME) is passed as $(VAR_NAME) whether or not the VAR_NAME environment variable exists. For more information, see Dockerfile reference: CMD and Define a command and arguments for a pod in the Kubernetes documentation .

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

    The entrypoint for the container. This isn’t run within a shell. If this isn’t specified, the ENTRYPOINT of the container image is used. Environment variable references are expanded using the container’s environment. If the referenced environment variable doesn’t exist, the reference in the command isn’t changed. For example, if the reference is to “ $(NAME1) “ and the NAME1 environment variable doesn’t exist, the command string will remain “ $(NAME1) .” $$ is replaced with $ and the resulting string isn’t expanded. For example, $$(VAR_NAME) will be passed as $(VAR_NAME) whether or not the VAR_NAME environment variable exists. The entrypoint can’t be updated. For more information, see ENTRYPOINT in the Dockerfile reference and Define a command and arguments for a container and Entrypoint in the Kubernetes documentation .

  • env (Union[IResolvable, Sequence[Union[IResolvable, EksContainerEnvironmentVariableProperty, Dict[str, Any]]], None]) – The environment variables to pass to a container. .. epigraph:: Environment variables cannot start with “ AWS_BATCH “. This naming convention is reserved for variables that AWS Batch sets.

  • image_pull_policy (Optional[str]) – The image pull policy for the container. Supported values are Always , IfNotPresent , and Never . This parameter defaults to IfNotPresent . However, if the :latest tag is specified, it defaults to Always . For more information, see Updating images in the Kubernetes documentation .

  • name (Optional[str]) – The name of the container. If the name isn’t specified, the default name “ Default “ is used. Each container in a pod must have a unique name.

  • resources (Union[IResolvable, ResourcesProperty, Dict[str, Any], None]) – The type and amount of resources to assign to a container. The supported resources include memory , cpu , and nvidia.com/gpu . For more information, see Resource management for pods and containers in the Kubernetes documentation .

  • security_context (Union[IResolvable, SecurityContextProperty, Dict[str, Any], None]) – The security context for a job. For more information, see Configure a security context for a pod or container in the Kubernetes documentation .

  • volume_mounts (Union[IResolvable, Sequence[Union[IResolvable, EksContainerVolumeMountProperty, Dict[str, Any]]], None]) – The volume mounts for the container. AWS Batch supports emptyDir , hostPath , and secret volume types. For more information about volumes and volume mounts in Kubernetes, see Volumes in the Kubernetes documentation .

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

# limits: Any
# requests: Any

eks_container_property = batch.CfnJobDefinition.EksContainerProperty(
    image="image",

    # the properties below are optional
    args=["args"],
    command=["command"],
    env=[batch.CfnJobDefinition.EksContainerEnvironmentVariableProperty(
        name="name",

        # the properties below are optional
        value="value"
    )],
    image_pull_policy="imagePullPolicy",
    name="name",
    resources=batch.CfnJobDefinition.ResourcesProperty(
        limits=limits,
        requests=requests
    ),
    security_context=batch.CfnJobDefinition.SecurityContextProperty(
        allow_privilege_escalation=False,
        privileged=False,
        read_only_root_filesystem=False,
        run_as_group=123,
        run_as_non_root=False,
        run_as_user=123
    ),
    volume_mounts=[batch.CfnJobDefinition.EksContainerVolumeMountProperty(
        mount_path="mountPath",
        name="name",
        read_only=False
    )]
)

Attributes

args

An array of arguments to the entrypoint.

If this isn’t specified, the CMD of the container image is used. This corresponds to the args member in the Entrypoint portion of the Pod in Kubernetes. Environment variable references are expanded using the container’s environment.

If the referenced environment variable doesn’t exist, the reference in the command isn’t changed. For example, if the reference is to “ $(NAME1) “ and the NAME1 environment variable doesn’t exist, the command string will remain “ $(NAME1) .” $$ is replaced with $ , and the resulting string isn’t expanded. For example, $$(VAR_NAME) is passed as $(VAR_NAME) whether or not the VAR_NAME environment variable exists. For more information, see Dockerfile reference: CMD and Define a command and arguments for a pod in the Kubernetes documentation .

See:

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

command

The entrypoint for the container.

This isn’t run within a shell. If this isn’t specified, the ENTRYPOINT of the container image is used. Environment variable references are expanded using the container’s environment.

If the referenced environment variable doesn’t exist, the reference in the command isn’t changed. For example, if the reference is to “ $(NAME1) “ and the NAME1 environment variable doesn’t exist, the command string will remain “ $(NAME1) .” $$ is replaced with $ and the resulting string isn’t expanded. For example, $$(VAR_NAME) will be passed as $(VAR_NAME) whether or not the VAR_NAME environment variable exists. The entrypoint can’t be updated. For more information, see ENTRYPOINT in the Dockerfile reference and Define a command and arguments for a container and Entrypoint in the Kubernetes documentation .

See:

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

env

The environment variables to pass to a container.

Environment variables cannot start with “ AWS_BATCH “. This naming convention is reserved for variables that AWS Batch sets.

See:

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

image

The Docker image used to start the container.

See:

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

image_pull_policy

The image pull policy for the container.

Supported values are Always , IfNotPresent , and Never . This parameter defaults to IfNotPresent . However, if the :latest tag is specified, it defaults to Always . For more information, see Updating images in the Kubernetes documentation .

See:

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

name

The name of the container.

If the name isn’t specified, the default name “ Default “ is used. Each container in a pod must have a unique name.

See:

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

resources

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

The supported resources include memory , cpu , and nvidia.com/gpu . For more information, see Resource management for pods and containers in the Kubernetes documentation .

See:

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

security_context

The security context for a job.

For more information, see Configure a security context for a pod or container in the Kubernetes documentation .

See:

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

volume_mounts

The volume mounts for the container.

AWS Batch supports emptyDir , hostPath , and secret volume types. For more information about volumes and volume mounts in Kubernetes, see Volumes in the Kubernetes documentation .

See:

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

EksContainerVolumeMountProperty

class CfnJobDefinition.EksContainerVolumeMountProperty(*, mount_path=None, name=None, read_only=None)

Bases: object

The volume mounts for a container for an Amazon EKS job.

For more information about volumes and volume mounts in Kubernetes, see Volumes in the Kubernetes documentation .

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

  • name (Optional[str]) – The name the volume mount. This must match the name of one of the volumes in the pod.

  • 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 .

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

eks_container_volume_mount_property = batch.CfnJobDefinition.EksContainerVolumeMountProperty(
    mount_path="mountPath",
    name="name",
    read_only=False
)

Attributes

mount_path

The path on the container where the volume is mounted.

See:

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

name

The name the volume mount.

This must match the name of one of the volumes in the pod.

See:

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

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 .

See:

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

EksPropertiesProperty

class CfnJobDefinition.EksPropertiesProperty(*, pod_properties=None)

Bases: object

An object that contains the properties for the Kubernetes resources of a job.

Parameters:

pod_properties (Union[IResolvable, PodPropertiesProperty, Dict[str, Any], None]) – The properties for the Kubernetes pod resources of a job.

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

# labels: Any
# limits: Any
# requests: Any

eks_properties_property = batch.CfnJobDefinition.EksPropertiesProperty(
    pod_properties=batch.CfnJobDefinition.PodPropertiesProperty(
        containers=[batch.CfnJobDefinition.EksContainerProperty(
            image="image",

            # the properties below are optional
            args=["args"],
            command=["command"],
            env=[batch.CfnJobDefinition.EksContainerEnvironmentVariableProperty(
                name="name",

                # the properties below are optional
                value="value"
            )],
            image_pull_policy="imagePullPolicy",
            name="name",
            resources=batch.CfnJobDefinition.ResourcesProperty(
                limits=limits,
                requests=requests
            ),
            security_context=batch.CfnJobDefinition.SecurityContextProperty(
                allow_privilege_escalation=False,
                privileged=False,
                read_only_root_filesystem=False,
                run_as_group=123,
                run_as_non_root=False,
                run_as_user=123
            ),
            volume_mounts=[batch.CfnJobDefinition.EksContainerVolumeMountProperty(
                mount_path="mountPath",
                name="name",
                read_only=False
            )]
        )],
        dns_policy="dnsPolicy",
        host_network=False,
        image_pull_secrets=[batch.CfnJobDefinition.ImagePullSecretProperty(
            name="name"
        )],
        init_containers=[batch.CfnJobDefinition.EksContainerProperty(
            image="image",

            # the properties below are optional
            args=["args"],
            command=["command"],
            env=[batch.CfnJobDefinition.EksContainerEnvironmentVariableProperty(
                name="name",

                # the properties below are optional
                value="value"
            )],
            image_pull_policy="imagePullPolicy",
            name="name",
            resources=batch.CfnJobDefinition.ResourcesProperty(
                limits=limits,
                requests=requests
            ),
            security_context=batch.CfnJobDefinition.SecurityContextProperty(
                allow_privilege_escalation=False,
                privileged=False,
                read_only_root_filesystem=False,
                run_as_group=123,
                run_as_non_root=False,
                run_as_user=123
            ),
            volume_mounts=[batch.CfnJobDefinition.EksContainerVolumeMountProperty(
                mount_path="mountPath",
                name="name",
                read_only=False
            )]
        )],
        metadata=batch.CfnJobDefinition.MetadataProperty(
            labels=labels
        ),
        service_account_name="serviceAccountName",
        share_process_namespace=False,
        volumes=[batch.CfnJobDefinition.EksVolumeProperty(
            name="name",

            # the properties below are optional
            empty_dir=batch.CfnJobDefinition.EmptyDirProperty(
                medium="medium",
                size_limit="sizeLimit"
            ),
            host_path=batch.CfnJobDefinition.HostPathProperty(
                path="path"
            ),
            secret=batch.CfnJobDefinition.EksSecretProperty(
                secret_name="secretName",

                # the properties below are optional
                optional=False
            )
        )]
    )
)

Attributes

pod_properties

The properties for the Kubernetes pod resources of a job.

See:

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

EksSecretProperty

class CfnJobDefinition.EksSecretProperty(*, secret_name, optional=None)

Bases: object

Specifies the configuration of a Kubernetes secret volume.

For more information, see secret in the Kubernetes documentation .

Parameters:
  • secret_name (str) – The name of the secret. The name must be allowed as a DNS subdomain name. For more information, see DNS subdomain names in the Kubernetes documentation .

  • optional (Union[bool, IResolvable, None]) – Specifies whether the secret or the secret’s keys must be defined.

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

eks_secret_property = batch.CfnJobDefinition.EksSecretProperty(
    secret_name="secretName",

    # the properties below are optional
    optional=False
)

Attributes

optional

Specifies whether the secret or the secret’s keys must be defined.

See:

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

secret_name

The name of the secret.

The name must be allowed as a DNS subdomain name. For more information, see DNS subdomain names in the Kubernetes documentation .

See:

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

EksVolumeProperty

class CfnJobDefinition.EksVolumeProperty(*, name, empty_dir=None, host_path=None, secret=None)

Bases: object

Specifies an Amazon EKS volume for a job definition.

Parameters:
  • name (str) –

    The name of the volume. The name must be allowed as a DNS subdomain name. For more information, see DNS subdomain names in the Kubernetes documentation .

  • empty_dir (Union[IResolvable, EmptyDirProperty, Dict[str, Any], None]) – Specifies the configuration of a Kubernetes emptyDir volume. For more information, see emptyDir in the Kubernetes documentation .

  • host_path (Union[IResolvable, HostPathProperty, Dict[str, Any], None]) – Specifies the configuration of a Kubernetes hostPath volume. For more information, see hostPath in the Kubernetes documentation .

  • secret (Union[IResolvable, EksSecretProperty, Dict[str, Any], None]) –

    Specifies the configuration of a Kubernetes secret volume. For more information, see secret in the Kubernetes documentation .

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

eks_volume_property = batch.CfnJobDefinition.EksVolumeProperty(
    name="name",

    # the properties below are optional
    empty_dir=batch.CfnJobDefinition.EmptyDirProperty(
        medium="medium",
        size_limit="sizeLimit"
    ),
    host_path=batch.CfnJobDefinition.HostPathProperty(
        path="path"
    ),
    secret=batch.CfnJobDefinition.EksSecretProperty(
        secret_name="secretName",

        # the properties below are optional
        optional=False
    )
)

Attributes

empty_dir

Specifies the configuration of a Kubernetes emptyDir volume.

For more information, see emptyDir in the Kubernetes documentation .

See:

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

host_path

Specifies the configuration of a Kubernetes hostPath volume.

For more information, see hostPath in the Kubernetes documentation .

See:

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

name

The name of the volume.

The name must be allowed as a DNS subdomain name. For more information, see DNS subdomain names in the Kubernetes documentation .

See:

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

secret

Specifies the configuration of a Kubernetes secret volume.

For more information, see secret in the Kubernetes documentation .

See:

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

EmptyDirProperty

class CfnJobDefinition.EmptyDirProperty(*, medium=None, size_limit=None)

Bases: object

Parameters:
  • medium (Optional[str]) –

  • size_limit (Optional[str]) –

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

empty_dir_property = batch.CfnJobDefinition.EmptyDirProperty(
    medium="medium",
    size_limit="sizeLimit"
)

Attributes

medium

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

Type:

see

size_limit

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

Type:

see

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.

See:

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.
from aws_cdk import aws_batch as batch

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

Attributes

name

The name of the environment variable.

See:

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

value

The value of the environment variable.

See:

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

EphemeralStorageProperty

class CfnJobDefinition.EphemeralStorageProperty(*, size_in_gib)

Bases: object

The amount of ephemeral storage to allocate for the task.

This parameter is used to expand the total amount of ephemeral storage available, beyond the default amount, for tasks hosted on AWS Fargate .

Parameters:

size_in_gib (Union[int, float]) – The total amount, in GiB, of ephemeral storage to set for the task. The minimum supported value is 21 GiB and the maximum supported value is 200 GiB.

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

ephemeral_storage_property = batch.CfnJobDefinition.EphemeralStorageProperty(
    size_in_gi_b=123
)

Attributes

size_in_gib

The total amount, in GiB, of ephemeral storage to set for the task.

The minimum supported value is 21 GiB and the maximum supported value is 200 GiB.

See:

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

EvaluateOnExitProperty

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

Bases: object

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

If none of the EvaluateOnExit conditions in a RetryStrategy match, then the job is retried.

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 long. It can contain only numbers, and can end with an asterisk (*) so that only the start of the string needs to be an exact match. The string can contain up to 512 characters.

  • on_reason (Optional[str]) – Contains a glob pattern to match against the Reason returned for a job. The pattern can contain up to 512 characters. 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.

  • on_status_reason (Optional[str]) – Contains a glob pattern to match against the StatusReason returned for a job. The pattern can contain up to 512 characters. It can contain letters, numbers, periods (.), colons (:), and white spaces (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.

See:

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.
from aws_cdk import 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.

See:

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

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 long. It can contain only numbers, and can end with an asterisk (*) so that only the start of the string needs to be an exact match.

The string can contain up to 512 characters.

See:

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

on_reason

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

The pattern can contain up to 512 characters. 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.

See:

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

on_status_reason

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

The pattern can contain up to 512 characters. It can contain letters, numbers, periods (.), colons (:), and white spaces (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.

See:

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

FargatePlatformConfigurationProperty

class CfnJobDefinition.FargatePlatformConfigurationProperty(*, platform_version=None)

Bases: object

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

Jobs that run on Amazon 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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-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.
from aws_cdk import 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 .

See:

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

HostPathProperty

class CfnJobDefinition.HostPathProperty(*, path=None)

Bases: object

Parameters:

path (Optional[str]) –

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

host_path_property = batch.CfnJobDefinition.HostPathProperty(
    path="path"
)

Attributes

path

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

Type:

see

ImagePullSecretProperty

class CfnJobDefinition.ImagePullSecretProperty(*, name)

Bases: object

Parameters:

name (str) –

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

image_pull_secret_property = batch.CfnJobDefinition.ImagePullSecretProperty(
    name="name"
)

Attributes

name

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

Type:

see

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 of the 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. Don’t provide it for these jobs.

  • 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 in to 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 that it’s 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. Don’t provide it for these jobs.

  • 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. Don’t provide it for these jobs.

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

    You can use this parameter to tune a container’s memory swappiness behavior. A swappiness value of 0 causes swapping to not occur unless absolutely necessary. A swappiness value of 100 causes pages to be swapped aggressively. Valid 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:: By default, the Amazon ECS optimized AMIs don’t have swap enabled. 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 has a default swappiness value of 60. Moreover, the total swap usage is limited to two times the memory reservation of the container. .. epigraph:: This parameter isn’t applicable to jobs that are running on Fargate resources. Don’t provide it for these jobs.

  • 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. Don’t provide this parameter for this resource type.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-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.
from aws_cdk import 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 of the 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. Don't provide it for these jobs.
See:

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

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 in to your container instance and run the following command: sudo docker version | grep "Server API version"

See:

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

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 that it’s 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. Don't provide it for these jobs.
See:

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

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. Don't provide it for these jobs.
See:

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

swappiness

You can use this parameter to tune a container’s memory swappiness behavior.

A swappiness value of 0 causes swapping to not occur unless absolutely necessary. A swappiness value of 100 causes pages to be swapped aggressively. Valid 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.

By default, the Amazon ECS optimized AMIs don’t have swap enabled. 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 has a default swappiness value of 60. Moreover, the total swap usage is limited to two times the memory reservation of the container.

This parameter isn’t applicable to jobs that are running on Fargate resources. Don’t provide it for these jobs.

See:

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

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. Don't provide this parameter for this resource type.
See:

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

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 that are 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 in to 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 in to 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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-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.
from aws_cdk import 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 that are 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 in to your container instance and run the following command: sudo docker version | grep "Server API version"

See:

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

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 in to your container instance and run the following command: sudo docker version | grep "Server API version"

See:

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

secret_options

The secrets to pass to the log configuration.

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

See:

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

MetadataProperty

class CfnJobDefinition.MetadataProperty(*, labels=None)

Bases: object

Metadata about the Kubernetes pod.

For more information, see Understanding Kubernetes Objects in the Kubernetes documentation .

Parameters:

labels (Optional[Any]) – Key-value pairs used to identify, sort, and organize cube resources. Can contain up to 63 uppercase letters, lowercase letters, numbers, hyphens (-), and underscores (_). Labels can be added or modified at any time. Each resource can have multiple labels, but each key must be unique for a given object.

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

# labels: Any

metadata_property = batch.CfnJobDefinition.MetadataProperty(
    labels=labels
)

Attributes

labels

Key-value pairs used to identify, sort, and organize cube resources.

Can contain up to 63 uppercase letters, lowercase letters, numbers, hyphens (-), and underscores (_). Labels can be added or modified at any time. Each resource can have multiple labels, but each key must be unique for a given object.

See:

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

MountPointsProperty

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

Bases: object

Details for 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.

See:

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.
from aws_cdk import 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.

See:

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

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 .

See:

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

source_volume

The name of the volume to mount.

See:

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

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 Amazon EC2 resources must not specify this parameter.

Parameters:

assign_public_ip (Optional[str]) – Indicates whether the job has a public IP address. For a job that’s 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 in the Amazon Elastic Container Service Developer Guide . The default value is “ DISABLED “.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-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.
from aws_cdk import aws_batch as batch

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

Attributes

assign_public_ip

Indicates whether the job has a public IP address.

For a job that’s 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 in the Amazon Elastic Container Service Developer Guide . The default value is “ DISABLED “.

See:

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

NodePropertiesProperty

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

Bases: object

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

Node properties can’t be specified for Amazon EKS based job definitions.

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 that are associated with a multi-node parallel job.

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

See:

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.
from aws_cdk import 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"
            )],
            ephemeral_storage=batch.CfnJobDefinition.EphemeralStorageProperty(
                size_in_gi_b=123
            ),
            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,
            repository_credentials=batch.CfnJobDefinition.RepositoryCredentialsProperty(
                credentials_parameter="credentialsParameter"
            ),
            resource_requirements=[batch.CfnJobDefinition.ResourceRequirementProperty(
                type="type",
                value="value"
            )],
            runtime_platform=batch.CfnJobDefinition.RuntimePlatformProperty(
                cpu_architecture="cpuArchitecture",
                operating_system_family="operatingSystemFamily"
            ),
            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"
            )]
        ),
        ecs_properties=batch.CfnJobDefinition.EcsPropertiesProperty(
            task_properties=[batch.CfnJobDefinition.EcsTaskPropertiesProperty(
                containers=[batch.CfnJobDefinition.TaskContainerPropertiesProperty(
                    image="image",

                    # the properties below are optional
                    command=["command"],
                    depends_on=[batch.CfnJobDefinition.TaskContainerDependencyProperty(
                        condition="condition",
                        container_name="containerName"
                    )],
                    environment=[batch.CfnJobDefinition.EnvironmentProperty(
                        name="name",
                        value="value"
                    )],
                    essential=False,
                    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"
                        )]
                    ),
                    mount_points=[batch.CfnJobDefinition.MountPointsProperty(
                        container_path="containerPath",
                        read_only=False,
                        source_volume="sourceVolume"
                    )],
                    name="name",
                    privileged=False,
                    readonly_root_filesystem=False,
                    repository_credentials=batch.CfnJobDefinition.RepositoryCredentialsProperty(
                        credentials_parameter="credentialsParameter"
                    ),
                    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"
                )],
                ephemeral_storage=batch.CfnJobDefinition.EphemeralStorageProperty(
                    size_in_gi_b=123
                ),
                execution_role_arn="executionRoleArn",
                ipc_mode="ipcMode",
                network_configuration=batch.CfnJobDefinition.NetworkConfigurationProperty(
                    assign_public_ip="assignPublicIp"
                ),
                pid_mode="pidMode",
                platform_version="platformVersion",
                runtime_platform=batch.CfnJobDefinition.RuntimePlatformProperty(
                    cpu_architecture="cpuArchitecture",
                    operating_system_family="operatingSystemFamily"
                ),
                task_role_arn="taskRoleArn",
                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"
                )]
            )]
        ),
        instance_types=["instanceTypes"]
    )],
    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.

See:

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

node_range_properties

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

See:

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

num_nodes

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

See:

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

NodeRangePropertyProperty

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

Bases: object

This is an object that represents 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 this 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.

  • ecs_properties (Union[IResolvable, EcsPropertiesProperty, Dict[str, Any], None]) – This is an object that represents the properties of the node range for a multi-node parallel job.

  • instance_types (Optional[Sequence[str]]) – The instance types of the underlying host infrastructure of a multi-node parallel job. .. epigraph:: This parameter isn’t applicable to jobs that are running on Fargate resources. In addition, this list object is currently limited to one element.

See:

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.
from aws_cdk import 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"
        )],
        ephemeral_storage=batch.CfnJobDefinition.EphemeralStorageProperty(
            size_in_gi_b=123
        ),
        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,
        repository_credentials=batch.CfnJobDefinition.RepositoryCredentialsProperty(
            credentials_parameter="credentialsParameter"
        ),
        resource_requirements=[batch.CfnJobDefinition.ResourceRequirementProperty(
            type="type",
            value="value"
        )],
        runtime_platform=batch.CfnJobDefinition.RuntimePlatformProperty(
            cpu_architecture="cpuArchitecture",
            operating_system_family="operatingSystemFamily"
        ),
        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"
        )]
    ),
    ecs_properties=batch.CfnJobDefinition.EcsPropertiesProperty(
        task_properties=[batch.CfnJobDefinition.EcsTaskPropertiesProperty(
            containers=[batch.CfnJobDefinition.TaskContainerPropertiesProperty(
                image="image",

                # the properties below are optional
                command=["command"],
                depends_on=[batch.CfnJobDefinition.TaskContainerDependencyProperty(
                    condition="condition",
                    container_name="containerName"
                )],
                environment=[batch.CfnJobDefinition.EnvironmentProperty(
                    name="name",
                    value="value"
                )],
                essential=False,
                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"
                    )]
                ),
                mount_points=[batch.CfnJobDefinition.MountPointsProperty(
                    container_path="containerPath",
                    read_only=False,
                    source_volume="sourceVolume"
                )],
                name="name",
                privileged=False,
                readonly_root_filesystem=False,
                repository_credentials=batch.CfnJobDefinition.RepositoryCredentialsProperty(
                    credentials_parameter="credentialsParameter"
                ),
                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"
            )],
            ephemeral_storage=batch.CfnJobDefinition.EphemeralStorageProperty(
                size_in_gi_b=123
            ),
            execution_role_arn="executionRoleArn",
            ipc_mode="ipcMode",
            network_configuration=batch.CfnJobDefinition.NetworkConfigurationProperty(
                assign_public_ip="assignPublicIp"
            ),
            pid_mode="pidMode",
            platform_version="platformVersion",
            runtime_platform=batch.CfnJobDefinition.RuntimePlatformProperty(
                cpu_architecture="cpuArchitecture",
                operating_system_family="operatingSystemFamily"
            ),
            task_role_arn="taskRoleArn",
            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"
            )]
        )]
    ),
    instance_types=["instanceTypes"]
)

Attributes

container

The container details for the node range.

See:

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

ecs_properties

This is an object that represents the properties of the node range for a multi-node parallel job.

See:

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

instance_types

The instance types of the underlying host infrastructure of a multi-node parallel job.

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

In addition, this list object is currently limited to one element.

See:

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

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 this case, the 4:5 range properties override the 0:10 properties.

See:

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

PodPropertiesProperty

class CfnJobDefinition.PodPropertiesProperty(*, containers=None, dns_policy=None, host_network=None, image_pull_secrets=None, init_containers=None, metadata=None, service_account_name=None, share_process_namespace=None, volumes=None)

Bases: object

The properties for the pod.

Parameters:
  • containers (Union[IResolvable, Sequence[Union[IResolvable, EksContainerProperty, Dict[str, Any]]], None]) – The properties of the container that’s used on the Amazon EKS pod.

  • dns_policy (Optional[str]) – The DNS policy for the pod. The default value is ClusterFirst . If the hostNetwork parameter is not specified, the default is ClusterFirstWithHostNet . ClusterFirst indicates that any DNS query that does not match the configured cluster domain suffix is forwarded to the upstream nameserver inherited from the node. For more information, see Pod’s DNS policy in the Kubernetes documentation . Valid values: Default | ClusterFirst | ClusterFirstWithHostNet

  • host_network (Union[bool, IResolvable, None]) – Indicates if the pod uses the hosts’ network IP address. The default value is true . Setting this to false enables the Kubernetes pod networking model. Most AWS Batch workloads are egress-only and don’t require the overhead of IP allocation for each pod for incoming connections. For more information, see Host namespaces and Pod networking in the Kubernetes documentation .

  • image_pull_secrets (Union[IResolvable, Sequence[Union[IResolvable, ImagePullSecretProperty, Dict[str, Any]]], None]) –

  • init_containers (Union[IResolvable, Sequence[Union[IResolvable, EksContainerProperty, Dict[str, Any]]], None]) – These containers run before application containers, always runs to completion, and must complete successfully before the next container starts. These containers are registered with the Amazon EKS Connector agent and persists the registration information in the Kubernetes backend data store. For more information, see Init Containers in the Kubernetes documentation . .. epigraph:: This object is limited to 10 elements

  • metadata (Union[IResolvable, MetadataProperty, Dict[str, Any], None]) –

    Metadata about the Kubernetes pod. For more information, see Understanding Kubernetes Objects in the Kubernetes documentation .

  • service_account_name (Optional[str]) – The name of the service account that’s used to run the pod. For more information, see Kubernetes service accounts and Configure a Kubernetes service account to assume an IAM role in the Amazon EKS User Guide and Configure service accounts for pods in the Kubernetes documentation .

  • share_process_namespace (Union[bool, IResolvable, None]) – Indicates if the processes in a container are shared, or visible, to other containers in the same pod. For more information, see Share Process Namespace between Containers in a Pod .

  • volumes (Union[IResolvable, Sequence[Union[IResolvable, EksVolumeProperty, Dict[str, Any]]], None]) – Specifies the volumes for a job definition that uses Amazon EKS resources.

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

# labels: Any
# limits: Any
# requests: Any

pod_properties_property = batch.CfnJobDefinition.PodPropertiesProperty(
    containers=[batch.CfnJobDefinition.EksContainerProperty(
        image="image",

        # the properties below are optional
        args=["args"],
        command=["command"],
        env=[batch.CfnJobDefinition.EksContainerEnvironmentVariableProperty(
            name="name",

            # the properties below are optional
            value="value"
        )],
        image_pull_policy="imagePullPolicy",
        name="name",
        resources=batch.CfnJobDefinition.ResourcesProperty(
            limits=limits,
            requests=requests
        ),
        security_context=batch.CfnJobDefinition.SecurityContextProperty(
            allow_privilege_escalation=False,
            privileged=False,
            read_only_root_filesystem=False,
            run_as_group=123,
            run_as_non_root=False,
            run_as_user=123
        ),
        volume_mounts=[batch.CfnJobDefinition.EksContainerVolumeMountProperty(
            mount_path="mountPath",
            name="name",
            read_only=False
        )]
    )],
    dns_policy="dnsPolicy",
    host_network=False,
    image_pull_secrets=[batch.CfnJobDefinition.ImagePullSecretProperty(
        name="name"
    )],
    init_containers=[batch.CfnJobDefinition.EksContainerProperty(
        image="image",

        # the properties below are optional
        args=["args"],
        command=["command"],
        env=[batch.CfnJobDefinition.EksContainerEnvironmentVariableProperty(
            name="name",

            # the properties below are optional
            value="value"
        )],
        image_pull_policy="imagePullPolicy",
        name="name",
        resources=batch.CfnJobDefinition.ResourcesProperty(
            limits=limits,
            requests=requests
        ),
        security_context=batch.CfnJobDefinition.SecurityContextProperty(
            allow_privilege_escalation=False,
            privileged=False,
            read_only_root_filesystem=False,
            run_as_group=123,
            run_as_non_root=False,
            run_as_user=123
        ),
        volume_mounts=[batch.CfnJobDefinition.EksContainerVolumeMountProperty(
            mount_path="mountPath",
            name="name",
            read_only=False
        )]
    )],
    metadata=batch.CfnJobDefinition.MetadataProperty(
        labels=labels
    ),
    service_account_name="serviceAccountName",
    share_process_namespace=False,
    volumes=[batch.CfnJobDefinition.EksVolumeProperty(
        name="name",

        # the properties below are optional
        empty_dir=batch.CfnJobDefinition.EmptyDirProperty(
            medium="medium",
            size_limit="sizeLimit"
        ),
        host_path=batch.CfnJobDefinition.HostPathProperty(
            path="path"
        ),
        secret=batch.CfnJobDefinition.EksSecretProperty(
            secret_name="secretName",

            # the properties below are optional
            optional=False
        )
    )]
)

Attributes

containers

The properties of the container that’s used on the Amazon EKS pod.

See:

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

dns_policy

The DNS policy for the pod.

The default value is ClusterFirst . If the hostNetwork parameter is not specified, the default is ClusterFirstWithHostNet . ClusterFirst indicates that any DNS query that does not match the configured cluster domain suffix is forwarded to the upstream nameserver inherited from the node. For more information, see Pod’s DNS policy in the Kubernetes documentation .

Valid values: Default | ClusterFirst | ClusterFirstWithHostNet

See:

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

host_network

Indicates if the pod uses the hosts’ network IP address.

The default value is true . Setting this to false enables the Kubernetes pod networking model. Most AWS Batch workloads are egress-only and don’t require the overhead of IP allocation for each pod for incoming connections. For more information, see Host namespaces and Pod networking in the Kubernetes documentation .

See:

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

image_pull_secrets

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

Type:

see

init_containers

These containers run before application containers, always runs to completion, and must complete successfully before the next container starts.

These containers are registered with the Amazon EKS Connector agent and persists the registration information in the Kubernetes backend data store. For more information, see Init Containers in the Kubernetes documentation . .. epigraph:

This object is limited to 10 elements
See:

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

metadata

Metadata about the Kubernetes pod.

For more information, see Understanding Kubernetes Objects in the Kubernetes documentation .

See:

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

service_account_name

The name of the service account that’s used to run the pod.

For more information, see Kubernetes service accounts and Configure a Kubernetes service account to assume an IAM role in the Amazon EKS User Guide and Configure service accounts for pods in the Kubernetes documentation .

See:

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

share_process_namespace

Indicates if the processes in a container are shared, or visible, to other containers in the same pod.

For more information, see Share Process Namespace between Containers in a Pod .

See:

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

volumes

Specifies the volumes for a job definition that uses Amazon EKS resources.

See:

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

RepositoryCredentialsProperty

class CfnJobDefinition.RepositoryCredentialsProperty(*, credentials_parameter)

Bases: object

The repository credentials for private registry authentication.

Parameters:

credentials_parameter (str) – The Amazon Resource Name (ARN) of the secret containing the private repository credentials.

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

repository_credentials_property = batch.CfnJobDefinition.RepositoryCredentialsProperty(
    credentials_parameter="credentialsParameter"
)

Attributes

credentials_parameter

The Amazon Resource Name (ARN) of the secret containing the private repository credentials.

See:

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

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. Make sure that the number of GPUs reserved for all containers in a job doesn’t exceed the number of available GPUs on the compute resource that the job is launched on. .. epigraph:: GPUs aren’t 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 Amazon 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, or 15360 - VCPU = 2 or 4 - value = 16384 - VCPU = 2, 4, or 8 - value = 17408, 18432, 19456, 21504, 22528, 23552, 25600, 26624, 27648, 29696, or 30720 - VCPU = 4 - value = 20480, 24576, or 28672 - VCPU = 4 or 8 - value = 36864, 45056, 53248, or 61440 - VCPU = 8 - value = 32768, 40960, 49152, or 57344 - VCPU = 8 or 16 - value = 65536, 73728, 81920, 90112, 98304, 106496, 114688, or 122880 - VCPU = 16 - 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 Amazon 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. The default for the Fargate On-Demand vCPU resource count quota is 6 vCPUs. For more information about Fargate quotas, see AWS Fargate quotas in the AWS General Reference . 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, 4, 8, and 16 - 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 - value = 8 - MEMORY = 16384, 20480, 24576, 28672, 32768, 36864, 40960, 45056, 49152, 53248, 57344, or 61440 - value = 16 - MEMORY = 32768, 40960, 49152, 57344, 65536, 73728, 81920, 90112, 98304, 106496, 114688, or 122880

See:

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.
from aws_cdk import 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 .

See:

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

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. Make sure that the number of GPUs reserved for all containers in a job doesn’t exceed the number of available GPUs on the compute resource that the job is launched on.

GPUs aren’t 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 Amazon 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, or 15360 - VCPU = 2 or 4

  • value = 16384 - VCPU = 2, 4, or 8

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

  • value = 20480, 24576, or 28672 - VCPU = 4 or 8

  • value = 36864, 45056, 53248, or 61440 - VCPU = 8

  • value = 32768, 40960, 49152, or 57344 - VCPU = 8 or 16

  • value = 65536, 73728, 81920, 90112, 98304, 106496, 114688, or 122880 - VCPU = 16

  • 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 Amazon 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.

The default for the Fargate On-Demand vCPU resource count quota is 6 vCPUs. For more information about Fargate quotas, see AWS Fargate quotas in the AWS General Reference .

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, 4, 8, and 16

  • 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

  • value = 8 - MEMORY = 16384, 20480, 24576, 28672, 32768, 36864, 40960, 45056, 49152, 53248, 57344, or 61440

  • value = 16 - MEMORY = 32768, 40960, 49152, 57344, 65536, 73728, 81920, 90112, 98304, 106496, 114688, or 122880

See:

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

ResourcesProperty

class CfnJobDefinition.ResourcesProperty(*, limits=None, requests=None)

Bases: object

Parameters:
  • limits (Optional[Any]) –

  • requests (Optional[Any]) –

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

# limits: Any
# requests: Any

resources_property = batch.CfnJobDefinition.ResourcesProperty(
    limits=limits,
    requests=requests
)

Attributes

limits

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

Type:

see

requests

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

Type:

see

RetryStrategyProperty

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

Bases: object

The retry strategy that’s 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 the conditions where jobs are retried or failed. If this parameter is specified, then the attempts parameter must also be specified. If none of the listed conditions match, then the job is retried.

See:

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.
from aws_cdk import 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.

See:

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

evaluate_on_exit

Array of up to 5 objects that specify the conditions where jobs are retried or failed.

If this parameter is specified, then the attempts parameter must also be specified. If none of the listed conditions match, then the job is retried.

See:

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

RuntimePlatformProperty

class CfnJobDefinition.RuntimePlatformProperty(*, cpu_architecture=None, operating_system_family=None)

Bases: object

An object that represents the compute environment architecture for AWS Batch jobs on Fargate.

Parameters:
  • cpu_architecture (Optional[str]) – The vCPU architecture. The default value is X86_64 . Valid values are X86_64 and ARM64 . .. epigraph:: This parameter must be set to X86_64 for Windows containers. > Fargate Spot is not supported for ARM64 and Windows-based containers on Fargate. A job queue will be blocked if a Fargate ARM64 or Windows job is submitted to a job queue with only Fargate Spot compute environments. However, you can attach both FARGATE and FARGATE_SPOT compute environments to the same job queue.

  • operating_system_family (Optional[str]) – The operating system for the compute environment. Valid values are: LINUX (default), WINDOWS_SERVER_2019_CORE , WINDOWS_SERVER_2019_FULL , WINDOWS_SERVER_2022_CORE , and WINDOWS_SERVER_2022_FULL . .. epigraph:: The following parameters can’t be set for Windows containers: linuxParameters , privileged , user , ulimits , readonlyRootFilesystem , and efsVolumeConfiguration . > The AWS Batch Scheduler checks the compute environments that are attached to the job queue before registering a task definition with Fargate. In this scenario, the job queue is where the job is submitted. If the job requires a Windows container and the first compute environment is LINUX , the compute environment is skipped and the next compute environment is checked until a Windows-based compute environment is found. > Fargate Spot is not supported for ARM64 and Windows-based containers on Fargate. A job queue will be blocked if a Fargate ARM64 or Windows job is submitted to a job queue with only Fargate Spot compute environments. However, you can attach both FARGATE and FARGATE_SPOT compute environments to the same job queue.

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

runtime_platform_property = batch.CfnJobDefinition.RuntimePlatformProperty(
    cpu_architecture="cpuArchitecture",
    operating_system_family="operatingSystemFamily"
)

Attributes

cpu_architecture

The vCPU architecture. The default value is X86_64 . Valid values are X86_64 and ARM64 .

This parameter must be set to X86_64 for Windows containers. > Fargate Spot is not supported for ARM64 and Windows-based containers on Fargate. A job queue will be blocked if a Fargate ARM64 or Windows job is submitted to a job queue with only Fargate Spot compute environments. However, you can attach both FARGATE and FARGATE_SPOT compute environments to the same job queue.

See:

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

operating_system_family

The operating system for the compute environment.

Valid values are: LINUX (default), WINDOWS_SERVER_2019_CORE , WINDOWS_SERVER_2019_FULL , WINDOWS_SERVER_2022_CORE , and WINDOWS_SERVER_2022_FULL . .. epigraph:

The following parameters can’t be set for Windows containers: ``linuxParameters`` , ``privileged`` , ``user`` , ``ulimits`` , ``readonlyRootFilesystem`` , and ``efsVolumeConfiguration`` . > The AWS Batch Scheduler checks the compute environments that are attached to the job queue before registering a task definition with Fargate. In this scenario, the job queue is where the job is submitted. If the job requires a Windows container and the first compute environment is ``LINUX`` , the compute environment is skipped and the next compute environment is checked until a Windows-based compute environment is found. > Fargate Spot is not supported for ``ARM64`` and Windows-based containers on Fargate. A job queue will be blocked if a Fargate ``ARM64`` or Windows job is submitted to a job queue with only Fargate Spot compute environments. However, you can attach both ``FARGATE`` and ``FARGATE_SPOT`` compute environments to the same job queue.
See:

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

SecretProperty

class CfnJobDefinition.SecretProperty(*, name, value_from)

Bases: object

An object that represents 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 Amazon Resource Name (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 Amazon Resource Name (ARN) or name of the parameter. If the parameter exists in a different Region, then the full ARN must be specified.

See:

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.
from aws_cdk import aws_batch as batch

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

Attributes

name

The name of the secret.

See:

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

value_from

The secret to expose to the container.

The supported values are either the full Amazon Resource Name (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 Amazon Resource Name (ARN) or name of the parameter. If the parameter exists in a different Region, then the full ARN must be specified.
See:

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

SecurityContextProperty

class CfnJobDefinition.SecurityContextProperty(*, allow_privilege_escalation=None, privileged=None, read_only_root_filesystem=None, run_as_group=None, run_as_non_root=None, run_as_user=None)

Bases: object

Parameters:
  • allow_privilege_escalation (Union[bool, IResolvable, None]) –

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

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

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

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

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

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

security_context_property = batch.CfnJobDefinition.SecurityContextProperty(
    allow_privilege_escalation=False,
    privileged=False,
    read_only_root_filesystem=False,
    run_as_group=123,
    run_as_non_root=False,
    run_as_user=123
)

Attributes

allow_privilege_escalation

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

Type:

see

privileged

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

Type:

see

read_only_root_filesystem

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

Type:

see

run_as_group

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

Type:

see

run_as_non_root

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

Type:

see

run_as_user

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

Type:

see

TaskContainerDependencyProperty

class CfnJobDefinition.TaskContainerDependencyProperty(*, condition, container_name)

Bases: object

A list of containers that this task depends on.

Parameters:
  • condition (str) – The dependency condition of the container. The following are the available conditions and their behavior:. - START - This condition emulates the behavior of links and volumes today. It validates that a dependent container is started before permitting other containers to start. - COMPLETE - This condition validates that a dependent container runs to completion (exits) before permitting other containers to start. This can be useful for nonessential containers that run a script and then exit. This condition can’t be set on an essential container. - SUCCESS - This condition is the same as COMPLETE , but it also requires that the container exits with a zero status. This condition can’t be set on an essential container.

  • container_name (str) – A unique identifier for the container.

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

task_container_dependency_property = batch.CfnJobDefinition.TaskContainerDependencyProperty(
    condition="condition",
    container_name="containerName"
)

Attributes

condition

.

  • START - This condition emulates the behavior of links and volumes today. It validates that a dependent container is started before permitting other containers to start.

  • COMPLETE - This condition validates that a dependent container runs to completion (exits) before permitting other containers to start. This can be useful for nonessential containers that run a script and then exit. This condition can’t be set on an essential container.

  • SUCCESS - This condition is the same as COMPLETE , but it also requires that the container exits with a zero status. This condition can’t be set on an essential container.

See:

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

Type:

The dependency condition of the container. The following are the available conditions and their behavior

container_name

A unique identifier for the container.

See:

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

TaskContainerPropertiesProperty

class CfnJobDefinition.TaskContainerPropertiesProperty(*, image, command=None, depends_on=None, environment=None, essential=None, linux_parameters=None, log_configuration=None, mount_points=None, name=None, privileged=None, readonly_root_filesystem=None, repository_credentials=None, resource_requirements=None, secrets=None, ulimits=None, user=None)

Bases: object

Container properties are used for Amazon ECS-based job definitions.

These properties 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. By default, images in the Docker Hub registry are available. Other repositories are specified with either repository-url/image:tag or repository-url/image@digest . 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 the *docker run* .

  • 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 Dockerfile reference: CMD .

  • depends_on (Union[IResolvable, Sequence[Union[IResolvable, TaskContainerDependencyProperty, Dict[str, Any]]], None]) – A list of containers that this container depends on.

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

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

  • essential (Union[bool, IResolvable, None]) – If the essential parameter of a container is marked as true , and that container fails or stops for any reason, all other containers that are part of the task are stopped. If the essential parameter of a container is marked as false, its failure doesn’t affect the rest of the containers in a task. If this parameter is omitted, a container is assumed to be essential. All jobs must have at least one essential container. If you have an application that’s composed of multiple containers, group containers that are used for a common purpose into components, and separate the different components into multiple task definitions. For more information, see Application Architecture 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 Linux kernel capabilities. For more information, see KernelCapabilities .

  • 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 can 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 about the options for different supported log drivers, see Configure logging drivers in the Docker documentation . .. epigraph:: Amazon ECS currently supports a subset of the logging drivers available to the Docker daemon (shown in the LogConfiguration data type). Additional log drivers may be available in future releases of the Amazon ECS container agent. 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 in to your container instance and run the following command: sudo docker version --format '{{.Server.APIVersion}}' .. 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 .

  • 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 . Windows containers can mount whole directories on the same drive as $env:ProgramData . Windows containers can’t mount directories on a different drive, and mount point can’t be across drives.

  • name (Optional[str]) – The name of a container. The name can be used as a unique identifier to target your dependsOn and Overrides objects.

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

    When this parameter is true , the container is given elevated privileges 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 . .. epigraph:: This parameter is not supported for Windows containers or tasks run on Fargate.

  • 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 . .. epigraph:: This parameter is not supported for Windows containers.

  • repository_credentials (Union[IResolvable, RepositoryCredentialsProperty, Dict[str, Any], None]) – The private repository authentication credentials to use.

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

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

    The secrets to pass to the container. For more information, see Specifying Sensitive Data in the Amazon Elastic Container Service Developer Guide.

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

    A list of ulimits to set in the container. If a ulimit value is specified in a task definition, it overrides the default values set by Docker. This parameter maps to Ulimits in the Create a container section of the Docker Remote API and the --ulimit option to docker run . Amazon ECS tasks hosted on Fargate use the default resource limit values set by the operating system with the exception of the nofile resource limit parameter which Fargate overrides. The nofile resource limit sets a restriction on the number of open files that a container can use. The default nofile soft limit is 1024 and the default hard limit is 65535 . 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 in to your container instance and run the following command: sudo docker version --format '{{.Server.APIVersion}}' .. epigraph:: This parameter is not supported for Windows containers.

  • user (Optional[str]) – The user 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. .. epigraph:: When running tasks using the host network mode, don’t run containers using the root user (UID 0) . We recommend using a non-root user for better security. You can specify the user using the following formats. If specifying a UID or GID, you must specify it as a positive integer. - user - user:group - uid - uid:gid - user:gi - uid:group .. epigraph:: This parameter is not supported for Windows containers.

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

# options: Any

task_container_properties_property = batch.CfnJobDefinition.TaskContainerPropertiesProperty(
    image="image",

    # the properties below are optional
    command=["command"],
    depends_on=[batch.CfnJobDefinition.TaskContainerDependencyProperty(
        condition="condition",
        container_name="containerName"
    )],
    environment=[batch.CfnJobDefinition.EnvironmentProperty(
        name="name",
        value="value"
    )],
    essential=False,
    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"
        )]
    ),
    mount_points=[batch.CfnJobDefinition.MountPointsProperty(
        container_path="containerPath",
        read_only=False,
        source_volume="sourceVolume"
    )],
    name="name",
    privileged=False,
    readonly_root_filesystem=False,
    repository_credentials=batch.CfnJobDefinition.RepositoryCredentialsProperty(
        credentials_parameter="credentialsParameter"
    ),
    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"
)

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 Dockerfile reference: CMD .

See:

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

depends_on

A list of containers that this container depends on.

See:

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

environment

The environment variables to pass to a container.

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

We don't recommend using plaintext environment variables for sensitive information, such as credential data. > Environment variables cannot start with ``AWS_BATCH`` . This naming convention is reserved for variables that AWS Batch sets.
See:

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

essential

If the essential parameter of a container is marked as true , and that container fails or stops for any reason, all other containers that are part of the task are stopped.

If the essential parameter of a container is marked as false, its failure doesn’t affect the rest of the containers in a task. If this parameter is omitted, a container is assumed to be essential.

All jobs must have at least one essential container. If you have an application that’s composed of multiple containers, group containers that are used for a common purpose into components, and separate the different components into multiple task definitions. For more information, see Application Architecture in the Amazon Elastic Container Service Developer Guide .

See:

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

image

The image used to start a container.

This string is passed directly to the Docker daemon. By default, images in the Docker Hub registry are available. Other repositories are specified with either repository-url/image:tag or repository-url/image@digest . 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 the *docker run* .

See:

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

linux_parameters

Linux-specific modifications that are applied to the container, such as Linux kernel capabilities.

For more information, see KernelCapabilities .

See:

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

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 can 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 about the options for different supported log drivers, see Configure logging drivers in the Docker documentation . .. epigraph:

Amazon ECS currently supports a subset of the logging drivers available to the Docker daemon (shown in the ``LogConfiguration`` data type). Additional log drivers may be available in future releases of the Amazon ECS container agent.

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 in to your container instance and run the following command: sudo docker version --format '{{.Server.APIVersion}}' .. 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* .
See:

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

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 .

Windows containers can mount whole directories on the same drive as $env:ProgramData . Windows containers can’t mount directories on a different drive, and mount point can’t be across drives.

See:

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

name

The name of a container.

The name can be used as a unique identifier to target your dependsOn and Overrides objects.

See:

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

privileged

When this parameter is true , the container is given elevated privileges 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 . .. epigraph:

This parameter is not supported for Windows containers or tasks run on Fargate.
See:

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

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 . .. epigraph:

This parameter is not supported for Windows containers.
See:

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

repository_credentials

The private repository authentication credentials to use.

See:

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

resource_requirements

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

The only supported resource is a GPU.

See:

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

secrets

The secrets to pass to the container.

For more information, see Specifying Sensitive Data in the Amazon Elastic Container Service Developer Guide.

See:

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

ulimits

A list of ulimits to set in the container.

If a ulimit value is specified in a task definition, it overrides the default values set by Docker. This parameter maps to Ulimits in the Create a container section of the Docker Remote API and the --ulimit option to docker run .

Amazon ECS tasks hosted on Fargate use the default resource limit values set by the operating system with the exception of the nofile resource limit parameter which Fargate overrides. The nofile resource limit sets a restriction on the number of open files that a container can use. The default nofile soft limit is 1024 and the default hard limit is 65535 .

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 in to your container instance and run the following command: sudo docker version --format '{{.Server.APIVersion}}' .. epigraph:

This parameter is not supported for Windows containers.
See:

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

user

The user 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. .. epigraph:

When running tasks using the ``host`` network mode, don't run containers using the ``root user (UID 0)`` . We recommend using a non-root user for better security.

You can specify the user using the following formats. If specifying a UID or GID, you must specify it as a positive integer.

  • user

  • user:group

  • uid

  • uid:gid

  • user:gi

  • uid:group

This parameter is not supported for Windows containers.

See:

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

TimeoutProperty

class CfnJobDefinition.TimeoutProperty(*, attempt_duration_seconds=None)

Bases: object

An object that represents a job timeout configuration.

Parameters:

attempt_duration_seconds (Union[int, float, None]) – The job timeout time (in seconds) that’s measured from the job attempt’s startedAt timestamp. After this time passes, AWS Batch terminates your jobs if they aren’t finished. The minimum value for the timeout is 60 seconds. For array jobs, the timeout applies to the child jobs, not to the parent array job. For multi-node parallel (MNP) jobs, the timeout applies to the whole job, not to the individual nodes.

See:

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.
from aws_cdk import aws_batch as batch

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

Attributes

attempt_duration_seconds

The job timeout time (in seconds) that’s measured from the job attempt’s startedAt timestamp.

After this time passes, AWS Batch terminates your jobs if they aren’t finished. The minimum value for the timeout is 60 seconds.

For array jobs, the timeout applies to the child jobs, not to the parent array job.

For multi-node parallel (MNP) jobs, the timeout applies to the whole job, not to the individual nodes.

See:

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

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

See:

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.
from aws_cdk import 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.

See:

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

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

See:

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

size

The size (in MiB) of the tmpfs volume.

See:

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

UlimitProperty

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

Bases: object

The ulimit settings to pass to the container. For more information, see Ulimit .

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 . Valid values are: core | cpu | data | fsize | locks | memlock | msgqueue | nice | nofile | nproc | rss | rtprio | rttime | sigpending | stack .

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

See:

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.
from aws_cdk import 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.

See:

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

name

The type of the ulimit .

Valid values are: core | cpu | data | fsize | locks | memlock | msgqueue | nice | nofile | nproc | rss | rtprio | rttime | sigpending | stack .

See:

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

soft_limit

The soft limit for the ulimit type.

See:

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

VolumesHostProperty

class CfnJobDefinition.VolumesHostProperty(*, source_path=None)

Bases: object

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

If this 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 that are 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. Don’t provide this for these jobs.

See:

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.
from aws_cdk import 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. Don't provide this for these jobs.
See:

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

VolumesProperty

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

Bases: object

A list of volumes that are 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’s 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 that are 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 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_). This name is referenced in the sourceVolume parameter of container definition mountPoints .

See:

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.
from aws_cdk import 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 .

See:

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

host

The contents of the host parameter determine whether your data volume persists on the host container instance and where it’s 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 that are associated with it stop running. .. epigraph:

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

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

name

The name of the volume.

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

See:

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