CfnJobDefinition
- class aws_cdk.aws_batch.CfnJobDefinition(scope, id, *, type, consumable_resource_properties=None, 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 consumable_resource_properties: :py:data:`~typing.Union`\[:py:class:`~aws_cdk.IResolvable`, :py:class:`~aws_cdk.aws_batch.CfnJobDefinition.ConsumableResourcePropertiesProperty`, :py:class:`~typing.Dict`\[:py:class:`str`, :py:data:`~typing.Any`], :py:obj:`None`] :param consumable_resource_properties: Contains a list of consumable resources required by the job. :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.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.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
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 prefixpath
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 toaddOverride
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: truedefault (
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:
- 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:
- get_metadata(key)
Retrieve a value value from the CloudFormation Resource Metadata.
- Parameters:
key (
str
) –- See:
- Return type:
Any
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:
target (
CfnResource
) – The dependency to replace.new_target (
CfnResource
) – The new dependency to add.
- Return type:
None
- to_string()
Returns a string representation of this construct.
- Return type:
str
- Returns:
a string representation of this resource
Attributes
- CFN_RESOURCE_TYPE_NAME = 'AWS::Batch::JobDefinition'
- cfn_options
Options for this resource, such as condition, update policy etc.
- cfn_resource_type
AWS resource type.
- consumable_resource_properties
Contains a list of consumable resources required by the job.
- 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 tocontainerProperties
,eksProperties
, ornodeProperties
.
- 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 detectConstruct
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 classConstruct
in each copy of theconstructs
library is seen as a different class, and an instance of one class will not test asinstanceof
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 theconstructs
library can be accidentally installed, andinstanceof
will behave unpredictably. It is safest to avoid usinginstanceof
, 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 extendsConstruct
.
ConsumableResourcePropertiesProperty
- class CfnJobDefinition.ConsumableResourcePropertiesProperty(*, consumable_resource_list)
Bases:
object
Contains a list of consumable resources required by a job.
- Parameters:
consumable_resource_list (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,ConsumableResourceRequirementProperty
,Dict
[str
,Any
]]]]) – The list of consumable resources required by a job.- See:
- 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 consumable_resource_properties_property = batch.CfnJobDefinition.ConsumableResourcePropertiesProperty( consumable_resource_list=[batch.CfnJobDefinition.ConsumableResourceRequirementProperty( consumable_resource="consumableResource", quantity=123 )] )
Attributes
- consumable_resource_list
The list of consumable resources required by a job.
ConsumableResourceRequirementProperty
- class CfnJobDefinition.ConsumableResourceRequirementProperty(*, consumable_resource, quantity)
Bases:
object
Information about a consumable resource required to run a job.
- Parameters:
consumable_resource (
str
) – The name or ARN of the consumable resource.quantity (
Union
[int
,float
]) – The quantity of the consumable resource that is needed.
- See:
- 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 consumable_resource_requirement_property = batch.CfnJobDefinition.ConsumableResourceRequirementProperty( consumable_resource="consumableResource", quantity=123 )
Attributes
- consumable_resource
The name or ARN of the consumable resource.
- quantity
The quantity of the consumable resource that is needed.
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 toImage
in the Create a container section of the Docker Remote API and theIMAGE
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 fullregistry/repository[:tag]
orregistry/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
ormongo
). - 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 theCOMMAND
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
]) –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 theECS_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, useresourceRequirements
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 toPrivileged
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 todocker 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 includeGPU
,MEMORY
, andVCPU
.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 toUlimits
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 toCpuShares
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:
- 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 theCOMMAND
parameter to docker run . For more information, see https://docs.docker.com/engine/reference/builder/#cmd .
- 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.
- 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 .
- 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 .
- 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.
- 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 toImage
in the Create a container section of the Docker Remote API and theIMAGE
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]
orregistry/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
ormongo
).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
).
- instance_type
-
- Type:
see
- 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 .
- linux_parameters
Linux-specific modifications that are applied to the container, such as details for device mappings.
- 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* .
- 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.
- 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 .
- 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.
- 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.
- 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 todocker run
.
- repository_credentials
The private repository authentication credentials to use.
- resource_requirements
The type and amount of resources to assign to a container.
The supported resources include
GPU
,MEMORY
, andVCPU
.
- runtime_platform
An object that represents the compute environment architecture for AWS Batch jobs on Fargate.
- secrets
The secrets for the container.
For more information, see Specifying sensitive data in the AWS Batch User Guide .
- 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.
- 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 .
- 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.
- volumes
A list of data volumes used in a job.
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, thehostPath
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 forread
,write
, andmknod
for the device.
- See:
- 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.
- host_path
The path for the device on the host container instance.
- permissions
The explicit permissions to provide to the container for the device.
By default, the container has permissions for
read
,write
, andmknod
for the device.
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 task element. However, the task element can run up to 10 containers.- See:
- 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.MountPointProperty( 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 task element. However, the task element can run up to 10 containers.
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 arehost
,task
, ornone
. Ifhost
is specified, all containers within the tasks that specified thehost
IPC mode on the same container instance share the same IPC resources with the host Amazon EC2 instance. Iftask
is specified, all containers within the specifiedtask
share the same IPC resources. Ifnone
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 arehost
ortask
. For example, monitoring sidecars might needpidMode
to access information about other containers running in the same task. Ifhost
is specified, all containers within the tasks that specified thehost
PID mode on the same container instance share the process namespace with the host Amazon EC2 instance. Iftask
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, theLATEST
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:
- 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.MountPointProperty( 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.
- 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 .
- 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 .
- ipc_mode
The IPC resource namespace to use for the containers in the task.
The valid values are
host
,task
, ornone
.If
host
is specified, all containers within the tasks that specified thehost
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 specifiedtask
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
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
The process namespace to use for the containers in the task.
The valid values are
host
ortask
. For example, monitoring sidecars might needpidMode
to access information about other containers running in the same task.If
host
is specified, all containers within the tasks that specified thehost
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
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
An object that represents the compute environment architecture for AWS Batch jobs on Fargate.
- task_role_arn
The Amazon Resource Name (ARN) that’s associated with the Amazon ECS task.
This is object is comparable to ContainerProperties:jobRoleArn .
- volumes
A list of volumes that are associated with the job.
EfsVolumeConfigurationProperty
- class CfnJobDefinition.EfsVolumeConfigurationProperty(*, file_system_id, authorization_config=None, root_directory=None, transit_encryption=None, transit_encryption_port=None)
Bases:
object
- Parameters:
file_system_id (
str
) –authorization_config (
Union
[IResolvable
,AuthorizationConfigProperty
,Dict
[str
,Any
],None
]) –root_directory (
Optional
[str
]) –transit_encryption (
Optional
[str
]) –transit_encryption_port (
Union
[int
,float
,None
]) –
- See:
- 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
-
- Type:
see
- file_system_id
-
- Type:
see
- root_directory
-
- Type:
see
- transit_encryption
-
- Type:
see
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:
- 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.
- value
The value of the environment variable.
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, theCMD
of the container image is used. This corresponds to theargs
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 theNAME1
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 theVAR_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 theNAME1
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 theVAR_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 areAlways
,IfNotPresent
, andNever
. This parameter defaults toIfNotPresent
. However, if the:latest
tag is specified, it defaults toAlways
. 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 includememory
,cpu
, andnvidia.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 supportsemptyDir
,hostPath
, andsecret
volume types. For more information about volumes and volume mounts in Kubernetes, see Volumes in the Kubernetes documentation .
- See:
- 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, sub_path="subPath" )] )
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 theargs
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 theNAME1
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 theVAR_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
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 theNAME1
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 theVAR_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
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.
- image
The Docker image used to start the container.
- image_pull_policy
The image pull policy for the container.
Supported values are
Always
,IfNotPresent
, andNever
. This parameter defaults toIfNotPresent
. However, if the:latest
tag is specified, it defaults toAlways
. For more information, see Updating images in the Kubernetes documentation .
- 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.
- resources
The type and amount of resources to assign to a container.
The supported resources include
memory
,cpu
, andnvidia.com/gpu
. For more information, see Resource management for pods and containers in the Kubernetes documentation .
- 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 .
EksContainerVolumeMountProperty
- class CfnJobDefinition.EksContainerVolumeMountProperty(*, mount_path=None, name=None, read_only=None, sub_path=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 istrue
, the container has read-only access to the volume. Otherwise, the container can write to the volume. The default value isfalse
.sub_path (
Optional
[str
]) – A sub-path inside the referenced volume instead of its root.
- See:
- 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, sub_path="subPath" )
Attributes
- mount_path
The path on the container where the volume is mounted.
- name
The name the volume mount.
This must match the name of one of the volumes in the pod.
- 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
.
- sub_path
A sub-path inside the referenced volume instead of its root.
EksPersistentVolumeClaimProperty
- class CfnJobDefinition.EksPersistentVolumeClaimProperty(*, claim_name, read_only=None)
Bases:
object
A
persistentVolumeClaim
volume is used to mount a PersistentVolume into a Pod. PersistentVolumeClaims are a way for users to “claim” durable storage without knowing the details of the particular cloud environment. See the information about PersistentVolumes in the Kubernetes documentation .- Parameters:
claim_name (
str
) – The name of thepersistentVolumeClaim
bounded to apersistentVolume
. For more information, see Persistent Volume Claims in the Kubernetes documentation .read_only (
Union
[bool
,IResolvable
,None
]) – An optional boolean value indicating if the mount is read only. Default is false. For more information, see Read Only Mounts in the Kubernetes documentation .
- See:
- 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_persistent_volume_claim_property = batch.CfnJobDefinition.EksPersistentVolumeClaimProperty( claim_name="claimName", # the properties below are optional read_only=False )
Attributes
- claim_name
The name of the
persistentVolumeClaim
bounded to apersistentVolume
.For more information, see Persistent Volume Claims in the Kubernetes documentation .
- read_only
An optional boolean value indicating if the mount is read only.
Default is false. For more information, see Read Only Mounts in the Kubernetes documentation .
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:
- 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, sub_path="subPath" )] )], 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, sub_path="subPath" )] )], 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" ), persistent_volume_claim=batch.CfnJobDefinition.EksPersistentVolumeClaimProperty( claim_name="claimName", # the properties below are optional read_only=False ), 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.
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:
- 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.
- 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 .
EksVolumeProperty
- class CfnJobDefinition.EksVolumeProperty(*, name, empty_dir=None, host_path=None, persistent_volume_claim=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 KubernetesemptyDir
volume. For more information, see emptyDir in the Kubernetes documentation .host_path (
Union
[IResolvable
,HostPathProperty
,Dict
[str
,Any
],None
]) – Specifies the configuration of a KuberneteshostPath
volume. For more information, see hostPath in the Kubernetes documentation .persistent_volume_claim (
Union
[IResolvable
,EksPersistentVolumeClaimProperty
,Dict
[str
,Any
],None
]) –Specifies the configuration of a Kubernetes
persistentVolumeClaim
bounded to apersistentVolume
. For more information, see Persistent Volume Claims 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:
- 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" ), persistent_volume_claim=batch.CfnJobDefinition.EksPersistentVolumeClaimProperty( claim_name="claimName", # the properties below are optional read_only=False ), 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 .
- host_path
Specifies the configuration of a Kubernetes
hostPath
volume.For more information, see hostPath in the Kubernetes documentation .
- 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 .
- persistent_volume_claim
Specifies the configuration of a Kubernetes
persistentVolumeClaim
bounded to apersistentVolume
.For more information, see Persistent Volume Claims in the Kubernetes documentation .
EmptyDirProperty
- class CfnJobDefinition.EmptyDirProperty(*, medium=None, size_limit=None)
Bases:
object
- Parameters:
medium (
Optional
[str
]) –size_limit (
Optional
[str
]) –
- See:
- 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
-
- 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:
- 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.
- value
The value of the environment variable.
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 is21
GiB and the maximum supported value is200
GiB.- See:
- 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 is200
GiB.
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
orEXIT
) if all conditions are met.If none of the
EvaluateOnExit
conditions in aRetryStrategy
match, then the job is retried.- Parameters:
action (
str
) – Specifies the action to take if all of the specified conditions (onStatusReason
,onReason
, andonExitCode
) are met. The values aren’t case sensitive.on_exit_code (
Optional
[str
]) – Contains a glob pattern to match against the decimal representation of theExitCode
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 theReason
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 theStatusReason
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:
- 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
, andonExitCode
) are met.The values aren’t case sensitive.
- 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.
- 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.
- 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.
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:
- 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 .
HostPathProperty
- class CfnJobDefinition.HostPathProperty(*, path=None)
Bases:
object
- Parameters:
path (
Optional
[str
]) –- See:
- 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
ImagePullSecretProperty
- class CfnJobDefinition.ImagePullSecretProperty(*, name=None)
Bases:
object
References a Kubernetes secret resource.
This name of the secret must start and end with an alphanumeric character, is required to be lowercase, can include periods (.) and hyphens (-), and can’t contain more than 253 characters.
- Parameters:
name (
Optional
[str
]) – Provides a unique identifier for theImagePullSecret
. This object is required whenEksPodProperties$imagePullSecrets
is used.- See:
- 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
Provides a unique identifier for the
ImagePullSecret
.This object is required when
EksPodProperties$imagePullSecrets
is used.
JobTimeoutProperty
- class CfnJobDefinition.JobTimeoutProperty(*, 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’sstartedAt
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:
- 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 job_timeout_property = batch.CfnJobDefinition.JobTimeoutProperty( 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.
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 themaxSwap
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 amaxSwap
value of0
is specified, the container doesn’t use swap. Accepted values are0
or any positive integer. If themaxSwap
parameter is omitted, the container doesn’t use the swap configuration for the container instance on which it runs. AmaxSwap
value must be set for theswappiness
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 of0
causes swapping to not occur unless absolutely necessary. Aswappiness
value of100
causes pages to be swapped aggressively. Valid values are whole numbers between0
and100
. If theswappiness
parameter isn’t specified, a default value of60
is used. If a value isn’t specified formaxSwap
, then this parameter is ignored. IfmaxSwap
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 themaxSwap
andswappiness
parameters are omitted from a job definition, each container has a defaultswappiness
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:
- 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.
- 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"
- 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 themaxSwap
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 of0
is specified, the container doesn’t use swap. Accepted values are0
or any positive integer. If themaxSwap
parameter is omitted, the container doesn’t use the swap configuration for the container instance on which it runs. AmaxSwap
value must be set for theswappiness
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.
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
You can use this parameter to tune a container’s memory swappiness behavior.
A
swappiness
value of0
causes swapping to not occur unless absolutely necessary. Aswappiness
value of100
causes pages to be swapped aggressively. Valid values are whole numbers between0
and100
. If theswappiness
parameter isn’t specified, a default value of60
is used. If a value isn’t specified formaxSwap
, then this parameter is ignored. IfmaxSwap
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
andswappiness
parameters are omitted from a job definition, each container has a defaultswappiness
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.
- 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.
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 areawslogs
,fluentd
,gelf
,json-file
,journald
,logentries
,syslog
, andsplunk
. .. epigraph:: Jobs that are running on Fargate resources are restricted to theawslogs
andsplunk
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 (
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:
- 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
, andsplunk
. .. 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"
- 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"
- secret_options
The secrets to pass to the log configuration.
For more information, see Specifying sensitive data in the AWS Batch User Guide .
MetadataProperty
- class CfnJobDefinition.MetadataProperty(*, labels=None)
Bases:
object
- Parameters:
labels (
Any
) –- See:
- 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
MountPointProperty
- class CfnJobDefinition.MountPointProperty(*, 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 istrue
, the container has read-only access to the volume. Otherwise, the container can write to the volume. The default value isfalse
.source_volume (
Optional
[str
]) – The name of the volume to mount.
- See:
- 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_point_property = batch.CfnJobDefinition.MountPointProperty( container_path="containerPath", read_only=False, source_volume="sourceVolume" )
Attributes
- container_path
The path on the container where the host volume is mounted.
- 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
.
- source_volume
The name of the volume to mount.
MountPointsProperty
- class CfnJobDefinition.MountPointsProperty(*, container_path=None, read_only=None, source_volume=None)
Bases:
object
- Parameters:
container_path (
Optional
[str
]) –read_only (
Union
[bool
,IResolvable
,None
]) –source_volume (
Optional
[str
]) –
- See:
- 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
-
- Type:
see
- read_only
-
- Type:
see
MultiNodeEcsPropertiesProperty
- class CfnJobDefinition.MultiNodeEcsPropertiesProperty(*, 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
,MultiNodeEcsTaskPropertiesProperty
,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 task element. However, the task element can run up to 10 containers.- See:
- 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 multi_node_ecs_properties_property = batch.CfnJobDefinition.MultiNodeEcsPropertiesProperty( task_properties=[batch.CfnJobDefinition.MultiNodeEcsTaskPropertiesProperty( 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.MountPointProperty( 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" )], execution_role_arn="executionRoleArn", ipc_mode="ipcMode", pid_mode="pidMode", 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 task element. However, the task element can run up to 10 containers.
MultiNodeEcsTaskPropertiesProperty
- class CfnJobDefinition.MultiNodeEcsTaskPropertiesProperty(*, containers=None, execution_role_arn=None, ipc_mode=None, pid_mode=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.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
, ornone
. Ifhost
is specified, all containers within the tasks that specified thehost
IPC mode on the same container instance share the same IPC resources with the host Amazon EC2 instance. Iftask
is specified, all containers within the specifiedtask
share the same IPC resources. Ifnone
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.pid_mode (
Optional
[str
]) –The process namespace to use for the containers in the task. The valid values are
host
ortask
. For example, monitoring sidecars might needpidMode
to access information about other containers running in the same task. Ifhost
is specified, all containers within the tasks that specified thehost
PID mode on the same container instance share the process namespace with the host Amazon EC2 instance. Iftask
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.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:
- 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 multi_node_ecs_task_properties_property = batch.CfnJobDefinition.MultiNodeEcsTaskPropertiesProperty( 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.MountPointProperty( 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" )], execution_role_arn="executionRoleArn", ipc_mode="ipcMode", pid_mode="pidMode", 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.
- 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 .
- ipc_mode
The IPC resource namespace to use for the containers in the task.
The valid values are
host
,task
, ornone
.If
host
is specified, all containers within the tasks that specified thehost
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 specifiedtask
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.
- pid_mode
The process namespace to use for the containers in the task.
The valid values are
host
ortask
. For example, monitoring sidecars might needpidMode
to access information about other containers running in the same task.If
host
is specified, all containers within the tasks that specified thehost
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.
- task_role_arn
The Amazon Resource Name (ARN) that’s associated with the Amazon ECS task.
This is object is comparable to ContainerProperties:jobRoleArn .
- volumes
A list of volumes that are associated with the job.
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:
- 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
“.
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:
- 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 # options: Any # requests: Any node_properties_property = batch.CfnJobDefinition.NodePropertiesProperty( main_node=123, node_range_properties=[batch.CfnJobDefinition.NodeRangePropertyProperty( target_nodes="targetNodes", # the properties below are optional consumable_resource_properties=batch.CfnJobDefinition.ConsumableResourcePropertiesProperty( consumable_resource_list=[batch.CfnJobDefinition.ConsumableResourceRequirementProperty( consumable_resource="consumableResource", quantity=123 )] ), 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.MultiNodeEcsPropertiesProperty( task_properties=[batch.CfnJobDefinition.MultiNodeEcsTaskPropertiesProperty( 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.MountPointProperty( 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" )], execution_role_arn="executionRoleArn", ipc_mode="ipcMode", pid_mode="pidMode", 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" )] )] ), 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( 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, sub_path="subPath" )] )], 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, sub_path="subPath" )] )], 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" ), persistent_volume_claim=batch.CfnJobDefinition.EksPersistentVolumeClaimProperty( claim_name="claimName", # the properties below are optional read_only=False ), secret=batch.CfnJobDefinition.EksSecretProperty( secret_name="secretName", # the properties below are optional optional=False ) )] ) ), 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.
- node_range_properties
A list of node ranges and their properties that are associated with a multi-node parallel job.
- num_nodes
The number of nodes that are associated with a multi-node parallel job.
NodeRangePropertyProperty
- class CfnJobDefinition.NodeRangePropertyProperty(*, target_nodes, consumable_resource_properties=None, container=None, ecs_properties=None, eks_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 of0:3
indicates nodes with index values of0
through3
. If the starting range value is omitted (:n
), then0
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
and4:5
). In this case, the4:5
range properties override the0:10
properties.consumable_resource_properties (
Union
[IResolvable
,ConsumableResourcePropertiesProperty
,Dict
[str
,Any
],None
]) – Contains a list of consumable resources required by a job.container (
Union
[IResolvable
,ContainerPropertiesProperty
,Dict
[str
,Any
],None
]) – The container details for the node range.ecs_properties (
Union
[IResolvable
,MultiNodeEcsPropertiesProperty
,Dict
[str
,Any
],None
]) – This is an object that represents the properties of the node range for a multi-node parallel job.eks_properties (
Union
[IResolvable
,EksPropertiesProperty
,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:
- 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 # options: Any # requests: Any node_range_property_property = batch.CfnJobDefinition.NodeRangePropertyProperty( target_nodes="targetNodes", # the properties below are optional consumable_resource_properties=batch.CfnJobDefinition.ConsumableResourcePropertiesProperty( consumable_resource_list=[batch.CfnJobDefinition.ConsumableResourceRequirementProperty( consumable_resource="consumableResource", quantity=123 )] ), 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.MultiNodeEcsPropertiesProperty( task_properties=[batch.CfnJobDefinition.MultiNodeEcsTaskPropertiesProperty( 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.MountPointProperty( 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" )], execution_role_arn="executionRoleArn", ipc_mode="ipcMode", pid_mode="pidMode", 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" )] )] ), 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( 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, sub_path="subPath" )] )], 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, sub_path="subPath" )] )], 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" ), persistent_volume_claim=batch.CfnJobDefinition.EksPersistentVolumeClaimProperty( claim_name="claimName", # the properties below are optional read_only=False ), secret=batch.CfnJobDefinition.EksSecretProperty( secret_name="secretName", # the properties below are optional optional=False ) )] ) ), instance_types=["instanceTypes"] )
Attributes
- consumable_resource_properties
Contains a list of consumable resources required by a job.
- container
The container details for the node range.
- ecs_properties
This is an object that represents the properties of the node range for a multi-node parallel job.
- eks_properties
This is an object that represents the properties of the node range for a multi-node parallel job.
- 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.
- target_nodes
The range of nodes, using node index values.
A range of
0:3
indicates nodes with index values of0
through3
. If the starting range value is omitted (:n
), then0
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
and4:5
). In this case, the4:5
range properties override the0:10
properties.
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
- Parameters:
containers (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,EksContainerProperty
,Dict
[str
,Any
]]],None
]) –dns_policy (
Optional
[str
]) –host_network (
Union
[bool
,IResolvable
,None
]) –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
]) –metadata (
Union
[IResolvable
,MetadataProperty
,Dict
[str
,Any
],None
]) –service_account_name (
Optional
[str
]) –share_process_namespace (
Union
[bool
,IResolvable
,None
]) –volumes (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,EksVolumeProperty
,Dict
[str
,Any
]]],None
]) –
- See:
- 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, sub_path="subPath" )] )], 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, sub_path="subPath" )] )], 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" ), persistent_volume_claim=batch.CfnJobDefinition.EksPersistentVolumeClaimProperty( claim_name="claimName", # the properties below are optional read_only=False ), secret=batch.CfnJobDefinition.EksSecretProperty( secret_name="secretName", # the properties below are optional optional=False ) )] )
Attributes
- containers
-
- Type:
see
- dns_policy
-
- Type:
see
- host_network
-
- Type:
see
- image_pull_secrets
-
- Type:
see
- init_containers
-
- Type:
see
- metadata
-
- Type:
see
- service_account_name
-
- Type:
see
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:
- 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.
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
, andVCPU
.- Parameters:
type (
Optional
[str
]) – The type of resource to assign to a container. The supported resources includeGPU
,MEMORY
, andVCPU
.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 toMemory
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 toMemory
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, thenvalue
is the hard limit (in MiB), and must match one of the supported values and theVCPU
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 toCpuShares
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, thenvalue
must match one of the supported values and theMEMORY
values must be one of the values supported for thatVCPU
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:
- 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
, andVCPU
.
- 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 toMemory
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 theVCPU
values must be one of the values supported for that memory value.value = 512 -
VCPU
= 0.25value = 1024 -
VCPU
= 0.25 or 0.5value = 2048 -
VCPU
= 0.25, 0.5, or 1value = 3072 -
VCPU
= 0.5, or 1value = 4096 -
VCPU
= 0.5, 1, or 2value = 5120, 6144, or 7168 -
VCPU
= 1 or 2value = 8192 -
VCPU
= 1, 2, or 4value = 9216, 10240, 11264, 12288, 13312, 14336, or 15360 -
VCPU
= 2 or 4value = 16384 -
VCPU
= 2, 4, or 8value = 17408, 18432, 19456, 21504, 22528, 23552, 25600, 26624, 27648, 29696, or 30720 -
VCPU
= 4value = 20480, 24576, or 28672 -
VCPU
= 4 or 8value = 36864, 45056, 53248, or 61440 -
VCPU
= 8value = 32768, 40960, 49152, or 57344 -
VCPU
= 8 or 16value = 65536, 73728, 81920, 90112, 98304, 106496, 114688, or 122880 -
VCPU
= 16type=”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 theMEMORY
values must be one of the values supported for thatVCPU
value. The supported values are 0.25, 0.5, 1, 2, 4, 8, and 16value = 0.25 -
MEMORY
= 512, 1024, or 2048value = 0.5 -
MEMORY
= 1024, 2048, 3072, or 4096value = 1 -
MEMORY
= 2048, 3072, 4096, 5120, 6144, 7168, or 8192value = 2 -
MEMORY
= 4096, 5120, 6144, 7168, 8192, 9216, 10240, 11264, 12288, 13312, 14336, 15360, or 16384value = 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 30720value = 8 -
MEMORY
= 16384, 20480, 24576, 28672, 32768, 36864, 40960, 45056, 49152, 53248, 57344, or 61440value = 16 -
MEMORY
= 32768, 40960, 49152, 57344, 65536, 73728, 81920, 90112, 98304, 106496, 114688, or 122880
ResourcesProperty
- class CfnJobDefinition.ResourcesProperty(*, limits=None, requests=None)
Bases:
object
- Parameters:
limits (
Any
) –requests (
Any
) –
- See:
- 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
-
- 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 theRUNNABLE
status. You can specify between 1 and 10 attempts. If the value ofattempts
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 theattempts
parameter must also be specified. If none of the listed conditions match, then the job is retried.
- See:
- 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.
- 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.
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 isX86_64
. Valid values areX86_64
andARM64
. .. epigraph:: This parameter must be set toX86_64
for Windows containers. > Fargate Spot is not supported forARM64
and Windows-based containers on Fargate. A job queue will be blocked if a FargateARM64
or Windows job is submitted to a job queue with only Fargate Spot compute environments. However, you can attach bothFARGATE
andFARGATE_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
, andWINDOWS_SERVER_2022_FULL
. .. epigraph:: The following parameters can’t be set for Windows containers:linuxParameters
,privileged
,user
,ulimits
,readonlyRootFilesystem
, andefsVolumeConfiguration
. > 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 isLINUX
, 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 forARM64
and Windows-based containers on Fargate. A job queue will be blocked if a FargateARM64
or Windows job is submitted to a job queue with only Fargate Spot compute environments. However, you can attach bothFARGATE
andFARGATE_SPOT
compute environments to the same job queue.
- See:
- 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 areX86_64
andARM64
.This parameter must be set to
X86_64
for Windows containers. > Fargate Spot is not supported forARM64
and Windows-based containers on Fargate. A job queue will be blocked if a FargateARM64
or Windows job is submitted to a job queue with only Fargate Spot compute environments. However, you can attach bothFARGATE
andFARGATE_SPOT
compute environments to the same job queue.
- 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
, andWINDOWS_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.
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:
- 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.
- 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.
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:
- 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
-
- Type:
see
- privileged
-
- Type:
see
- read_only_root_filesystem
-
- Type:
see
- run_as_group
-
- Type:
see
- run_as_non_root
-
- 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 asCOMPLETE
, 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:
- 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 asCOMPLETE
, but it also requires that the container exits with a zero status. This condition can’t be set on an essential container.
- See:
- Type:
The dependency condition of the container. The following are the available conditions and their behavior
- container_name
A unique identifier for the container.
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
orrepository-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 toImage
in the Create a container section of the Docker Remote API and theIMAGE
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 theCOMMAND
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 in the 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 withAWS_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 astrue
, and that container fails or stops for any reason, all other containers that are part of the task are stopped. If theessential
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 theLogConfiguration
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 theECS_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
,MountPointProperty
,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 yourdependsOn
andOverrides
objects.privileged (
Union
[bool
,IResolvable
,None
]) –When this parameter is
true
, the container is given elevated privileges on the host container instance (similar to theroot
user). This parameter maps toPrivileged
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 aulimit
value is specified in a task definition, it overrides the default values set by Docker. This parameter maps toUlimits
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. Thenofile
resource limit sets a restriction on the number of open files that a container can use. The defaultnofile
soft limit is1024
and the default hard limit is65535
. 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 thehost
network mode, don’t run containers using theroot user (UID 0)
. We recommend using a non-root user for better security. You can specify theuser
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:
- 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.MountPointProperty( 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 theCOMMAND
parameter to docker run . For more information, see Dockerfile reference: CMD .
- depends_on
A list of containers that this container depends on.
- 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
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
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 .
- 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
orrepository-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 toImage
in the Create a container section of the Docker Remote API and theIMAGE
parameter of the *docker run* .
- linux_parameters
Linux-specific modifications that are applied to the container, such as Linux kernel capabilities.
For more information, see KernelCapabilities .
- 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* .
- 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.
- name
The name of a container.
The name can be used as a unique identifier to target your
dependsOn
andOverrides
objects.
- privileged
When this parameter is
true
, the container is given elevated privileges on the host container instance (similar to theroot
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
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
The private repository authentication credentials to use.
- resource_requirements
The type and amount of a resource to assign to a container.
The only supported resource is a GPU.
- secrets
The secrets to pass to the container.
For more information, see Specifying Sensitive Data in the Amazon Elastic Container Service Developer Guide.
- 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 toUlimits
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 defaultnofile
soft limit is1024
and the default hard limit is65535
.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
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.
TimeoutProperty
- class CfnJobDefinition.TimeoutProperty(*, attempt_duration_seconds=None)
Bases:
object
- Parameters:
attempt_duration_seconds (
Union
[int
,float
,None
]) –- See:
- 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
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 thetmpfs
volume is mounted.size (
Union
[int
,float
]) – The size (in MiB) of thetmpfs
volume.mount_options (
Optional
[Sequence
[str
]]) – The list oftmpfs
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:
- 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.
- 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
“
- size
The size (in MiB) of the
tmpfs
volume.
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 theulimit
type.name (
str
) – Thetype
of theulimit
. 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 theulimit
type.
- See:
- 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.
- name
The
type
of theulimit
.Valid values are:
core
|cpu
|data
|fsize
|locks
|memlock
|msgqueue
|nice
|nofile
|nproc
|rss
|rtprio
|rttime
|sigpending
|stack
.
- soft_limit
The soft limit for the
ulimit
type.
VolumesHostProperty
- class CfnJobDefinition.VolumesHostProperty(*, source_path=None)
Bases:
object
- Parameters:
source_path (
Optional
[str
]) –- See:
- 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
VolumesProperty
- class CfnJobDefinition.VolumesProperty(*, efs_volume_configuration=None, host=None, name=None)
Bases:
object
- Parameters:
efs_volume_configuration (
Union
[IResolvable
,EfsVolumeConfigurationProperty
,Dict
[str
,Any
],None
]) –host (
Union
[IResolvable
,VolumesHostProperty
,Dict
[str
,Any
],None
]) –name (
Optional
[str
]) –
- See:
- 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
-
- Type:
see
- host
-
- Type:
see