CfnJobDefinitionProps

class aws_cdk.aws_batch.CfnJobDefinitionProps(*, type, container_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: object

Properties for defining a CfnJobDefinition.

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

  • container_properties (Union[IResolvable, ContainerPropertiesProperty, Dict[str, Any], None]) – An object with various properties specific to Amazon ECS based jobs. Valid values are containerProperties , eksProperties , and nodeProperties . Only one can be specified.

  • eks_properties (Union[IResolvable, EksPropertiesProperty, Dict[str, Any], None]) – An object with various properties that are specific to Amazon EKS based jobs. Valid values are containerProperties , eksProperties , and nodeProperties . Only one can be specified.

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

  • node_properties (Union[IResolvable, NodePropertiesProperty, Dict[str, Any], None]) – An object with various properties that are specific to multi-node parallel jobs. Valid values are containerProperties , eksProperties , and nodeProperties . Only one can be specified. .. epigraph:: If the job runs on Fargate resources, don’t specify nodeProperties . Use containerProperties instead.

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

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

  • propagate_tags (Union[bool, IResolvable, None]) – Specifies whether to propagate the tags from the job or job definition to the corresponding Amazon ECS task. If no value is specified, the tags aren’t propagated. Tags can only be propagated to the tasks 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.

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

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

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

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

Link:

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

ExampleMetadata:

fixture=_generated

Example:

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

# labels: Any
# limits: Any
# options: Any
# parameters: Any
# requests: Any
# tags: Any

cfn_job_definition_props = batch.CfnJobDefinitionProps(
    type="type",

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

        # the properties below are optional
        command=["command"],
        environment=[batch.CfnJobDefinition.EnvironmentProperty(
            name="name",
            value="value"
        )],
        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,
        resource_requirements=[batch.CfnJobDefinition.ResourceRequirementProperty(
            type="type",
            value="value"
        )],
        secrets=[batch.CfnJobDefinition.SecretProperty(
            name="name",
            value_from="valueFrom"
        )],
        ulimits=[batch.CfnJobDefinition.UlimitProperty(
            hard_limit=123,
            name="name",
            soft_limit=123
        )],
        user="user",
        vcpus=123,
        volumes=[batch.CfnJobDefinition.VolumesProperty(
            efs_volume_configuration=batch.CfnJobDefinition.EfsVolumeConfigurationProperty(
                file_system_id="fileSystemId",

                # the properties below are optional
                authorization_config=batch.CfnJobDefinition.AuthorizationConfigProperty(
                    access_point_id="accessPointId",
                    iam="iam"
                ),
                root_directory="rootDirectory",
                transit_encryption="transitEncryption",
                transit_encryption_port=123
            ),
            host=batch.CfnJobDefinition.VolumesHostProperty(
                source_path="sourcePath"
            ),
            name="name"
        )]
    ),
    eks_properties=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(
                    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,
            metadata=batch.CfnJobDefinition.MetadataProperty(
                labels=labels
            ),
            service_account_name="serviceAccountName",
            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
                )
            )]
        )
    ),
    job_definition_name="jobDefinitionName",
    node_properties=batch.CfnJobDefinition.NodePropertiesProperty(
        main_node=123,
        node_range_properties=[batch.CfnJobDefinition.NodeRangePropertyProperty(
            target_nodes="targetNodes",

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

                # the properties below are optional
                command=["command"],
                environment=[batch.CfnJobDefinition.EnvironmentProperty(
                    name="name",
                    value="value"
                )],
                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,
                resource_requirements=[batch.CfnJobDefinition.ResourceRequirementProperty(
                    type="type",
                    value="value"
                )],
                secrets=[batch.CfnJobDefinition.SecretProperty(
                    name="name",
                    value_from="valueFrom"
                )],
                ulimits=[batch.CfnJobDefinition.UlimitProperty(
                    hard_limit=123,
                    name="name",
                    soft_limit=123
                )],
                user="user",
                vcpus=123,
                volumes=[batch.CfnJobDefinition.VolumesProperty(
                    efs_volume_configuration=batch.CfnJobDefinition.EfsVolumeConfigurationProperty(
                        file_system_id="fileSystemId",

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

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

Attributes

container_properties

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

Valid values are containerProperties , eksProperties , and nodeProperties . Only one can be specified.

Link:

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

eks_properties

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

Valid values are containerProperties , eksProperties , and nodeProperties . Only one can be specified.

Link:

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

job_definition_name

The name of the job definition.

Link:

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

node_properties

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

Valid values are containerProperties , eksProperties , and nodeProperties . Only one can be specified. .. epigraph:

If the job runs on Fargate resources, don't specify ``nodeProperties`` . Use ``containerProperties`` instead.
Link:

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

parameters

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

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

Link:

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

platform_capabilities

The platform capabilities required by the job definition.

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

Link:

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

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.

Link:

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

retry_strategy

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

Link:

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

scheduling_priority

The scheduling priority of the job definition.

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

Link:

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

tags

The tags that are applied to the job definition.

Link:

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

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.

Link:

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

type

The type of job definition.

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

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

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