2026/08/20 - AWS Batch - 8 updated api methods
Changes AWS Batch now supports a new compute environment type that provides fully managed EC2 capacity with broader compute flexibility than Fargate, including GPU instances, bare metal, and specific instance type selection, without infrastructure management overhead.
{'computeResources': {'capacityTags': {'string': 'string'},
'managedInstancesProvider': {'infrastructureOptimization': {'scaleInAfter': 'integer'},
'infrastructureRoleArn': 'string',
'instanceLaunchTemplate': {'capacityOptionType': 'string',
'capacityReservations': {'reservationGroupArn': 'string',
'reservationPreference': 'string'},
'ec2InstanceProfileArn': 'string',
'fipsEnabled': 'boolean',
'instanceMetadataTagsPropagation': 'boolean',
'instanceRequirements': {'allowedInstanceTypes': ['string']},
'localStorageConfiguration': {'useLocalStorage': 'boolean'},
'monitoring': 'string',
'networkConfiguration': {'securityGroups': ['string'],
'subnets': ['string']},
'storageConfiguration': {'storageSizeGiB': 'integer'}},
'propagateTags': 'string'},
'type': {'ECS_MANAGED_INSTANCES'}}}
Creates an Batch compute environment. You can create MANAGED or UNMANAGED compute environments. MANAGED compute environments can use Amazon EC2 or Fargate resources. UNMANAGED compute environments can only use EC2 resources.
In a managed compute environment, Batch manages the capacity and instance types of the compute resources within the environment. This is based on the compute resource specification that you define or the launch template that you specify when you create the compute environment. Either, you can choose to use EC2 On-Demand Instances and EC2 Spot Instances. Or, you can use Fargate and Fargate Spot capacity in your managed compute environment. You can optionally set a maximum price so that Spot Instances only launch when the Spot Instance price is less than a specified percentage of the On-Demand price.
In an unmanaged compute environment, you can manage your own EC2 compute resources and have flexibility with how you configure your compute resources. For example, you can use custom AMIs. However, you must verify that each of your AMIs meet the Amazon ECS container instance AMI specification. For more information, see container instance AMIs in the Amazon Elastic Container Service Developer Guide. After you created your unmanaged compute environment, you can use the DescribeComputeEnvironments operation to find the Amazon ECS cluster that's associated with it. Then, launch your container instances into that Amazon ECS cluster. For more information, see Launching an Amazon ECS container instance in the Amazon Elastic Container Service Developer Guide.
See also: AWS API Documentation
Request Syntax
client.create_compute_environment(
computeEnvironmentName='string',
type='MANAGED'|'UNMANAGED',
state='ENABLED'|'DISABLED',
unmanagedvCpus=123,
computeResources={
'type': 'EC2'|'SPOT'|'FARGATE'|'FARGATE_SPOT'|'ECS_MANAGED_INSTANCES',
'allocationStrategy': 'BEST_FIT'|'BEST_FIT_PROGRESSIVE'|'BEST_FIT_PROGRESSIVE_ORDERED'|'SPOT_CAPACITY_OPTIMIZED'|'SPOT_PRICE_CAPACITY_OPTIMIZED'|'SPOT_CAPACITY_OPTIMIZED_PRIORITIZED',
'minvCpus': 123,
'maxvCpus': 123,
'desiredvCpus': 123,
'instanceTypes': [
'string',
],
'imageId': 'string',
'subnets': [
'string',
],
'securityGroupIds': [
'string',
],
'ec2KeyPair': 'string',
'instanceRole': 'string',
'tags': {
'string': 'string'
},
'placementGroup': 'string',
'bidPercentage': 123,
'spotIamFleetRole': 'string',
'launchTemplate': {
'launchTemplateId': 'string',
'launchTemplateName': 'string',
'version': 'string',
'overrides': [
{
'launchTemplateId': 'string',
'launchTemplateName': 'string',
'version': 'string',
'targetInstanceTypes': [
'string',
],
'userdataType': 'EKS_BOOTSTRAP_SH'|'EKS_NODEADM'
},
],
'userdataType': 'EKS_BOOTSTRAP_SH'|'EKS_NODEADM'
},
'ec2Configuration': [
{
'imageType': 'string',
'imageIdOverride': 'string',
'batchImageStatus': 'string',
'imageKubernetesVersion': 'string'
},
],
'scalingPolicy': {
'minScaleDownDelayMinutes': 123
},
'managedInstancesProvider': {
'propagateTags': 'string',
'infrastructureRoleArn': 'string',
'instanceLaunchTemplate': {
'ec2InstanceProfileArn': 'string',
'networkConfiguration': {
'subnets': [
'string',
],
'securityGroups': [
'string',
]
},
'instanceRequirements': {
'allowedInstanceTypes': [
'string',
]
},
'capacityOptionType': 'string',
'storageConfiguration': {
'storageSizeGiB': 123
},
'monitoring': 'string',
'fipsEnabled': True|False,
'capacityReservations': {
'reservationGroupArn': 'string',
'reservationPreference': 'string'
},
'instanceMetadataTagsPropagation': True|False,
'localStorageConfiguration': {
'useLocalStorage': True|False
}
},
'infrastructureOptimization': {
'scaleInAfter': 123
}
},
'capacityTags': {
'string': 'string'
}
},
serviceRole='string',
tags={
'string': 'string'
},
eksConfiguration={
'eksClusterArn': 'string',
'kubernetesNamespace': 'string'
},
context='string',
ecsSettings={
'containerInsights': 'ENABLED'|'ENHANCED'|'DISABLED'
}
)
string
[REQUIRED]
The name for your compute environment. It can be up to 128 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).
string
[REQUIRED]
The type of the compute environment: MANAGED or UNMANAGED. For more information, see Compute Environments in the Batch User Guide.
string
The state of the compute environment. A compute environment must be created in the ENABLED state.
If the state is ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues.
If the state is ENABLED, then the Batch scheduler can attempt to place jobs from an associated job queue on the compute resources within the environment. If the compute environment is managed, then it can scale its instances out or in automatically, based on the job queue demand.
If the state is DISABLED, then the Batch scheduler doesn't attempt to place jobs within the environment. Jobs in a STARTING or RUNNING state continue to progress normally. Managed compute environments in the DISABLED state don't scale out.
When an instance is idle, the instance scales down to the minvCpus value. However, the instance size doesn't change. For example, consider a c5.8xlarge instance with a minvCpus value of 4 and a desiredvCpus value of 36. This instance doesn't scale down to a c5.large instance.
integer
The maximum number of vCPUs for an unmanaged compute environment. This parameter is only used for fair-share scheduling to reserve vCPU capacity for new share identifiers. If this parameter isn't provided for a fair-share job queue, no vCPU capacity is reserved.
dict
Details about the compute resources managed by the compute environment. This parameter is required for managed compute environments. For more information, see Compute Environments in the Batch User Guide.
type (string) -- [REQUIRED]
The type of compute environment: EC2, SPOT, FARGATE, FARGATE_SPOT, or ECS_MANAGED_INSTANCES. For more information, see Compute environments in the Batch User Guide.
If you choose SPOT, you must also specify an Amazon EC2 Spot Fleet role with the spotIamFleetRole parameter. For more information, see Amazon EC2 spot fleet role in the Batch User Guide.
If you choose ECS_MANAGED_INSTANCES, you must also specify a managedInstancesProvider configuration. To use Spot capacity, set capacityOptionType to SPOT in the managedInstancesProvider.instanceLaunchTemplate configuration. For more information, see Amazon ECS Managed Instances compute environments in the Batch User Guide.
allocationStrategy (string) --
The allocation strategy to use for the compute resource if not enough instances of the best fitting instance type can be allocated. This might be because of availability of the instance type in the Region or Amazon EC2 service limits. For more information, see Allocation strategies in the Batch User Guide.
Batch selects an instance type that best fits the needs of the jobs with a preference for the lowest-cost instance type. If additional instances of the selected instance type aren't available, Batch waits for the additional instances to be available. If there aren't enough instances available or the user is reaching Amazon EC2 service limits, additional jobs aren't run until the currently running jobs are completed. This allocation strategy keeps costs lower but can limit scaling. If you're using Spot Fleets with BEST_FIT, the Spot Fleet IAM Role must be specified. Compute resources that use a BEST_FIT allocation strategy don't support infrastructure updates and can't update some parameters. For more information, see Updating compute environments in the Batch User Guide.
BEST_FIT_PROGRESSIVE
Batch selects additional instance types that are large enough to meet the requirements of the jobs in the queue. Its preference is for instance types with lower cost vCPUs. If additional instances of the previously selected instance types aren't available, Batch selects new instance types.
BEST_FIT_PROGRESSIVE_ORDERED
Batch selects instance types in the order they appear in the instanceTypes list. When an instance family is specified, sizes within that family are expanded using BEST_FIT_PROGRESSIVE logic—preferring sizes that best fit the jobs, with larger sizes as fallback. Instance types that cannot meet the resource requirements of the jobs are skipped. This strategy is only available for On-Demand Instance ( EC2) compute resources.
If an instance family and an explicit instance type from that family both appear in instanceTypes, the explicit type takes its listed position and is excluded from the family expansion. For example, in ["m7a.4xlarge", "m7a", "m6a"], m7a.4xlarge is always placed first and is excluded from the m7a family expansion.
SPOT_CAPACITY_OPTIMIZED
Batch selects one or more instance types that are large enough to meet the requirements of the jobs in the queue. Its preference is for instance types that are less likely to be interrupted. This allocation strategy is only available for Spot Instance compute resources.
SPOT_PRICE_CAPACITY_OPTIMIZED
The price and capacity optimized allocation strategy looks at both price and capacity to select the Spot Instance pools that are the least likely to be interrupted and have the lowest possible price. This allocation strategy is only available for Spot Instance compute resources.
SPOT_CAPACITY_OPTIMIZED_PRIORITIZED
Batch selects instance types in the order they appear in the instanceTypes list, but optimizes for capacity first. The customer-defined priority is honored on a best-effort basis. When Spot Instance capacity pools are similarly available, priority order is respected. When capacity is constrained, Batch selects from the most available pools regardless of priority to minimize the likelihood of Spot Instance interruptions. This strategy is only available for Spot Instance compute resources.
With any allocation strategy except BEST_FIT using On-Demand ( EC2) compute resources, Batch might need to exceed maxvCpus to meet your capacity requirements. In this event, Batch never exceeds maxvCpus by more than a single instance.
minvCpus (integer) --
The minimum number of vCPUs that a compute environment should maintain (even if the compute environment is DISABLED).
maxvCpus (integer) -- [REQUIRED]
The maximum number of vCPUs that a compute environment can support.
desiredvCpus (integer) --
The desired number of vCPUS in the compute environment. Batch modifies this value between the minimum and maximum values based on job queue demand.
instanceTypes (list) --
The instances types that can be launched. You can specify instance families to launch any instance type within those families (for example, c5 or p3), or you can specify specific sizes within a family (such as c5.8xlarge).
Batch can select the instance type for you if you choose one of the following:
default_x86_64 to choose x86 based instance types (from the m6i, c6i, r6i, and c7i instance families) that matches the resource demands of the job queue.
default_arm64 to choose ARM based instance types (from the m6g, c6g, r6g, and c7g instance families) that matches the resource demands of the job queue.
optimal Semantically equivalent to default_x86_64, see Optimal instance type configuration to receive automatic instance family updates for details.
(string) --
imageId (string) --
The Amazon Machine Image (AMI) ID used for instances launched in the compute environment. This parameter is overridden by the imageIdOverride member of the Ec2Configuration structure.
subnets (list) --
The VPC subnets where the compute resources are launched. These subnets must be within the same VPC. Fargate compute resources can contain up to 16 subnets. For more information, see VPCs and subnets in the Amazon VPC User Guide. This parameter is required for compute environments using EC2, SPOT, FARGATE, or FARGATE_SPOT compute resources.
(string) --
securityGroupIds (list) --
The Amazon EC2 security groups that are associated with instances launched in the compute environment. One or more security groups must be specified, either in securityGroupIds or using a launch template referenced in launchTemplate. This parameter is required for jobs that are running on Fargate resources and must contain at least one security group. Fargate doesn't support launch templates. If security groups are specified using both securityGroupIds and launchTemplate, the values in securityGroupIds are used.
(string) --
ec2KeyPair (string) --
The Amazon EC2 key pair that's used for instances launched in the compute environment. You can use this key pair to log in to your instances with SSH.
instanceRole (string) --
The Amazon ECS instance profile applied to Amazon EC2 instances in a compute environment. This parameter is required for Amazon EC2 instances types. You can specify the short name or full Amazon Resource Name (ARN) of an instance profile. For example, ecsInstanceRole or ``arn:aws:iam::<aws_account_id>:instance-profile/ecsInstanceRole ``. For more information, see Amazon ECS instance role in the Batch User Guide.
tags (dict) --
Key-value pair tags to be applied to Amazon EC2 resources that are launched in the compute environment. For Batch, these take the form of "String1": "String2", where String1 is the tag key and String2 is the tag value (for example, { "Name": "Batch Instance - C4OnDemand" }). This is helpful for recognizing your Batch instances in the Amazon EC2 console. Updating these tags requires an infrastructure update to the compute environment. For more information, see Updating compute environments in the Batch User Guide. These tags aren't seen when using the Batch ListTagsForResource API operation.
(string) --
(string) --
placementGroup (string) --
The Amazon EC2 placement group to associate with your compute resources. If you intend to submit multi-node parallel jobs to your compute environment, you should consider creating a cluster placement group and associate it with your compute resources. This keeps your multi-node parallel job on a logical grouping of instances within a single Availability Zone with high network flow potential. For more information, see Placement groups in the Amazon EC2 User Guide for Linux Instances.
bidPercentage (integer) --
The maximum percentage that a Spot Instance price can be when compared with the On-Demand price for that instance type before instances are launched. For example, if your maximum percentage is 20%, then the Spot price must be less than 20% of the current On-Demand price for that Amazon EC2 instance. You always pay the lowest (market) price and never more than your maximum percentage. If you leave this field empty, the default value is 100% of the On-Demand price. For most use cases, we recommend leaving this field empty.
spotIamFleetRole (string) --
The Amazon Resource Name (ARN) of the Amazon EC2 Spot Fleet IAM role applied to a SPOT compute environment. This role is required if the allocation strategy set to BEST_FIT or if the allocation strategy isn't specified. For more information, see Amazon EC2 spot fleet role in the Batch User Guide.
launchTemplate (dict) --
The launch template to use for your compute resources. Any other compute resource parameters that you specify in a CreateComputeEnvironment API operation override the same parameters in the launch template. You must specify either the launch template ID or launch template name in the request, but not both. For more information, see Launch template support in the Batch User Guide.
launchTemplateId (string) --
The ID of the launch template.
launchTemplateName (string) --
The name of the launch template.
version (string) --
The version number of the launch template, $Default, or $Latest.
If the value is $Default, the default version of the launch template is used. If the value is $Latest, the latest version of the launch template is used.
Default: $Default
Latest: $Latest
overrides (list) --
A launch template to use in place of the default launch template. You must specify either the launch template ID or launch template name in the request, but not both.
You can specify up to ten (10) launch template overrides that are associated to unique instance types or families for each compute environment.
(dict) --
An object that represents a launch template to use in place of the default launch template. You must specify either the launch template ID or launch template name in the request, but not both.
If security groups are specified using both the securityGroupIds parameter of CreateComputeEnvironment and the launch template, the values in the securityGroupIds parameter of CreateComputeEnvironment will be used.
You can define up to ten (10) overrides for each compute environment.
launchTemplateId (string) --
The ID of the launch template.
Note: If you specify the launchTemplateId you can't specify the launchTemplateName as well.
launchTemplateName (string) --
The name of the launch template.
Note: If you specify the launchTemplateName you can't specify the launchTemplateId as well.
version (string) --
The version number of the launch template, $Default, or $Latest.
If the value is $Default, the default version of the launch template is used. If the value is $Latest, the latest version of the launch template is used.
Default: $Default
Latest: $Latest
targetInstanceTypes (list) --
The instance type or family that this override launch template should be applied to.
This parameter is required when defining a launch template override.
Information included in this parameter must meet the following requirements:
Must be a valid Amazon EC2 instance type or family.
The following Batch InstanceTypes are not allowed: optimal, default_x86_64, and default_arm64.
targetInstanceTypes can target only instance types and families that are included within the ComputeResource.instanceTypes set. targetInstanceTypes doesn't need to include all of the instances from the instanceType set, but at least a subset. For example, if ComputeResource.instanceTypes includes [m5, g5], targetInstanceTypes can include [m5.2xlarge] and [m5.large] but not [c5.large].
targetInstanceTypes included within the same launch template override or across launch template overrides can't overlap for the same compute environment. For example, you can't define one launch template override to target an instance family and another define an instance type within this same family.
(string) --
userdataType (string) --
The EKS node initialization process to use. You only need to specify this value if you are using a custom AMI. The default value is EKS_BOOTSTRAP_SH. If imageType is a custom AMI based on EKS_AL2023 or EKS_AL2023_NVIDIA then you must choose EKS_NODEADM.
userdataType (string) --
The EKS node initialization process to use. You only need to specify this value if you are using a custom AMI. The default value is EKS_BOOTSTRAP_SH. If imageType is a custom AMI based on EKS_AL2023 or EKS_AL2023_NVIDIA then you must choose EKS_NODEADM.
ec2Configuration (list) --
Provides information that's used to select Amazon Machine Images (AMIs) for Amazon EC2 instances in the compute environment. If Ec2Configuration isn't specified, the default is ECS_AL2023 for EC2 (ECS) compute environments and EKS_AL2023 for EKS compute environments.
One or two values can be provided.
(dict) --
Provides information used to select Amazon Machine Images (AMIs) for instances in the compute environment. If Ec2Configuration isn't specified, the default is ECS_AL2023 ( Amazon ECS-optimized Amazon Linux 2023) for EC2 (ECS) compute environments and EKS_AL2023 ( Amazon EKS-optimized Amazon Linux 2023 AMI) for EKS compute environments.
imageType (string) -- [REQUIRED]
The image type to match with the instance type to select an AMI. The supported values are different for ECS and EKS resources.
ECS
If the imageIdOverride parameter isn't specified, then a recent Amazon ECS-optimized Amazon Linux 2023 AMI ( ECS_AL2023) is used. If a new image type is specified in an update, but neither an imageId nor a imageIdOverride parameter is specified, then the latest Amazon ECS optimized AMI for that image type that's supported by Batch is used.
Amazon Linux 2: Used for non-GPU instance families.
ECS_AL2_NVIDIA
Amazon Linux 2 (GPU): Used for GPU instance families (for example P4 and G4) and non Amazon Web Services Graviton-based instance types.
ECS_AL2023
Amazon Linux 2023: Default for all non-GPU instance families.
Amazon Linux 2023 (GPU): Default for all GPU instance families and can be used for all non Amazon Web Services Graviton-based instance types.
If the imageIdOverride parameter isn't specified, then a recent Amazon EKS-optimized Amazon Linux 2023 AMI ( EKS_AL2023) is used. If a new image type is specified in an update, but neither an imageId nor a imageIdOverride parameter is specified, then the latest Amazon EKS optimized AMI for that image type that Batch supports is used.
Amazon Linux 2: Used for non-GPU instance families.
EKS_AL2_NVIDIA
Amazon Linux 2 (accelerated): Used for GPU instance families (for example, P4 and G4) and can be used for all non Amazon Web Services Graviton-based instance types.
EKS_AL2023
Amazon Linux 2023: Default for non-GPU instance families.
Amazon Linux 2023 (accelerated): Default for GPU instance families and can be used for all non Amazon Web Services Graviton-based instance types.
imageIdOverride (string) --
The AMI ID used for instances launched in the compute environment that match the image type. This setting overrides the imageId set in the computeResource object.
batchImageStatus (string) --
The status of the Batch-provided default AMIs associated with the imageType.
The field only appears after the compute environment has begun scaling instances using the imageType. The field is not present when an image is specified in ComputeResources.imageId (deprecated), the default launch template, or Ec2Configuration.imageIdOverride. The field is also not present when the compute environment has a launch template override. For more information on image selection, see AMI selection order.
LATEST − Using the most recent AMI supported
UPDATE_AVAILABLE − An updated AMI is available
If a compute environment has multiple AMIs for the imageType and any one AMI has UPDATE_AVAILABLE, the status shows UPDATE_AVAILABLE.
For compute environments that use BEST_FIT as their allocation strategy, you can perform a blue/green update to update the AMI.
For all other compute environments, you can perform an AMI version update to update the AMI to the latest version.
imageKubernetesVersion (string) --
The Kubernetes version for the compute environment. If you don't specify a value, the latest version that Batch supports is used.
scalingPolicy (dict) --
The scaling policy configuration for the compute environment.
minScaleDownDelayMinutes (integer) --
The minimum time (in minutes) that Batch keeps instances running in the compute environment after their jobs complete. For each instance, the delay period begins when the last job finishes. If no new jobs are placed on the instance during this delay, Batch terminates the instance once the delay expires.
Valid Range: Minimum value of 20. Maximum value of 10080. Use 0 to unset and disable the scale down delay.
managedInstancesProvider (dict) --
The configuration for the Amazon ECS Managed Instances capacity provider. This parameter is required when computeResources.type is ECS_MANAGED_INSTANCES and must not be specified for other compute environment types.
For more information, see Amazon ECS Managed Instances compute environments in the Batch User Guide.
propagateTags (string) --
Specifies whether tags on the capacity provider are propagated to the Amazon EC2 instances it launches. Valid values:
CAPACITY_PROVIDER — Propagates tags to instances.
NONE (default) — Does not propagate tags to instances.
infrastructureRoleArn (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of the IAM role that Amazon ECS assumes to manage Amazon EC2 instances on your behalf. This role must have a trust policy for ecs.amazonaws.com. You must have the iam:PassRole permission for this role with the condition iam:PassedToService: ecs.amazonaws.com.
instanceLaunchTemplate (dict) -- [REQUIRED]
The instance launch configuration for the Amazon ECS Managed Instances capacity provider. Contains networking, instance profile, instance requirements, capacity type, storage, and monitoring configuration.
ec2InstanceProfileArn (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of the Amazon EC2 instance profile for the managed instances. The instance profile must use the AmazonECSInstanceRolePolicyForManagedInstances managed policy with a trust policy for ec2.amazonaws.com.
networkConfiguration (dict) -- [REQUIRED]
The network configuration for the managed instances. Specifies the VPC subnets and security groups where instances are launched.
subnets (list) -- [REQUIRED]
The VPC subnets where managed instances are launched. If your subnets don't provide public IP addresses, they must have a NAT gateway for outbound internet access.
(string) --
securityGroups (list) -- [REQUIRED]
The VPC security groups to associate with the managed instances.
(string) --
instanceRequirements (dict) --
The instance type requirements for the capacity provider. Use this to constrain which Amazon EC2 instance types Amazon ECS can launch. If not specified, all available instance types are eligible.
allowedInstanceTypes (list) --
A list of specific instance types or instance families that Amazon ECS can launch (for example, m5.large or g5). When specified, only these instance types are used.
(string) --
capacityOptionType (string) --
The capacity pricing model for the managed instances. Valid values:
ON_DEMAND (default) — On-Demand pricing.
SPOT — Spot Instances, which can provide significant cost savings for fault-tolerant workloads.
storageConfiguration (dict) --
The storage configuration for the managed instances. Configures the root EBS volume size. If not specified, the service uses the default EBS volume size for the instance type.
storageSizeGiB (integer) --
The size of the root EBS volume in GiB for the managed instances.
monitoring (string) --
The level of CloudWatch monitoring for the managed instances. Valid values are BASIC and DETAILED.
fipsEnabled (boolean) --
Specifies whether FIPS 140-2 validated cryptographic modules are enabled on the managed instances. Not available in all Regions.
capacityReservations (dict) --
The capacity reservation configuration for the managed instances. Use this to target On-Demand Capacity Reservations or Reserved Instances for predictable capacity and cost optimization.
reservationGroupArn (string) --
The Amazon Resource Name (ARN) of the capacity reservation group to target.
reservationPreference (string) --
The capacity reservation preference. Valid values:
RESERVATIONS_ONLY — Use only capacity reservations.
RESERVATIONS_FIRST — Prefer capacity reservations but fall back to On-Demand if unavailable.
RESERVATIONS_EXCLUDED — Do not use capacity reservations.
instanceMetadataTagsPropagation (boolean) --
Specifies whether instance tags are accessible from the instance metadata service (IMDS). If not specified, instance tags are not accessible from IMDS.
localStorageConfiguration (dict) --
The local storage configuration for the managed instances. If not specified, instance store volumes are not available to containers.
useLocalStorage (boolean) --
Specifies whether instance store volumes (local NVMe SSDs) are available to containers. When enabled, containers can use the instance store for high-performance temporary storage.
infrastructureOptimization (dict) --
The infrastructure optimization configuration for the capacity provider. Specifies the idle-instance scale-in behavior.
scaleInAfter (integer) --
The number of seconds an instance can remain idle before it is terminated. Valid values are -1 or 0 to 3600. Use -1 as a special value to disable scale-in (instances are never terminated for being idle). If not specified, a default value applies.
capacityTags (dict) --
The tags to apply to the Amazon ECS capacity provider and Amazon EC2 instances launched by the compute environment. These tags are separate from the compute environment resource tags (the top-level tags parameter). Use capacityTags for cost allocation and organization of the underlying infrastructure resources.
This parameter is only valid for ECS_MANAGED_INSTANCES compute environments. You must have the batch:SetCapacityTags permission on the compute environment resource to use this parameter.
(string) --
(string) --
string
The full Amazon Resource Name (ARN) of the IAM role that allows Batch to make calls to other Amazon Web Services services on your behalf. For more information, see Batch service IAM role in the Batch User Guide.
If your specified role has a path other than /, then you must specify either the full role ARN (recommended) or prefix the role name with the path. For example, if a role with the name bar has a path of /foo/, specify /foo/bar as the role name. For more information, see Friendly names and paths in the IAM User Guide.
dict
The tags that you apply to the compute environment to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see Tagging Amazon Web Services Resources in Amazon Web Services General Reference.
These tags can be updated or removed using the TagResource and UntagResource API operations. These tags don't propagate to the underlying compute resources.
(string) --
(string) --
dict
The details for the Amazon EKS cluster that supports the compute environment.
eksClusterArn (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of the Amazon EKS cluster. An example is ``arn:aws:eks:us-east-1:123456789012:cluster/ClusterForBatch ``.
kubernetesNamespace (string) -- [REQUIRED]
The namespace of the Amazon EKS cluster. Batch manages pods in this namespace. The value can't left empty or null. It must be fewer than 64 characters long, can't be set to default, can't start with " kube-," and must match this regular expression: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$. For more information, see Namespaces in the Kubernetes documentation.
string
Reserved.
dict
The Amazon ECS settings for the compute environment. These settings control CloudWatch Container Insights collection for the compute environment.
containerInsights (string) --
Specifies the CloudWatch Container Insights mode for the compute environment. Valid values are:
ENABLED
Turns on standard Container Insights, which collects CPU, memory, disk, and network utilization metrics for the compute environment.
ENHANCED
Turns on enhanced Container Insights, which collects the standard metrics along with additional per-task observability metrics.
DISABLED
Turns off Container Insights for the compute environment.
If you don't specify a value, the default is DISABLED. For more information, see Container Insights in the Batch User Guide.
dict
Response Syntax
{
'computeEnvironmentName': 'string',
'computeEnvironmentArn': 'string'
}
Response Structure
(dict) --
computeEnvironmentName (string) --
The name of the compute environment. It can be up to 128 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).
computeEnvironmentArn (string) --
The Amazon Resource Name (ARN) of the compute environment.
{'jobQueueType': {'ECS_MANAGED_INSTANCES'}}
Creates an Batch job queue. When you create a job queue, you associate one or more compute environments to the queue and assign an order of preference for the compute environments.
You also set a priority to the job queue that determines the order that the Batch scheduler places jobs onto its associated compute environments. For example, if a compute environment is associated with more than one job queue, the job queue with a higher priority is given preference for scheduling jobs to that compute environment.
See also: AWS API Documentation
Request Syntax
client.create_job_queue(
jobQueueName='string',
state='ENABLED'|'DISABLED',
schedulingPolicyArn='string',
priority=123,
computeEnvironmentOrder=[
{
'order': 123,
'computeEnvironment': 'string'
},
],
serviceEnvironmentOrder=[
{
'order': 123,
'serviceEnvironment': 'string'
},
],
jobQueueType='EKS'|'ECS'|'ECS_FARGATE'|'SAGEMAKER_TRAINING'|'ECS_MANAGED_INSTANCES',
tags={
'string': 'string'
},
jobStateTimeLimitActions=[
{
'reason': 'string',
'state': 'RUNNABLE',
'maxTimeSeconds': 123,
'action': 'CANCEL'|'TERMINATE'
},
]
)
string
[REQUIRED]
The name of the job queue. It can be up to 128 letters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).
string
The state of the job queue. If the job queue state is ENABLED, it is able to accept jobs. If the job queue state is DISABLED, new jobs can't be added to the queue, but jobs already in the queue can finish.
string
The Amazon Resource Name (ARN) of the fair-share scheduling policy. Job queues that don't have a fair-share scheduling policy are scheduled in a first-in, first-out (FIFO) model. After a job queue has a fair-share scheduling policy, it can be replaced but can't be removed.
The format is ``aws:Partition:batch:Region:Account:scheduling-policy/Name ``.
An example is aws:aws:batch:us-west-2:123456789012:scheduling-policy/MySchedulingPolicy.
A job queue without a fair-share scheduling policy is scheduled as a FIFO job queue and can't have a fair-share scheduling policy added. Jobs queues with a fair-share scheduling policy can have a maximum of 500 active share identifiers. When the limit has been reached, submissions of any jobs that add a new share identifier fail.
integer
[REQUIRED]
The priority of the job queue. Job queues with a higher priority (or a higher integer value for the priority parameter) are evaluated first when associated with the same compute environment. Priority is determined in descending order. For example, a job queue with a priority value of 10 is given scheduling preference over a job queue with a priority value of 1. All of the compute environments must be either EC2 ( EC2 or SPOT) or Fargate ( FARGATE or FARGATE_SPOT); EC2 and Fargate compute environments can't be mixed.
list
The set of compute environments mapped to a job queue and their order relative to each other. The job scheduler uses this parameter to determine which compute environment runs a specific job. Compute environments must be in the VALID state before you can associate them with a job queue. You can associate up to three compute environments with a job queue. All of the compute environments must be either EC2 ( EC2 or SPOT) or Fargate ( FARGATE or FARGATE_SPOT); EC2 and Fargate compute environments can't be mixed.
(dict) --
The order that compute environments are tried in for job placement within a queue. Compute environments are tried in ascending order. For example, if two compute environments are associated with a job queue, the compute environment with a lower order integer value is tried for job placement first. Compute environments must be in the VALID state before you can associate them with a job queue. All of the compute environments must be either EC2 ( EC2 or SPOT) or Fargate ( FARGATE or FARGATE_SPOT); Amazon EC2 and Fargate compute environments can't be mixed.
order (integer) -- [REQUIRED]
The order of the compute environment. Compute environments are tried in ascending order. For example, if two compute environments are associated with a job queue, the compute environment with a lower order integer value is tried for job placement first.
computeEnvironment (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of the compute environment.
list
A list of service environments that this job queue can use to allocate jobs. All serviceEnvironments must have the same type. A job queue can't have both a serviceEnvironmentOrder and a computeEnvironmentOrder field.
(dict) --
Specifies the order of a service environment for a job queue. This determines the priority order when multiple service environments are associated with the same job queue.
order (integer) -- [REQUIRED]
The order of the service environment. Job queues with a higher priority are evaluated first when associated with the same service environment.
serviceEnvironment (string) -- [REQUIRED]
The name or ARN of the service environment.
string
The type of job queue. For service jobs that run on SageMaker Training, this value is SAGEMAKER_TRAINING. For regular container jobs, this value is EKS, ECS, or ECS_FARGATE depending on the compute environment.
dict
The tags that you apply to the job queue to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see Tagging your Batch resources in Batch User Guide.
(string) --
(string) --
list
The set of actions that Batch performs on jobs that remain at the head of the job queue in the specified state longer than specified times. Batch will perform each action after maxTimeSeconds has passed. (Note: The minimum value for maxTimeSeconds is 600 (10 minutes) and its maximum value is 86,400 (24 hours).)
(dict) --
Specifies an action that Batch will take after the job has remained at the head of the queue in the specified state for longer than the specified time.
reason (string) -- [REQUIRED]
The reason to log for the action being taken.
state (string) -- [REQUIRED]
The state of the job needed to trigger the action. The only supported value is RUNNABLE.
maxTimeSeconds (integer) -- [REQUIRED]
The approximate amount of time, in seconds, that must pass with the job in the specified state before the action is taken. The minimum value is 600 (10 minutes) and the maximum value is 86,400 (24 hours).
action (string) -- [REQUIRED]
The action to take when a job is at the head of the job queue in the specified state for the specified period of time. For job queues connected to a ECS, FARGATE or EKS compute environment, the only supported value is CANCEL, which will cancel the job. For job queues connected to a SAGEMAKER_TRAINING service environment, the only supported value is TERMINATE, which will terminate the job.
dict
Response Syntax
{
'jobQueueName': 'string',
'jobQueueArn': 'string'
}
Response Structure
(dict) --
jobQueueName (string) --
The name of the job queue.
jobQueueArn (string) --
The Amazon Resource Name (ARN) of the job queue.
{'computeEnvironments': {'computeResources': {'capacityTags': {'string': 'string'},
'managedInstancesProvider': {'infrastructureOptimization': {'scaleInAfter': 'integer'},
'infrastructureRoleArn': 'string',
'instanceLaunchTemplate': {'capacityOptionType': 'string',
'capacityReservations': {'reservationGroupArn': 'string',
'reservationPreference': 'string'},
'ec2InstanceProfileArn': 'string',
'fipsEnabled': 'boolean',
'instanceMetadataTagsPropagation': 'boolean',
'instanceRequirements': {'allowedInstanceTypes': ['string']},
'localStorageConfiguration': {'useLocalStorage': 'boolean'},
'monitoring': 'string',
'networkConfiguration': {'securityGroups': ['string'],
'subnets': ['string']},
'storageConfiguration': {'storageSizeGiB': 'integer'}},
'propagateTags': 'string'},
'type': {'ECS_MANAGED_INSTANCES'}}}}
Describes one or more of your compute environments.
If you're using an unmanaged compute environment, you can use the DescribeComputeEnvironment operation to determine the ecsClusterArn that you launch your Amazon ECS container instances into.
See also: AWS API Documentation
Request Syntax
client.describe_compute_environments(
computeEnvironments=[
'string',
],
maxResults=123,
nextToken='string'
)
list
A list of up to 100 compute environment names or full Amazon Resource Name (ARN) entries.
(string) --
integer
The maximum number of cluster results returned by DescribeComputeEnvironments in paginated output. When this parameter is used, DescribeComputeEnvironments only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another DescribeComputeEnvironments request with the returned nextToken value. This value can be between 1 and 100. If this parameter isn't used, then DescribeComputeEnvironments returns up to 100 results and a nextToken value if applicable.
string
The nextToken value returned from a previous paginated DescribeComputeEnvironments request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return.
dict
Response Syntax
{
'computeEnvironments': [
{
'computeEnvironmentName': 'string',
'computeEnvironmentArn': 'string',
'unmanagedvCpus': 123,
'ecsClusterArn': 'string',
'tags': {
'string': 'string'
},
'type': 'MANAGED'|'UNMANAGED',
'state': 'ENABLED'|'DISABLED',
'status': 'CREATING'|'UPDATING'|'DELETING'|'DELETED'|'VALID'|'INVALID',
'statusReason': 'string',
'computeResources': {
'type': 'EC2'|'SPOT'|'FARGATE'|'FARGATE_SPOT'|'ECS_MANAGED_INSTANCES',
'allocationStrategy': 'BEST_FIT'|'BEST_FIT_PROGRESSIVE'|'BEST_FIT_PROGRESSIVE_ORDERED'|'SPOT_CAPACITY_OPTIMIZED'|'SPOT_PRICE_CAPACITY_OPTIMIZED'|'SPOT_CAPACITY_OPTIMIZED_PRIORITIZED',
'minvCpus': 123,
'maxvCpus': 123,
'desiredvCpus': 123,
'instanceTypes': [
'string',
],
'imageId': 'string',
'subnets': [
'string',
],
'securityGroupIds': [
'string',
],
'ec2KeyPair': 'string',
'instanceRole': 'string',
'tags': {
'string': 'string'
},
'placementGroup': 'string',
'bidPercentage': 123,
'spotIamFleetRole': 'string',
'launchTemplate': {
'launchTemplateId': 'string',
'launchTemplateName': 'string',
'version': 'string',
'overrides': [
{
'launchTemplateId': 'string',
'launchTemplateName': 'string',
'version': 'string',
'targetInstanceTypes': [
'string',
],
'userdataType': 'EKS_BOOTSTRAP_SH'|'EKS_NODEADM'
},
],
'userdataType': 'EKS_BOOTSTRAP_SH'|'EKS_NODEADM'
},
'ec2Configuration': [
{
'imageType': 'string',
'imageIdOverride': 'string',
'batchImageStatus': 'string',
'imageKubernetesVersion': 'string'
},
],
'scalingPolicy': {
'minScaleDownDelayMinutes': 123
},
'managedInstancesProvider': {
'propagateTags': 'string',
'infrastructureRoleArn': 'string',
'instanceLaunchTemplate': {
'ec2InstanceProfileArn': 'string',
'networkConfiguration': {
'subnets': [
'string',
],
'securityGroups': [
'string',
]
},
'instanceRequirements': {
'allowedInstanceTypes': [
'string',
]
},
'capacityOptionType': 'string',
'storageConfiguration': {
'storageSizeGiB': 123
},
'monitoring': 'string',
'fipsEnabled': True|False,
'capacityReservations': {
'reservationGroupArn': 'string',
'reservationPreference': 'string'
},
'instanceMetadataTagsPropagation': True|False,
'localStorageConfiguration': {
'useLocalStorage': True|False
}
},
'infrastructureOptimization': {
'scaleInAfter': 123
}
},
'capacityTags': {
'string': 'string'
}
},
'serviceRole': 'string',
'updatePolicy': {
'terminateJobsOnUpdate': True|False,
'jobExecutionTimeoutMinutes': 123
},
'eksConfiguration': {
'eksClusterArn': 'string',
'kubernetesNamespace': 'string'
},
'containerOrchestrationType': 'ECS'|'EKS',
'uuid': 'string',
'context': 'string',
'ecsSettings': {
'containerInsights': 'ENABLED'|'ENHANCED'|'DISABLED'
}
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
computeEnvironments (list) --
The list of compute environments.
(dict) --
An object that represents an Batch compute environment.
computeEnvironmentName (string) --
The name of the compute environment. It can be up to 128 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).
computeEnvironmentArn (string) --
The Amazon Resource Name (ARN) of the compute environment.
unmanagedvCpus (integer) --
The maximum number of VCPUs expected to be used for an unmanaged compute environment.
ecsClusterArn (string) --
The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster that the compute environment uses.
tags (dict) --
The tags applied to the compute environment.
(string) --
(string) --
type (string) --
The type of the compute environment: MANAGED or UNMANAGED. For more information, see Compute environments in the Batch User Guide.
state (string) --
The state of the compute environment. The valid values are ENABLED or DISABLED.
If the state is ENABLED, then the Batch scheduler can attempt to place jobs from an associated job queue on the compute resources within the environment. If the compute environment is managed, then it can scale its instances out or in automatically based on the job queue demand.
If the state is DISABLED, then the Batch scheduler doesn't attempt to place jobs within the environment. Jobs in a STARTING or RUNNING state continue to progress normally. Managed compute environments in the DISABLED state don't scale out.
When an instance is idle, the instance scales down to the minvCpus value. However, the instance size doesn't change. For example, consider a c5.8xlarge instance with a minvCpus value of 4 and a desiredvCpus value of 36. This instance doesn't scale down to a c5.large instance.
status (string) --
The current status of the compute environment (for example, CREATING or VALID).
statusReason (string) --
A short, human-readable string to provide additional details for the current status of the compute environment.
computeResources (dict) --
The compute resources defined for the compute environment. For more information, see Compute environments in the Batch User Guide.
type (string) --
The type of compute environment: EC2, SPOT, FARGATE, FARGATE_SPOT, or ECS_MANAGED_INSTANCES. For more information, see Compute environments in the Batch User Guide.
If you choose SPOT, you must also specify an Amazon EC2 Spot Fleet role with the spotIamFleetRole parameter. For more information, see Amazon EC2 spot fleet role in the Batch User Guide.
If you choose ECS_MANAGED_INSTANCES, you must also specify a managedInstancesProvider configuration. To use Spot capacity, set capacityOptionType to SPOT in the managedInstancesProvider.instanceLaunchTemplate configuration. For more information, see Amazon ECS Managed Instances compute environments in the Batch User Guide.
allocationStrategy (string) --
The allocation strategy to use for the compute resource if not enough instances of the best fitting instance type can be allocated. This might be because of availability of the instance type in the Region or Amazon EC2 service limits. For more information, see Allocation strategies in the Batch User Guide.
Batch selects an instance type that best fits the needs of the jobs with a preference for the lowest-cost instance type. If additional instances of the selected instance type aren't available, Batch waits for the additional instances to be available. If there aren't enough instances available or the user is reaching Amazon EC2 service limits, additional jobs aren't run until the currently running jobs are completed. This allocation strategy keeps costs lower but can limit scaling. If you're using Spot Fleets with BEST_FIT, the Spot Fleet IAM Role must be specified. Compute resources that use a BEST_FIT allocation strategy don't support infrastructure updates and can't update some parameters. For more information, see Updating compute environments in the Batch User Guide.
BEST_FIT_PROGRESSIVE
Batch selects additional instance types that are large enough to meet the requirements of the jobs in the queue. Its preference is for instance types with lower cost vCPUs. If additional instances of the previously selected instance types aren't available, Batch selects new instance types.
BEST_FIT_PROGRESSIVE_ORDERED
Batch selects instance types in the order they appear in the instanceTypes list. When an instance family is specified, sizes within that family are expanded using BEST_FIT_PROGRESSIVE logic—preferring sizes that best fit the jobs, with larger sizes as fallback. Instance types that cannot meet the resource requirements of the jobs are skipped. This strategy is only available for On-Demand Instance ( EC2) compute resources.
If an instance family and an explicit instance type from that family both appear in instanceTypes, the explicit type takes its listed position and is excluded from the family expansion. For example, in ["m7a.4xlarge", "m7a", "m6a"], m7a.4xlarge is always placed first and is excluded from the m7a family expansion.
SPOT_CAPACITY_OPTIMIZED
Batch selects one or more instance types that are large enough to meet the requirements of the jobs in the queue. Its preference is for instance types that are less likely to be interrupted. This allocation strategy is only available for Spot Instance compute resources.
SPOT_PRICE_CAPACITY_OPTIMIZED
The price and capacity optimized allocation strategy looks at both price and capacity to select the Spot Instance pools that are the least likely to be interrupted and have the lowest possible price. This allocation strategy is only available for Spot Instance compute resources.
SPOT_CAPACITY_OPTIMIZED_PRIORITIZED
Batch selects instance types in the order they appear in the instanceTypes list, but optimizes for capacity first. The customer-defined priority is honored on a best-effort basis. When Spot Instance capacity pools are similarly available, priority order is respected. When capacity is constrained, Batch selects from the most available pools regardless of priority to minimize the likelihood of Spot Instance interruptions. This strategy is only available for Spot Instance compute resources.
With any allocation strategy except BEST_FIT using On-Demand ( EC2) compute resources, Batch might need to exceed maxvCpus to meet your capacity requirements. In this event, Batch never exceeds maxvCpus by more than a single instance.
minvCpus (integer) --
The minimum number of vCPUs that a compute environment should maintain (even if the compute environment is DISABLED).
maxvCpus (integer) --
The maximum number of vCPUs that a compute environment can support.
desiredvCpus (integer) --
The desired number of vCPUS in the compute environment. Batch modifies this value between the minimum and maximum values based on job queue demand.
instanceTypes (list) --
The instances types that can be launched. You can specify instance families to launch any instance type within those families (for example, c5 or p3), or you can specify specific sizes within a family (such as c5.8xlarge).
Batch can select the instance type for you if you choose one of the following:
default_x86_64 to choose x86 based instance types (from the m6i, c6i, r6i, and c7i instance families) that matches the resource demands of the job queue.
default_arm64 to choose ARM based instance types (from the m6g, c6g, r6g, and c7g instance families) that matches the resource demands of the job queue.
optimal Semantically equivalent to default_x86_64, see Optimal instance type configuration to receive automatic instance family updates for details.
(string) --
imageId (string) --
The Amazon Machine Image (AMI) ID used for instances launched in the compute environment. This parameter is overridden by the imageIdOverride member of the Ec2Configuration structure.
subnets (list) --
The VPC subnets where the compute resources are launched. These subnets must be within the same VPC. Fargate compute resources can contain up to 16 subnets. For more information, see VPCs and subnets in the Amazon VPC User Guide. This parameter is required for compute environments using EC2, SPOT, FARGATE, or FARGATE_SPOT compute resources.
(string) --
securityGroupIds (list) --
The Amazon EC2 security groups that are associated with instances launched in the compute environment. One or more security groups must be specified, either in securityGroupIds or using a launch template referenced in launchTemplate. This parameter is required for jobs that are running on Fargate resources and must contain at least one security group. Fargate doesn't support launch templates. If security groups are specified using both securityGroupIds and launchTemplate, the values in securityGroupIds are used.
(string) --
ec2KeyPair (string) --
The Amazon EC2 key pair that's used for instances launched in the compute environment. You can use this key pair to log in to your instances with SSH.
instanceRole (string) --
The Amazon ECS instance profile applied to Amazon EC2 instances in a compute environment. This parameter is required for Amazon EC2 instances types. You can specify the short name or full Amazon Resource Name (ARN) of an instance profile. For example, ecsInstanceRole or ``arn:aws:iam::<aws_account_id>:instance-profile/ecsInstanceRole ``. For more information, see Amazon ECS instance role in the Batch User Guide.
tags (dict) --
Key-value pair tags to be applied to Amazon EC2 resources that are launched in the compute environment. For Batch, these take the form of "String1": "String2", where String1 is the tag key and String2 is the tag value (for example, { "Name": "Batch Instance - C4OnDemand" }). This is helpful for recognizing your Batch instances in the Amazon EC2 console. Updating these tags requires an infrastructure update to the compute environment. For more information, see Updating compute environments in the Batch User Guide. These tags aren't seen when using the Batch ListTagsForResource API operation.
(string) --
(string) --
placementGroup (string) --
The Amazon EC2 placement group to associate with your compute resources. If you intend to submit multi-node parallel jobs to your compute environment, you should consider creating a cluster placement group and associate it with your compute resources. This keeps your multi-node parallel job on a logical grouping of instances within a single Availability Zone with high network flow potential. For more information, see Placement groups in the Amazon EC2 User Guide for Linux Instances.
bidPercentage (integer) --
The maximum percentage that a Spot Instance price can be when compared with the On-Demand price for that instance type before instances are launched. For example, if your maximum percentage is 20%, then the Spot price must be less than 20% of the current On-Demand price for that Amazon EC2 instance. You always pay the lowest (market) price and never more than your maximum percentage. If you leave this field empty, the default value is 100% of the On-Demand price. For most use cases, we recommend leaving this field empty.
spotIamFleetRole (string) --
The Amazon Resource Name (ARN) of the Amazon EC2 Spot Fleet IAM role applied to a SPOT compute environment. This role is required if the allocation strategy set to BEST_FIT or if the allocation strategy isn't specified. For more information, see Amazon EC2 spot fleet role in the Batch User Guide.
launchTemplate (dict) --
The launch template to use for your compute resources. Any other compute resource parameters that you specify in a CreateComputeEnvironment API operation override the same parameters in the launch template. You must specify either the launch template ID or launch template name in the request, but not both. For more information, see Launch template support in the Batch User Guide.
launchTemplateId (string) --
The ID of the launch template.
launchTemplateName (string) --
The name of the launch template.
version (string) --
The version number of the launch template, $Default, or $Latest.
If the value is $Default, the default version of the launch template is used. If the value is $Latest, the latest version of the launch template is used.
Default: $Default
Latest: $Latest
overrides (list) --
A launch template to use in place of the default launch template. You must specify either the launch template ID or launch template name in the request, but not both.
You can specify up to ten (10) launch template overrides that are associated to unique instance types or families for each compute environment.
(dict) --
An object that represents a launch template to use in place of the default launch template. You must specify either the launch template ID or launch template name in the request, but not both.
If security groups are specified using both the securityGroupIds parameter of CreateComputeEnvironment and the launch template, the values in the securityGroupIds parameter of CreateComputeEnvironment will be used.
You can define up to ten (10) overrides for each compute environment.
launchTemplateId (string) --
The ID of the launch template.
Note: If you specify the launchTemplateId you can't specify the launchTemplateName as well.
launchTemplateName (string) --
The name of the launch template.
Note: If you specify the launchTemplateName you can't specify the launchTemplateId as well.
version (string) --
The version number of the launch template, $Default, or $Latest.
If the value is $Default, the default version of the launch template is used. If the value is $Latest, the latest version of the launch template is used.
Default: $Default
Latest: $Latest
targetInstanceTypes (list) --
The instance type or family that this override launch template should be applied to.
This parameter is required when defining a launch template override.
Information included in this parameter must meet the following requirements:
Must be a valid Amazon EC2 instance type or family.
The following Batch InstanceTypes are not allowed: optimal, default_x86_64, and default_arm64.
targetInstanceTypes can target only instance types and families that are included within the ComputeResource.instanceTypes set. targetInstanceTypes doesn't need to include all of the instances from the instanceType set, but at least a subset. For example, if ComputeResource.instanceTypes includes [m5, g5], targetInstanceTypes can include [m5.2xlarge] and [m5.large] but not [c5.large].
targetInstanceTypes included within the same launch template override or across launch template overrides can't overlap for the same compute environment. For example, you can't define one launch template override to target an instance family and another define an instance type within this same family.
(string) --
userdataType (string) --
The EKS node initialization process to use. You only need to specify this value if you are using a custom AMI. The default value is EKS_BOOTSTRAP_SH. If imageType is a custom AMI based on EKS_AL2023 or EKS_AL2023_NVIDIA then you must choose EKS_NODEADM.
userdataType (string) --
The EKS node initialization process to use. You only need to specify this value if you are using a custom AMI. The default value is EKS_BOOTSTRAP_SH. If imageType is a custom AMI based on EKS_AL2023 or EKS_AL2023_NVIDIA then you must choose EKS_NODEADM.
ec2Configuration (list) --
Provides information that's used to select Amazon Machine Images (AMIs) for Amazon EC2 instances in the compute environment. If Ec2Configuration isn't specified, the default is ECS_AL2023 for EC2 (ECS) compute environments and EKS_AL2023 for EKS compute environments.
One or two values can be provided.
(dict) --
Provides information used to select Amazon Machine Images (AMIs) for instances in the compute environment. If Ec2Configuration isn't specified, the default is ECS_AL2023 ( Amazon ECS-optimized Amazon Linux 2023) for EC2 (ECS) compute environments and EKS_AL2023 ( Amazon EKS-optimized Amazon Linux 2023 AMI) for EKS compute environments.
imageType (string) --
The image type to match with the instance type to select an AMI. The supported values are different for ECS and EKS resources.
ECS
If the imageIdOverride parameter isn't specified, then a recent Amazon ECS-optimized Amazon Linux 2023 AMI ( ECS_AL2023) is used. If a new image type is specified in an update, but neither an imageId nor a imageIdOverride parameter is specified, then the latest Amazon ECS optimized AMI for that image type that's supported by Batch is used.
Amazon Linux 2: Used for non-GPU instance families.
ECS_AL2_NVIDIA
Amazon Linux 2 (GPU): Used for GPU instance families (for example P4 and G4) and non Amazon Web Services Graviton-based instance types.
ECS_AL2023
Amazon Linux 2023: Default for all non-GPU instance families.
Amazon Linux 2023 (GPU): Default for all GPU instance families and can be used for all non Amazon Web Services Graviton-based instance types.
If the imageIdOverride parameter isn't specified, then a recent Amazon EKS-optimized Amazon Linux 2023 AMI ( EKS_AL2023) is used. If a new image type is specified in an update, but neither an imageId nor a imageIdOverride parameter is specified, then the latest Amazon EKS optimized AMI for that image type that Batch supports is used.
Amazon Linux 2: Used for non-GPU instance families.
EKS_AL2_NVIDIA
Amazon Linux 2 (accelerated): Used for GPU instance families (for example, P4 and G4) and can be used for all non Amazon Web Services Graviton-based instance types.
EKS_AL2023
Amazon Linux 2023: Default for non-GPU instance families.
Amazon Linux 2023 (accelerated): Default for GPU instance families and can be used for all non Amazon Web Services Graviton-based instance types.
imageIdOverride (string) --
The AMI ID used for instances launched in the compute environment that match the image type. This setting overrides the imageId set in the computeResource object.
batchImageStatus (string) --
The status of the Batch-provided default AMIs associated with the imageType.
The field only appears after the compute environment has begun scaling instances using the imageType. The field is not present when an image is specified in ComputeResources.imageId (deprecated), the default launch template, or Ec2Configuration.imageIdOverride. The field is also not present when the compute environment has a launch template override. For more information on image selection, see AMI selection order.
LATEST − Using the most recent AMI supported
UPDATE_AVAILABLE − An updated AMI is available
If a compute environment has multiple AMIs for the imageType and any one AMI has UPDATE_AVAILABLE, the status shows UPDATE_AVAILABLE.
For compute environments that use BEST_FIT as their allocation strategy, you can perform a blue/green update to update the AMI.
For all other compute environments, you can perform an AMI version update to update the AMI to the latest version.
imageKubernetesVersion (string) --
The Kubernetes version for the compute environment. If you don't specify a value, the latest version that Batch supports is used.
scalingPolicy (dict) --
The scaling policy configuration for the compute environment.
minScaleDownDelayMinutes (integer) --
The minimum time (in minutes) that Batch keeps instances running in the compute environment after their jobs complete. For each instance, the delay period begins when the last job finishes. If no new jobs are placed on the instance during this delay, Batch terminates the instance once the delay expires.
Valid Range: Minimum value of 20. Maximum value of 10080. Use 0 to unset and disable the scale down delay.
managedInstancesProvider (dict) --
The configuration for the Amazon ECS Managed Instances capacity provider. This parameter is required when computeResources.type is ECS_MANAGED_INSTANCES and must not be specified for other compute environment types.
For more information, see Amazon ECS Managed Instances compute environments in the Batch User Guide.
propagateTags (string) --
Specifies whether tags on the capacity provider are propagated to the Amazon EC2 instances it launches. Valid values:
CAPACITY_PROVIDER — Propagates tags to instances.
NONE (default) — Does not propagate tags to instances.
infrastructureRoleArn (string) --
The Amazon Resource Name (ARN) of the IAM role that Amazon ECS assumes to manage Amazon EC2 instances on your behalf. This role must have a trust policy for ecs.amazonaws.com. You must have the iam:PassRole permission for this role with the condition iam:PassedToService: ecs.amazonaws.com.
instanceLaunchTemplate (dict) --
The instance launch configuration for the Amazon ECS Managed Instances capacity provider. Contains networking, instance profile, instance requirements, capacity type, storage, and monitoring configuration.
ec2InstanceProfileArn (string) --
The Amazon Resource Name (ARN) of the Amazon EC2 instance profile for the managed instances. The instance profile must use the AmazonECSInstanceRolePolicyForManagedInstances managed policy with a trust policy for ec2.amazonaws.com.
networkConfiguration (dict) --
The network configuration for the managed instances. Specifies the VPC subnets and security groups where instances are launched.
subnets (list) --
The VPC subnets where managed instances are launched. If your subnets don't provide public IP addresses, they must have a NAT gateway for outbound internet access.
(string) --
securityGroups (list) --
The VPC security groups to associate with the managed instances.
(string) --
instanceRequirements (dict) --
The instance type requirements for the capacity provider. Use this to constrain which Amazon EC2 instance types Amazon ECS can launch. If not specified, all available instance types are eligible.
allowedInstanceTypes (list) --
A list of specific instance types or instance families that Amazon ECS can launch (for example, m5.large or g5). When specified, only these instance types are used.
(string) --
capacityOptionType (string) --
The capacity pricing model for the managed instances. Valid values:
ON_DEMAND (default) — On-Demand pricing.
SPOT — Spot Instances, which can provide significant cost savings for fault-tolerant workloads.
storageConfiguration (dict) --
The storage configuration for the managed instances. Configures the root EBS volume size. If not specified, the service uses the default EBS volume size for the instance type.
storageSizeGiB (integer) --
The size of the root EBS volume in GiB for the managed instances.
monitoring (string) --
The level of CloudWatch monitoring for the managed instances. Valid values are BASIC and DETAILED.
fipsEnabled (boolean) --
Specifies whether FIPS 140-2 validated cryptographic modules are enabled on the managed instances. Not available in all Regions.
capacityReservations (dict) --
The capacity reservation configuration for the managed instances. Use this to target On-Demand Capacity Reservations or Reserved Instances for predictable capacity and cost optimization.
reservationGroupArn (string) --
The Amazon Resource Name (ARN) of the capacity reservation group to target.
reservationPreference (string) --
The capacity reservation preference. Valid values:
RESERVATIONS_ONLY — Use only capacity reservations.
RESERVATIONS_FIRST — Prefer capacity reservations but fall back to On-Demand if unavailable.
RESERVATIONS_EXCLUDED — Do not use capacity reservations.
instanceMetadataTagsPropagation (boolean) --
Specifies whether instance tags are accessible from the instance metadata service (IMDS). If not specified, instance tags are not accessible from IMDS.
localStorageConfiguration (dict) --
The local storage configuration for the managed instances. If not specified, instance store volumes are not available to containers.
useLocalStorage (boolean) --
Specifies whether instance store volumes (local NVMe SSDs) are available to containers. When enabled, containers can use the instance store for high-performance temporary storage.
infrastructureOptimization (dict) --
The infrastructure optimization configuration for the capacity provider. Specifies the idle-instance scale-in behavior.
scaleInAfter (integer) --
The number of seconds an instance can remain idle before it is terminated. Valid values are -1 or 0 to 3600. Use -1 as a special value to disable scale-in (instances are never terminated for being idle). If not specified, a default value applies.
capacityTags (dict) --
The tags to apply to the Amazon ECS capacity provider and Amazon EC2 instances launched by the compute environment. These tags are separate from the compute environment resource tags (the top-level tags parameter). Use capacityTags for cost allocation and organization of the underlying infrastructure resources.
This parameter is only valid for ECS_MANAGED_INSTANCES compute environments. You must have the batch:SetCapacityTags permission on the compute environment resource to use this parameter.
(string) --
(string) --
serviceRole (string) --
The service role that's associated with the compute environment that allows Batch to make calls to Amazon Web Services API operations on your behalf. For more information, see Batch service IAM role in the Batch User Guide.
updatePolicy (dict) --
Specifies the infrastructure update policy for the compute environment. For more information about infrastructure updates, see Updating compute environments in the Batch User Guide.
terminateJobsOnUpdate (boolean) --
Specifies whether jobs are automatically terminated when the compute environment infrastructure is updated. The default value is false.
jobExecutionTimeoutMinutes (integer) --
Specifies the job timeout (in minutes) when the compute environment infrastructure is updated. The default value is 30. The maximum value is 7200.
eksConfiguration (dict) --
The configuration for the Amazon EKS cluster that supports the Batch compute environment. Only specify this parameter if the containerOrchestrationType is EKS.
eksClusterArn (string) --
The Amazon Resource Name (ARN) of the Amazon EKS cluster. An example is ``arn:aws:eks:us-east-1:123456789012:cluster/ClusterForBatch ``.
kubernetesNamespace (string) --
The namespace of the Amazon EKS cluster. Batch manages pods in this namespace. The value can't left empty or null. It must be fewer than 64 characters long, can't be set to default, can't start with " kube-," and must match this regular expression: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$. For more information, see Namespaces in the Kubernetes documentation.
containerOrchestrationType (string) --
The orchestration type of the compute environment. The valid values are ECS (default) or EKS.
uuid (string) --
Unique identifier for the compute environment.
context (string) --
Reserved.
ecsSettings (dict) --
The Amazon ECS settings for the compute environment. These settings control CloudWatch Container Insights collection.
containerInsights (string) --
Specifies the CloudWatch Container Insights mode for the compute environment. Valid values are:
ENABLED
Turns on standard Container Insights, which collects CPU, memory, disk, and network utilization metrics for the compute environment.
ENHANCED
Turns on enhanced Container Insights, which collects the standard metrics along with additional per-task observability metrics.
DISABLED
Turns off Container Insights for the compute environment.
If you don't specify a value, the default is DISABLED. For more information, see Container Insights in the Batch User Guide.
nextToken (string) --
The nextToken value to include in a future DescribeComputeEnvironments request. When the results of a DescribeComputeEnvironments request exceed maxResults, this value can be used to retrieve the next page of results. This value is null when there are no more results to return.
{'jobDefinitions': {'ecsProperties': {'taskProperties': {'networkMode': 'string'}},
'nodeProperties': {'nodeRangeProperties': {'ecsProperties': {'taskProperties': {'networkMode': 'string'}}}},
'platformCapabilities': {'MANAGED_INSTANCES'}}}
Describes a list of job definitions. You can specify a status (such as ACTIVE) to only return job definitions that match that status.
See also: AWS API Documentation
Request Syntax
client.describe_job_definitions(
jobDefinitions=[
'string',
],
maxResults=123,
jobDefinitionName='string',
status='string',
nextToken='string'
)
list
A list of up to 100 job definitions. Each entry in the list can either be an ARN in the format arn:aws:batch:${Region}:${Account}:job-definition/${JobDefinitionName}:${Revision} or a short version using the form ${JobDefinitionName}:${Revision}. This parameter can't be used with other parameters.
(string) --
integer
The maximum number of results returned by DescribeJobDefinitions in paginated output. When this parameter is used, DescribeJobDefinitions only returns maxResults results in a single page and a nextToken response element. The remaining results of the initial request can be seen by sending another DescribeJobDefinitions request with the returned nextToken value. This value can be between 1 and 100. If this parameter isn't used, then DescribeJobDefinitions returns up to 100 results and a nextToken value if applicable.
string
The name of the job definition to describe.
string
The status used to filter job definitions.
string
The nextToken value returned from a previous paginated DescribeJobDefinitions request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return.
dict
Response Syntax
{
'jobDefinitions': [
{
'jobDefinitionName': 'string',
'jobDefinitionArn': 'string',
'revision': 123,
'status': 'string',
'type': 'string',
'schedulingPriority': 123,
'parameters': {
'string': 'string'
},
'retryStrategy': {
'attempts': 123,
'evaluateOnExit': [
{
'onStatusReason': 'string',
'onReason': 'string',
'onExitCode': 'string',
'action': 'RETRY'|'EXIT'
},
]
},
'containerProperties': {
'image': 'string',
'vcpus': 123,
'memory': 123,
'command': [
'string',
],
'jobRoleArn': 'string',
'executionRoleArn': 'string',
'volumes': [
{
'host': {
'sourcePath': 'string'
},
'name': 'string',
'efsVolumeConfiguration': {
'fileSystemId': 'string',
'rootDirectory': 'string',
'transitEncryption': 'ENABLED'|'DISABLED',
'transitEncryptionPort': 123,
'authorizationConfig': {
'accessPointId': 'string',
'iam': 'ENABLED'|'DISABLED'
}
},
's3filesVolumeConfiguration': {
'fileSystemArn': 'string',
'rootDirectory': 'string',
'transitEncryptionPort': 123,
'accessPointArn': 'string'
}
},
],
'environment': [
{
'name': 'string',
'value': 'string'
},
],
'mountPoints': [
{
'containerPath': 'string',
'readOnly': True|False,
'sourceVolume': 'string'
},
],
'readonlyRootFilesystem': True|False,
'privileged': True|False,
'ulimits': [
{
'hardLimit': 123,
'name': 'string',
'softLimit': 123
},
],
'user': 'string',
'instanceType': 'string',
'resourceRequirements': [
{
'value': 'string',
'type': 'GPU'|'VCPU'|'MEMORY'
},
],
'linuxParameters': {
'devices': [
{
'hostPath': 'string',
'containerPath': 'string',
'permissions': [
'READ'|'WRITE'|'MKNOD',
]
},
],
'initProcessEnabled': True|False,
'sharedMemorySize': 123,
'tmpfs': [
{
'containerPath': 'string',
'size': 123,
'mountOptions': [
'string',
]
},
],
'maxSwap': 123,
'swappiness': 123
},
'logConfiguration': {
'logDriver': 'json-file'|'syslog'|'journald'|'gelf'|'fluentd'|'awslogs'|'splunk'|'awsfirelens',
'options': {
'string': 'string'
},
'secretOptions': [
{
'name': 'string',
'valueFrom': 'string'
},
]
},
'secrets': [
{
'name': 'string',
'valueFrom': 'string'
},
],
'networkConfiguration': {
'assignPublicIp': 'ENABLED'|'DISABLED'
},
'fargatePlatformConfiguration': {
'platformVersion': 'string'
},
'enableExecuteCommand': True|False,
'ephemeralStorage': {
'sizeInGiB': 123
},
'runtimePlatform': {
'operatingSystemFamily': 'string',
'cpuArchitecture': 'string'
},
'repositoryCredentials': {
'credentialsParameter': 'string'
}
},
'timeout': {
'attemptDurationSeconds': 123
},
'nodeProperties': {
'numNodes': 123,
'mainNode': 123,
'nodeRangeProperties': [
{
'targetNodes': 'string',
'container': {
'image': 'string',
'vcpus': 123,
'memory': 123,
'command': [
'string',
],
'jobRoleArn': 'string',
'executionRoleArn': 'string',
'volumes': [
{
'host': {
'sourcePath': 'string'
},
'name': 'string',
'efsVolumeConfiguration': {
'fileSystemId': 'string',
'rootDirectory': 'string',
'transitEncryption': 'ENABLED'|'DISABLED',
'transitEncryptionPort': 123,
'authorizationConfig': {
'accessPointId': 'string',
'iam': 'ENABLED'|'DISABLED'
}
},
's3filesVolumeConfiguration': {
'fileSystemArn': 'string',
'rootDirectory': 'string',
'transitEncryptionPort': 123,
'accessPointArn': 'string'
}
},
],
'environment': [
{
'name': 'string',
'value': 'string'
},
],
'mountPoints': [
{
'containerPath': 'string',
'readOnly': True|False,
'sourceVolume': 'string'
},
],
'readonlyRootFilesystem': True|False,
'privileged': True|False,
'ulimits': [
{
'hardLimit': 123,
'name': 'string',
'softLimit': 123
},
],
'user': 'string',
'instanceType': 'string',
'resourceRequirements': [
{
'value': 'string',
'type': 'GPU'|'VCPU'|'MEMORY'
},
],
'linuxParameters': {
'devices': [
{
'hostPath': 'string',
'containerPath': 'string',
'permissions': [
'READ'|'WRITE'|'MKNOD',
]
},
],
'initProcessEnabled': True|False,
'sharedMemorySize': 123,
'tmpfs': [
{
'containerPath': 'string',
'size': 123,
'mountOptions': [
'string',
]
},
],
'maxSwap': 123,
'swappiness': 123
},
'logConfiguration': {
'logDriver': 'json-file'|'syslog'|'journald'|'gelf'|'fluentd'|'awslogs'|'splunk'|'awsfirelens',
'options': {
'string': 'string'
},
'secretOptions': [
{
'name': 'string',
'valueFrom': 'string'
},
]
},
'secrets': [
{
'name': 'string',
'valueFrom': 'string'
},
],
'networkConfiguration': {
'assignPublicIp': 'ENABLED'|'DISABLED'
},
'fargatePlatformConfiguration': {
'platformVersion': 'string'
},
'enableExecuteCommand': True|False,
'ephemeralStorage': {
'sizeInGiB': 123
},
'runtimePlatform': {
'operatingSystemFamily': 'string',
'cpuArchitecture': 'string'
},
'repositoryCredentials': {
'credentialsParameter': 'string'
}
},
'instanceTypes': [
'string',
],
'ecsProperties': {
'taskProperties': [
{
'containers': [
{
'command': [
'string',
],
'dependsOn': [
{
'containerName': 'string',
'condition': 'string'
},
],
'environment': [
{
'name': 'string',
'value': 'string'
},
],
'essential': True|False,
'firelensConfiguration': {
'type': 'fluentd'|'fluentbit',
'options': {
'string': 'string'
}
},
'image': 'string',
'linuxParameters': {
'devices': [
{
'hostPath': 'string',
'containerPath': 'string',
'permissions': [
'READ'|'WRITE'|'MKNOD',
]
},
],
'initProcessEnabled': True|False,
'sharedMemorySize': 123,
'tmpfs': [
{
'containerPath': 'string',
'size': 123,
'mountOptions': [
'string',
]
},
],
'maxSwap': 123,
'swappiness': 123
},
'logConfiguration': {
'logDriver': 'json-file'|'syslog'|'journald'|'gelf'|'fluentd'|'awslogs'|'splunk'|'awsfirelens',
'options': {
'string': 'string'
},
'secretOptions': [
{
'name': 'string',
'valueFrom': 'string'
},
]
},
'mountPoints': [
{
'containerPath': 'string',
'readOnly': True|False,
'sourceVolume': 'string'
},
],
'name': 'string',
'privileged': True|False,
'readonlyRootFilesystem': True|False,
'repositoryCredentials': {
'credentialsParameter': 'string'
},
'resourceRequirements': [
{
'value': 'string',
'type': 'GPU'|'VCPU'|'MEMORY'
},
],
'secrets': [
{
'name': 'string',
'valueFrom': 'string'
},
],
'ulimits': [
{
'hardLimit': 123,
'name': 'string',
'softLimit': 123
},
],
'user': 'string',
'startTimeout': 123,
'stopTimeout': 123
},
],
'ephemeralStorage': {
'sizeInGiB': 123
},
'executionRoleArn': 'string',
'platformVersion': 'string',
'ipcMode': 'string',
'taskRoleArn': 'string',
'pidMode': 'string',
'networkConfiguration': {
'assignPublicIp': 'ENABLED'|'DISABLED'
},
'runtimePlatform': {
'operatingSystemFamily': 'string',
'cpuArchitecture': 'string'
},
'volumes': [
{
'host': {
'sourcePath': 'string'
},
'name': 'string',
'efsVolumeConfiguration': {
'fileSystemId': 'string',
'rootDirectory': 'string',
'transitEncryption': 'ENABLED'|'DISABLED',
'transitEncryptionPort': 123,
'authorizationConfig': {
'accessPointId': 'string',
'iam': 'ENABLED'|'DISABLED'
}
},
's3filesVolumeConfiguration': {
'fileSystemArn': 'string',
'rootDirectory': 'string',
'transitEncryptionPort': 123,
'accessPointArn': 'string'
}
},
],
'enableExecuteCommand': True|False,
'networkMode': 'string'
},
]
},
'eksProperties': {
'podProperties': {
'serviceAccountName': 'string',
'hostNetwork': True|False,
'dnsPolicy': 'string',
'imagePullSecrets': [
{
'name': 'string'
},
],
'containers': [
{
'name': 'string',
'image': 'string',
'imagePullPolicy': 'string',
'command': [
'string',
],
'args': [
'string',
],
'env': [
{
'name': 'string',
'value': 'string'
},
],
'resources': {
'limits': {
'string': 'string'
},
'requests': {
'string': 'string'
}
},
'volumeMounts': [
{
'name': 'string',
'mountPath': 'string',
'subPath': 'string',
'readOnly': True|False
},
],
'securityContext': {
'runAsUser': 123,
'runAsGroup': 123,
'privileged': True|False,
'allowPrivilegeEscalation': True|False,
'readOnlyRootFilesystem': True|False,
'runAsNonRoot': True|False
}
},
],
'initContainers': [
{
'name': 'string',
'image': 'string',
'imagePullPolicy': 'string',
'command': [
'string',
],
'args': [
'string',
],
'env': [
{
'name': 'string',
'value': 'string'
},
],
'resources': {
'limits': {
'string': 'string'
},
'requests': {
'string': 'string'
}
},
'volumeMounts': [
{
'name': 'string',
'mountPath': 'string',
'subPath': 'string',
'readOnly': True|False
},
],
'securityContext': {
'runAsUser': 123,
'runAsGroup': 123,
'privileged': True|False,
'allowPrivilegeEscalation': True|False,
'readOnlyRootFilesystem': True|False,
'runAsNonRoot': True|False
}
},
],
'volumes': [
{
'name': 'string',
'hostPath': {
'path': 'string'
},
'emptyDir': {
'medium': 'string',
'sizeLimit': 'string'
},
'secret': {
'secretName': 'string',
'optional': True|False
},
'persistentVolumeClaim': {
'claimName': 'string',
'readOnly': True|False
}
},
],
'metadata': {
'labels': {
'string': 'string'
},
'annotations': {
'string': 'string'
},
'namespace': 'string'
},
'shareProcessNamespace': True|False
}
},
'consumableResourceProperties': {
'consumableResourceList': [
{
'consumableResource': 'string',
'quantity': 123
},
]
}
},
]
},
'tags': {
'string': 'string'
},
'propagateTags': True|False,
'platformCapabilities': [
'EC2'|'FARGATE'|'MANAGED_INSTANCES',
],
'ecsProperties': {
'taskProperties': [
{
'containers': [
{
'command': [
'string',
],
'dependsOn': [
{
'containerName': 'string',
'condition': 'string'
},
],
'environment': [
{
'name': 'string',
'value': 'string'
},
],
'essential': True|False,
'firelensConfiguration': {
'type': 'fluentd'|'fluentbit',
'options': {
'string': 'string'
}
},
'image': 'string',
'linuxParameters': {
'devices': [
{
'hostPath': 'string',
'containerPath': 'string',
'permissions': [
'READ'|'WRITE'|'MKNOD',
]
},
],
'initProcessEnabled': True|False,
'sharedMemorySize': 123,
'tmpfs': [
{
'containerPath': 'string',
'size': 123,
'mountOptions': [
'string',
]
},
],
'maxSwap': 123,
'swappiness': 123
},
'logConfiguration': {
'logDriver': 'json-file'|'syslog'|'journald'|'gelf'|'fluentd'|'awslogs'|'splunk'|'awsfirelens',
'options': {
'string': 'string'
},
'secretOptions': [
{
'name': 'string',
'valueFrom': 'string'
},
]
},
'mountPoints': [
{
'containerPath': 'string',
'readOnly': True|False,
'sourceVolume': 'string'
},
],
'name': 'string',
'privileged': True|False,
'readonlyRootFilesystem': True|False,
'repositoryCredentials': {
'credentialsParameter': 'string'
},
'resourceRequirements': [
{
'value': 'string',
'type': 'GPU'|'VCPU'|'MEMORY'
},
],
'secrets': [
{
'name': 'string',
'valueFrom': 'string'
},
],
'ulimits': [
{
'hardLimit': 123,
'name': 'string',
'softLimit': 123
},
],
'user': 'string',
'startTimeout': 123,
'stopTimeout': 123
},
],
'ephemeralStorage': {
'sizeInGiB': 123
},
'executionRoleArn': 'string',
'platformVersion': 'string',
'ipcMode': 'string',
'taskRoleArn': 'string',
'pidMode': 'string',
'networkConfiguration': {
'assignPublicIp': 'ENABLED'|'DISABLED'
},
'runtimePlatform': {
'operatingSystemFamily': 'string',
'cpuArchitecture': 'string'
},
'volumes': [
{
'host': {
'sourcePath': 'string'
},
'name': 'string',
'efsVolumeConfiguration': {
'fileSystemId': 'string',
'rootDirectory': 'string',
'transitEncryption': 'ENABLED'|'DISABLED',
'transitEncryptionPort': 123,
'authorizationConfig': {
'accessPointId': 'string',
'iam': 'ENABLED'|'DISABLED'
}
},
's3filesVolumeConfiguration': {
'fileSystemArn': 'string',
'rootDirectory': 'string',
'transitEncryptionPort': 123,
'accessPointArn': 'string'
}
},
],
'enableExecuteCommand': True|False,
'networkMode': 'string'
},
]
},
'eksProperties': {
'podProperties': {
'serviceAccountName': 'string',
'hostNetwork': True|False,
'dnsPolicy': 'string',
'imagePullSecrets': [
{
'name': 'string'
},
],
'containers': [
{
'name': 'string',
'image': 'string',
'imagePullPolicy': 'string',
'command': [
'string',
],
'args': [
'string',
],
'env': [
{
'name': 'string',
'value': 'string'
},
],
'resources': {
'limits': {
'string': 'string'
},
'requests': {
'string': 'string'
}
},
'volumeMounts': [
{
'name': 'string',
'mountPath': 'string',
'subPath': 'string',
'readOnly': True|False
},
],
'securityContext': {
'runAsUser': 123,
'runAsGroup': 123,
'privileged': True|False,
'allowPrivilegeEscalation': True|False,
'readOnlyRootFilesystem': True|False,
'runAsNonRoot': True|False
}
},
],
'initContainers': [
{
'name': 'string',
'image': 'string',
'imagePullPolicy': 'string',
'command': [
'string',
],
'args': [
'string',
],
'env': [
{
'name': 'string',
'value': 'string'
},
],
'resources': {
'limits': {
'string': 'string'
},
'requests': {
'string': 'string'
}
},
'volumeMounts': [
{
'name': 'string',
'mountPath': 'string',
'subPath': 'string',
'readOnly': True|False
},
],
'securityContext': {
'runAsUser': 123,
'runAsGroup': 123,
'privileged': True|False,
'allowPrivilegeEscalation': True|False,
'readOnlyRootFilesystem': True|False,
'runAsNonRoot': True|False
}
},
],
'volumes': [
{
'name': 'string',
'hostPath': {
'path': 'string'
},
'emptyDir': {
'medium': 'string',
'sizeLimit': 'string'
},
'secret': {
'secretName': 'string',
'optional': True|False
},
'persistentVolumeClaim': {
'claimName': 'string',
'readOnly': True|False
}
},
],
'metadata': {
'labels': {
'string': 'string'
},
'annotations': {
'string': 'string'
},
'namespace': 'string'
},
'shareProcessNamespace': True|False
}
},
'containerOrchestrationType': 'ECS'|'EKS',
'consumableResourceProperties': {
'consumableResourceList': [
{
'consumableResource': 'string',
'quantity': 123
},
]
}
},
],
'nextToken': 'string'
}
**Response Structure**
::
# This section is too large to render.
# Please see the AWS API Documentation linked below.
`AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/batch-2016-08-10/DescribeJobDefinitions>`_
{'jobQueues': {'jobQueueType': {'ECS_MANAGED_INSTANCES'}}}
Describes one or more of your job queues.
See also: AWS API Documentation
Request Syntax
client.describe_job_queues(
jobQueues=[
'string',
],
maxResults=123,
nextToken='string'
)
list
A list of up to 100 queue names or full queue Amazon Resource Name (ARN) entries.
(string) --
integer
The maximum number of results returned by DescribeJobQueues in paginated output. When this parameter is used, DescribeJobQueues only returns maxResults results in a single page and a nextToken response element. The remaining results of the initial request can be seen by sending another DescribeJobQueues request with the returned nextToken value. This value can be between 1 and 100. If this parameter isn't used, then DescribeJobQueues returns up to 100 results and a nextToken value if applicable.
string
The nextToken value returned from a previous paginated DescribeJobQueues request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return.
dict
Response Syntax
{
'jobQueues': [
{
'jobQueueName': 'string',
'jobQueueArn': 'string',
'state': 'ENABLED'|'DISABLED',
'schedulingPolicyArn': 'string',
'status': 'CREATING'|'UPDATING'|'DELETING'|'DELETED'|'VALID'|'INVALID',
'statusReason': 'string',
'priority': 123,
'computeEnvironmentOrder': [
{
'order': 123,
'computeEnvironment': 'string'
},
],
'serviceEnvironmentOrder': [
{
'order': 123,
'serviceEnvironment': 'string'
},
],
'jobQueueType': 'EKS'|'ECS'|'ECS_FARGATE'|'SAGEMAKER_TRAINING'|'ECS_MANAGED_INSTANCES',
'tags': {
'string': 'string'
},
'jobStateTimeLimitActions': [
{
'reason': 'string',
'state': 'RUNNABLE',
'maxTimeSeconds': 123,
'action': 'CANCEL'|'TERMINATE'
},
]
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
jobQueues (list) --
The list of job queues.
(dict) --
An object that represents the details for an Batch job queue.
jobQueueName (string) --
The job queue name.
jobQueueArn (string) --
The Amazon Resource Name (ARN) of the job queue.
state (string) --
Describes the ability of the queue to accept new jobs. If the job queue state is ENABLED, it can accept jobs. If the job queue state is DISABLED, new jobs can't be added to the queue, but jobs already in the queue can finish.
schedulingPolicyArn (string) --
The Amazon Resource Name (ARN) of the scheduling policy. The format is aws:Partition:batch:Region:Account:scheduling-policy/Name ``. For example, ``aws:aws:batch:us-west-2:123456789012:scheduling-policy/MySchedulingPolicy.
status (string) --
The status of the job queue (for example, CREATING or VALID).
statusReason (string) --
A short, human-readable string to provide additional details for the current status of the job queue.
priority (integer) --
The priority of the job queue. Job queue priority determines the order that job queues are evaluated when multiple queues dispatch jobs within a shared compute environment. A higher value for priority indicates a higher priority. Queues are evaluated in cycles, in descending order by priority. For example, a job queue with a priority value of 10 is evaluated before a queue with a priority value of 1. All of the compute environments must be either Amazon EC2 ( EC2 or SPOT) or Fargate ( FARGATE or FARGATE_SPOT). Amazon EC2 and Fargate compute environments can't be mixed.
computeEnvironmentOrder (list) --
The compute environments that are attached to the job queue and the order that job placement is preferred. Compute environments are selected for job placement in ascending order.
(dict) --
The order that compute environments are tried in for job placement within a queue. Compute environments are tried in ascending order. For example, if two compute environments are associated with a job queue, the compute environment with a lower order integer value is tried for job placement first. Compute environments must be in the VALID state before you can associate them with a job queue. All of the compute environments must be either EC2 ( EC2 or SPOT) or Fargate ( FARGATE or FARGATE_SPOT); Amazon EC2 and Fargate compute environments can't be mixed.
order (integer) --
The order of the compute environment. Compute environments are tried in ascending order. For example, if two compute environments are associated with a job queue, the compute environment with a lower order integer value is tried for job placement first.
computeEnvironment (string) --
The Amazon Resource Name (ARN) of the compute environment.
serviceEnvironmentOrder (list) --
The order of the service environment associated with the job queue. Job queues with a higher priority are evaluated first when associated with the same service environment.
(dict) --
Specifies the order of a service environment for a job queue. This determines the priority order when multiple service environments are associated with the same job queue.
order (integer) --
The order of the service environment. Job queues with a higher priority are evaluated first when associated with the same service environment.
serviceEnvironment (string) --
The name or ARN of the service environment.
jobQueueType (string) --
The type of job queue. For service jobs that run on SageMaker Training, this value is SAGEMAKER_TRAINING. For regular container jobs, this value is EKS, ECS, or ECS_FARGATE depending on the compute environment.
tags (dict) --
The tags that are applied to the job queue. For more information, see Tagging your Batch resources in Batch User Guide.
(string) --
(string) --
jobStateTimeLimitActions (list) --
The set of actions that Batch perform on jobs that remain at the head of the job queue in the specified state longer than specified times. Batch will perform each action after maxTimeSeconds has passed.
(dict) --
Specifies an action that Batch will take after the job has remained at the head of the queue in the specified state for longer than the specified time.
reason (string) --
The reason to log for the action being taken.
state (string) --
The state of the job needed to trigger the action. The only supported value is RUNNABLE.
maxTimeSeconds (integer) --
The approximate amount of time, in seconds, that must pass with the job in the specified state before the action is taken. The minimum value is 600 (10 minutes) and the maximum value is 86,400 (24 hours).
action (string) --
The action to take when a job is at the head of the job queue in the specified state for the specified period of time. For job queues connected to a ECS, FARGATE or EKS compute environment, the only supported value is CANCEL, which will cancel the job. For job queues connected to a SAGEMAKER_TRAINING service environment, the only supported value is TERMINATE, which will terminate the job.
nextToken (string) --
The nextToken value to include in a future DescribeJobQueues request. When the results of a DescribeJobQueues request exceed maxResults, this value can be used to retrieve the next page of results. This value is null when there are no more results to return.
{'jobs': {'ecsProperties': {'taskProperties': {'networkMode': 'string'}},
'nodeProperties': {'nodeRangeProperties': {'ecsProperties': {'taskProperties': {'networkMode': 'string'}}}},
'platformCapabilities': {'MANAGED_INSTANCES'}}}
Describes a list of Batch jobs.
See also: AWS API Documentation
Request Syntax
client.describe_jobs(
jobs=[
'string',
]
)
list
[REQUIRED]
A list of up to 100 job IDs.
(string) --
dict
Response Syntax
{
'jobs': [
{
'jobArn': 'string',
'jobName': 'string',
'jobId': 'string',
'jobQueue': 'string',
'status': 'SUBMITTED'|'PENDING'|'RUNNABLE'|'STARTING'|'RUNNING'|'SUCCEEDED'|'FAILED',
'shareIdentifier': 'string',
'schedulingPriority': 123,
'attempts': [
{
'container': {
'containerInstanceArn': 'string',
'taskArn': 'string',
'exitCode': 123,
'reason': 'string',
'logStreamName': 'string',
'networkInterfaces': [
{
'attachmentId': 'string',
'ipv6Address': 'string',
'privateIpv4Address': 'string'
},
]
},
'startedAt': 123,
'stoppedAt': 123,
'statusReason': 'string',
'taskProperties': [
{
'containerInstanceArn': 'string',
'taskArn': 'string',
'containers': [
{
'exitCode': 123,
'name': 'string',
'reason': 'string',
'logStreamName': 'string',
'networkInterfaces': [
{
'attachmentId': 'string',
'ipv6Address': 'string',
'privateIpv4Address': 'string'
},
]
},
]
},
]
},
],
'statusReason': 'string',
'createdAt': 123,
'retryStrategy': {
'attempts': 123,
'evaluateOnExit': [
{
'onStatusReason': 'string',
'onReason': 'string',
'onExitCode': 'string',
'action': 'RETRY'|'EXIT'
},
]
},
'startedAt': 123,
'stoppedAt': 123,
'dependsOn': [
{
'jobId': 'string',
'type': 'N_TO_N'|'SEQUENTIAL'
},
],
'jobDefinition': 'string',
'parameters': {
'string': 'string'
},
'container': {
'image': 'string',
'vcpus': 123,
'memory': 123,
'command': [
'string',
],
'jobRoleArn': 'string',
'executionRoleArn': 'string',
'volumes': [
{
'host': {
'sourcePath': 'string'
},
'name': 'string',
'efsVolumeConfiguration': {
'fileSystemId': 'string',
'rootDirectory': 'string',
'transitEncryption': 'ENABLED'|'DISABLED',
'transitEncryptionPort': 123,
'authorizationConfig': {
'accessPointId': 'string',
'iam': 'ENABLED'|'DISABLED'
}
},
's3filesVolumeConfiguration': {
'fileSystemArn': 'string',
'rootDirectory': 'string',
'transitEncryptionPort': 123,
'accessPointArn': 'string'
}
},
],
'environment': [
{
'name': 'string',
'value': 'string'
},
],
'mountPoints': [
{
'containerPath': 'string',
'readOnly': True|False,
'sourceVolume': 'string'
},
],
'readonlyRootFilesystem': True|False,
'ulimits': [
{
'hardLimit': 123,
'name': 'string',
'softLimit': 123
},
],
'privileged': True|False,
'user': 'string',
'exitCode': 123,
'reason': 'string',
'containerInstanceArn': 'string',
'taskArn': 'string',
'logStreamName': 'string',
'instanceType': 'string',
'networkInterfaces': [
{
'attachmentId': 'string',
'ipv6Address': 'string',
'privateIpv4Address': 'string'
},
],
'resourceRequirements': [
{
'value': 'string',
'type': 'GPU'|'VCPU'|'MEMORY'
},
],
'linuxParameters': {
'devices': [
{
'hostPath': 'string',
'containerPath': 'string',
'permissions': [
'READ'|'WRITE'|'MKNOD',
]
},
],
'initProcessEnabled': True|False,
'sharedMemorySize': 123,
'tmpfs': [
{
'containerPath': 'string',
'size': 123,
'mountOptions': [
'string',
]
},
],
'maxSwap': 123,
'swappiness': 123
},
'logConfiguration': {
'logDriver': 'json-file'|'syslog'|'journald'|'gelf'|'fluentd'|'awslogs'|'splunk'|'awsfirelens',
'options': {
'string': 'string'
},
'secretOptions': [
{
'name': 'string',
'valueFrom': 'string'
},
]
},
'secrets': [
{
'name': 'string',
'valueFrom': 'string'
},
],
'networkConfiguration': {
'assignPublicIp': 'ENABLED'|'DISABLED'
},
'fargatePlatformConfiguration': {
'platformVersion': 'string'
},
'ephemeralStorage': {
'sizeInGiB': 123
},
'runtimePlatform': {
'operatingSystemFamily': 'string',
'cpuArchitecture': 'string'
},
'repositoryCredentials': {
'credentialsParameter': 'string'
},
'enableExecuteCommand': True|False
},
'nodeDetails': {
'nodeIndex': 123,
'isMainNode': True|False
},
'nodeProperties': {
'numNodes': 123,
'mainNode': 123,
'nodeRangeProperties': [
{
'targetNodes': 'string',
'container': {
'image': 'string',
'vcpus': 123,
'memory': 123,
'command': [
'string',
],
'jobRoleArn': 'string',
'executionRoleArn': 'string',
'volumes': [
{
'host': {
'sourcePath': 'string'
},
'name': 'string',
'efsVolumeConfiguration': {
'fileSystemId': 'string',
'rootDirectory': 'string',
'transitEncryption': 'ENABLED'|'DISABLED',
'transitEncryptionPort': 123,
'authorizationConfig': {
'accessPointId': 'string',
'iam': 'ENABLED'|'DISABLED'
}
},
's3filesVolumeConfiguration': {
'fileSystemArn': 'string',
'rootDirectory': 'string',
'transitEncryptionPort': 123,
'accessPointArn': 'string'
}
},
],
'environment': [
{
'name': 'string',
'value': 'string'
},
],
'mountPoints': [
{
'containerPath': 'string',
'readOnly': True|False,
'sourceVolume': 'string'
},
],
'readonlyRootFilesystem': True|False,
'privileged': True|False,
'ulimits': [
{
'hardLimit': 123,
'name': 'string',
'softLimit': 123
},
],
'user': 'string',
'instanceType': 'string',
'resourceRequirements': [
{
'value': 'string',
'type': 'GPU'|'VCPU'|'MEMORY'
},
],
'linuxParameters': {
'devices': [
{
'hostPath': 'string',
'containerPath': 'string',
'permissions': [
'READ'|'WRITE'|'MKNOD',
]
},
],
'initProcessEnabled': True|False,
'sharedMemorySize': 123,
'tmpfs': [
{
'containerPath': 'string',
'size': 123,
'mountOptions': [
'string',
]
},
],
'maxSwap': 123,
'swappiness': 123
},
'logConfiguration': {
'logDriver': 'json-file'|'syslog'|'journald'|'gelf'|'fluentd'|'awslogs'|'splunk'|'awsfirelens',
'options': {
'string': 'string'
},
'secretOptions': [
{
'name': 'string',
'valueFrom': 'string'
},
]
},
'secrets': [
{
'name': 'string',
'valueFrom': 'string'
},
],
'networkConfiguration': {
'assignPublicIp': 'ENABLED'|'DISABLED'
},
'fargatePlatformConfiguration': {
'platformVersion': 'string'
},
'enableExecuteCommand': True|False,
'ephemeralStorage': {
'sizeInGiB': 123
},
'runtimePlatform': {
'operatingSystemFamily': 'string',
'cpuArchitecture': 'string'
},
'repositoryCredentials': {
'credentialsParameter': 'string'
}
},
'instanceTypes': [
'string',
],
'ecsProperties': {
'taskProperties': [
{
'containers': [
{
'command': [
'string',
],
'dependsOn': [
{
'containerName': 'string',
'condition': 'string'
},
],
'environment': [
{
'name': 'string',
'value': 'string'
},
],
'essential': True|False,
'firelensConfiguration': {
'type': 'fluentd'|'fluentbit',
'options': {
'string': 'string'
}
},
'image': 'string',
'linuxParameters': {
'devices': [
{
'hostPath': 'string',
'containerPath': 'string',
'permissions': [
'READ'|'WRITE'|'MKNOD',
]
},
],
'initProcessEnabled': True|False,
'sharedMemorySize': 123,
'tmpfs': [
{
'containerPath': 'string',
'size': 123,
'mountOptions': [
'string',
]
},
],
'maxSwap': 123,
'swappiness': 123
},
'logConfiguration': {
'logDriver': 'json-file'|'syslog'|'journald'|'gelf'|'fluentd'|'awslogs'|'splunk'|'awsfirelens',
'options': {
'string': 'string'
},
'secretOptions': [
{
'name': 'string',
'valueFrom': 'string'
},
]
},
'mountPoints': [
{
'containerPath': 'string',
'readOnly': True|False,
'sourceVolume': 'string'
},
],
'name': 'string',
'privileged': True|False,
'readonlyRootFilesystem': True|False,
'repositoryCredentials': {
'credentialsParameter': 'string'
},
'resourceRequirements': [
{
'value': 'string',
'type': 'GPU'|'VCPU'|'MEMORY'
},
],
'secrets': [
{
'name': 'string',
'valueFrom': 'string'
},
],
'ulimits': [
{
'hardLimit': 123,
'name': 'string',
'softLimit': 123
},
],
'user': 'string',
'startTimeout': 123,
'stopTimeout': 123
},
],
'ephemeralStorage': {
'sizeInGiB': 123
},
'executionRoleArn': 'string',
'platformVersion': 'string',
'ipcMode': 'string',
'taskRoleArn': 'string',
'pidMode': 'string',
'networkConfiguration': {
'assignPublicIp': 'ENABLED'|'DISABLED'
},
'runtimePlatform': {
'operatingSystemFamily': 'string',
'cpuArchitecture': 'string'
},
'volumes': [
{
'host': {
'sourcePath': 'string'
},
'name': 'string',
'efsVolumeConfiguration': {
'fileSystemId': 'string',
'rootDirectory': 'string',
'transitEncryption': 'ENABLED'|'DISABLED',
'transitEncryptionPort': 123,
'authorizationConfig': {
'accessPointId': 'string',
'iam': 'ENABLED'|'DISABLED'
}
},
's3filesVolumeConfiguration': {
'fileSystemArn': 'string',
'rootDirectory': 'string',
'transitEncryptionPort': 123,
'accessPointArn': 'string'
}
},
],
'enableExecuteCommand': True|False,
'networkMode': 'string'
},
]
},
'eksProperties': {
'podProperties': {
'serviceAccountName': 'string',
'hostNetwork': True|False,
'dnsPolicy': 'string',
'imagePullSecrets': [
{
'name': 'string'
},
],
'containers': [
{
'name': 'string',
'image': 'string',
'imagePullPolicy': 'string',
'command': [
'string',
],
'args': [
'string',
],
'env': [
{
'name': 'string',
'value': 'string'
},
],
'resources': {
'limits': {
'string': 'string'
},
'requests': {
'string': 'string'
}
},
'volumeMounts': [
{
'name': 'string',
'mountPath': 'string',
'subPath': 'string',
'readOnly': True|False
},
],
'securityContext': {
'runAsUser': 123,
'runAsGroup': 123,
'privileged': True|False,
'allowPrivilegeEscalation': True|False,
'readOnlyRootFilesystem': True|False,
'runAsNonRoot': True|False
}
},
],
'initContainers': [
{
'name': 'string',
'image': 'string',
'imagePullPolicy': 'string',
'command': [
'string',
],
'args': [
'string',
],
'env': [
{
'name': 'string',
'value': 'string'
},
],
'resources': {
'limits': {
'string': 'string'
},
'requests': {
'string': 'string'
}
},
'volumeMounts': [
{
'name': 'string',
'mountPath': 'string',
'subPath': 'string',
'readOnly': True|False
},
],
'securityContext': {
'runAsUser': 123,
'runAsGroup': 123,
'privileged': True|False,
'allowPrivilegeEscalation': True|False,
'readOnlyRootFilesystem': True|False,
'runAsNonRoot': True|False
}
},
],
'volumes': [
{
'name': 'string',
'hostPath': {
'path': 'string'
},
'emptyDir': {
'medium': 'string',
'sizeLimit': 'string'
},
'secret': {
'secretName': 'string',
'optional': True|False
},
'persistentVolumeClaim': {
'claimName': 'string',
'readOnly': True|False
}
},
],
'metadata': {
'labels': {
'string': 'string'
},
'annotations': {
'string': 'string'
},
'namespace': 'string'
},
'shareProcessNamespace': True|False
}
},
'consumableResourceProperties': {
'consumableResourceList': [
{
'consumableResource': 'string',
'quantity': 123
},
]
}
},
]
},
'arrayProperties': {
'statusSummary': {
'string': 123
},
'statusSummaryLastUpdatedAt': 123,
'size': 123,
'index': 123
},
'timeout': {
'attemptDurationSeconds': 123
},
'tags': {
'string': 'string'
},
'propagateTags': True|False,
'platformCapabilities': [
'EC2'|'FARGATE'|'MANAGED_INSTANCES',
],
'eksProperties': {
'podProperties': {
'serviceAccountName': 'string',
'hostNetwork': True|False,
'dnsPolicy': 'string',
'imagePullSecrets': [
{
'name': 'string'
},
],
'containers': [
{
'name': 'string',
'image': 'string',
'imagePullPolicy': 'string',
'command': [
'string',
],
'args': [
'string',
],
'env': [
{
'name': 'string',
'value': 'string'
},
],
'resources': {
'limits': {
'string': 'string'
},
'requests': {
'string': 'string'
}
},
'exitCode': 123,
'reason': 'string',
'volumeMounts': [
{
'name': 'string',
'mountPath': 'string',
'subPath': 'string',
'readOnly': True|False
},
],
'securityContext': {
'runAsUser': 123,
'runAsGroup': 123,
'privileged': True|False,
'allowPrivilegeEscalation': True|False,
'readOnlyRootFilesystem': True|False,
'runAsNonRoot': True|False
}
},
],
'initContainers': [
{
'name': 'string',
'image': 'string',
'imagePullPolicy': 'string',
'command': [
'string',
],
'args': [
'string',
],
'env': [
{
'name': 'string',
'value': 'string'
},
],
'resources': {
'limits': {
'string': 'string'
},
'requests': {
'string': 'string'
}
},
'exitCode': 123,
'reason': 'string',
'volumeMounts': [
{
'name': 'string',
'mountPath': 'string',
'subPath': 'string',
'readOnly': True|False
},
],
'securityContext': {
'runAsUser': 123,
'runAsGroup': 123,
'privileged': True|False,
'allowPrivilegeEscalation': True|False,
'readOnlyRootFilesystem': True|False,
'runAsNonRoot': True|False
}
},
],
'volumes': [
{
'name': 'string',
'hostPath': {
'path': 'string'
},
'emptyDir': {
'medium': 'string',
'sizeLimit': 'string'
},
'secret': {
'secretName': 'string',
'optional': True|False
},
'persistentVolumeClaim': {
'claimName': 'string',
'readOnly': True|False
}
},
],
'podName': 'string',
'nodeName': 'string',
'metadata': {
'labels': {
'string': 'string'
},
'annotations': {
'string': 'string'
},
'namespace': 'string'
},
'shareProcessNamespace': True|False
}
},
'eksAttempts': [
{
'containers': [
{
'name': 'string',
'containerID': 'string',
'exitCode': 123,
'reason': 'string'
},
],
'initContainers': [
{
'name': 'string',
'containerID': 'string',
'exitCode': 123,
'reason': 'string'
},
],
'eksClusterArn': 'string',
'podName': 'string',
'podNamespace': 'string',
'nodeName': 'string',
'startedAt': 123,
'stoppedAt': 123,
'statusReason': 'string'
},
],
'ecsProperties': {
'taskProperties': [
{
'containers': [
{
'command': [
'string',
],
'dependsOn': [
{
'containerName': 'string',
'condition': 'string'
},
],
'environment': [
{
'name': 'string',
'value': 'string'
},
],
'essential': True|False,
'firelensConfiguration': {
'type': 'fluentd'|'fluentbit',
'options': {
'string': 'string'
}
},
'image': 'string',
'linuxParameters': {
'devices': [
{
'hostPath': 'string',
'containerPath': 'string',
'permissions': [
'READ'|'WRITE'|'MKNOD',
]
},
],
'initProcessEnabled': True|False,
'sharedMemorySize': 123,
'tmpfs': [
{
'containerPath': 'string',
'size': 123,
'mountOptions': [
'string',
]
},
],
'maxSwap': 123,
'swappiness': 123
},
'logConfiguration': {
'logDriver': 'json-file'|'syslog'|'journald'|'gelf'|'fluentd'|'awslogs'|'splunk'|'awsfirelens',
'options': {
'string': 'string'
},
'secretOptions': [
{
'name': 'string',
'valueFrom': 'string'
},
]
},
'mountPoints': [
{
'containerPath': 'string',
'readOnly': True|False,
'sourceVolume': 'string'
},
],
'name': 'string',
'privileged': True|False,
'readonlyRootFilesystem': True|False,
'repositoryCredentials': {
'credentialsParameter': 'string'
},
'resourceRequirements': [
{
'value': 'string',
'type': 'GPU'|'VCPU'|'MEMORY'
},
],
'secrets': [
{
'name': 'string',
'valueFrom': 'string'
},
],
'ulimits': [
{
'hardLimit': 123,
'name': 'string',
'softLimit': 123
},
],
'user': 'string',
'startTimeout': 123,
'stopTimeout': 123,
'exitCode': 123,
'reason': 'string',
'logStreamName': 'string',
'networkInterfaces': [
{
'attachmentId': 'string',
'ipv6Address': 'string',
'privateIpv4Address': 'string'
},
]
},
],
'containerInstanceArn': 'string',
'taskArn': 'string',
'ephemeralStorage': {
'sizeInGiB': 123
},
'executionRoleArn': 'string',
'platformVersion': 'string',
'ipcMode': 'string',
'taskRoleArn': 'string',
'pidMode': 'string',
'networkConfiguration': {
'assignPublicIp': 'ENABLED'|'DISABLED'
},
'runtimePlatform': {
'operatingSystemFamily': 'string',
'cpuArchitecture': 'string'
},
'volumes': [
{
'host': {
'sourcePath': 'string'
},
'name': 'string',
'efsVolumeConfiguration': {
'fileSystemId': 'string',
'rootDirectory': 'string',
'transitEncryption': 'ENABLED'|'DISABLED',
'transitEncryptionPort': 123,
'authorizationConfig': {
'accessPointId': 'string',
'iam': 'ENABLED'|'DISABLED'
}
},
's3filesVolumeConfiguration': {
'fileSystemArn': 'string',
'rootDirectory': 'string',
'transitEncryptionPort': 123,
'accessPointArn': 'string'
}
},
],
'enableExecuteCommand': True|False,
'networkMode': 'string'
},
]
},
'isCancelled': True|False,
'isTerminated': True|False,
'consumableResourceProperties': {
'consumableResourceList': [
{
'consumableResource': 'string',
'quantity': 123
},
]
}
},
]
}
**Response Structure**
::
# This section is too large to render.
# Please see the AWS API Documentation linked below.
`AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/batch-2016-08-10/DescribeJobs>`_
{'ecsProperties': {'taskProperties': {'networkMode': 'string'}},
'nodeProperties': {'nodeRangeProperties': {'ecsProperties': {'taskProperties': {'networkMode': 'string'}}}},
'platformCapabilities': {'MANAGED_INSTANCES'}}
Registers an Batch job definition.
See also: AWS API Documentation
Request Syntax
client.register_job_definition(
jobDefinitionName='string',
type='container'|'multinode',
parameters={
'string': 'string'
},
schedulingPriority=123,
containerProperties={
'image': 'string',
'vcpus': 123,
'memory': 123,
'command': [
'string',
],
'jobRoleArn': 'string',
'executionRoleArn': 'string',
'volumes': [
{
'host': {
'sourcePath': 'string'
},
'name': 'string',
'efsVolumeConfiguration': {
'fileSystemId': 'string',
'rootDirectory': 'string',
'transitEncryption': 'ENABLED'|'DISABLED',
'transitEncryptionPort': 123,
'authorizationConfig': {
'accessPointId': 'string',
'iam': 'ENABLED'|'DISABLED'
}
},
's3filesVolumeConfiguration': {
'fileSystemArn': 'string',
'rootDirectory': 'string',
'transitEncryptionPort': 123,
'accessPointArn': 'string'
}
},
],
'environment': [
{
'name': 'string',
'value': 'string'
},
],
'mountPoints': [
{
'containerPath': 'string',
'readOnly': True|False,
'sourceVolume': 'string'
},
],
'readonlyRootFilesystem': True|False,
'privileged': True|False,
'ulimits': [
{
'hardLimit': 123,
'name': 'string',
'softLimit': 123
},
],
'user': 'string',
'instanceType': 'string',
'resourceRequirements': [
{
'value': 'string',
'type': 'GPU'|'VCPU'|'MEMORY'
},
],
'linuxParameters': {
'devices': [
{
'hostPath': 'string',
'containerPath': 'string',
'permissions': [
'READ'|'WRITE'|'MKNOD',
]
},
],
'initProcessEnabled': True|False,
'sharedMemorySize': 123,
'tmpfs': [
{
'containerPath': 'string',
'size': 123,
'mountOptions': [
'string',
]
},
],
'maxSwap': 123,
'swappiness': 123
},
'logConfiguration': {
'logDriver': 'json-file'|'syslog'|'journald'|'gelf'|'fluentd'|'awslogs'|'splunk'|'awsfirelens',
'options': {
'string': 'string'
},
'secretOptions': [
{
'name': 'string',
'valueFrom': 'string'
},
]
},
'secrets': [
{
'name': 'string',
'valueFrom': 'string'
},
],
'networkConfiguration': {
'assignPublicIp': 'ENABLED'|'DISABLED'
},
'fargatePlatformConfiguration': {
'platformVersion': 'string'
},
'enableExecuteCommand': True|False,
'ephemeralStorage': {
'sizeInGiB': 123
},
'runtimePlatform': {
'operatingSystemFamily': 'string',
'cpuArchitecture': 'string'
},
'repositoryCredentials': {
'credentialsParameter': 'string'
}
},
nodeProperties={
'numNodes': 123,
'mainNode': 123,
'nodeRangeProperties': [
{
'targetNodes': 'string',
'container': {
'image': 'string',
'vcpus': 123,
'memory': 123,
'command': [
'string',
],
'jobRoleArn': 'string',
'executionRoleArn': 'string',
'volumes': [
{
'host': {
'sourcePath': 'string'
},
'name': 'string',
'efsVolumeConfiguration': {
'fileSystemId': 'string',
'rootDirectory': 'string',
'transitEncryption': 'ENABLED'|'DISABLED',
'transitEncryptionPort': 123,
'authorizationConfig': {
'accessPointId': 'string',
'iam': 'ENABLED'|'DISABLED'
}
},
's3filesVolumeConfiguration': {
'fileSystemArn': 'string',
'rootDirectory': 'string',
'transitEncryptionPort': 123,
'accessPointArn': 'string'
}
},
],
'environment': [
{
'name': 'string',
'value': 'string'
},
],
'mountPoints': [
{
'containerPath': 'string',
'readOnly': True|False,
'sourceVolume': 'string'
},
],
'readonlyRootFilesystem': True|False,
'privileged': True|False,
'ulimits': [
{
'hardLimit': 123,
'name': 'string',
'softLimit': 123
},
],
'user': 'string',
'instanceType': 'string',
'resourceRequirements': [
{
'value': 'string',
'type': 'GPU'|'VCPU'|'MEMORY'
},
],
'linuxParameters': {
'devices': [
{
'hostPath': 'string',
'containerPath': 'string',
'permissions': [
'READ'|'WRITE'|'MKNOD',
]
},
],
'initProcessEnabled': True|False,
'sharedMemorySize': 123,
'tmpfs': [
{
'containerPath': 'string',
'size': 123,
'mountOptions': [
'string',
]
},
],
'maxSwap': 123,
'swappiness': 123
},
'logConfiguration': {
'logDriver': 'json-file'|'syslog'|'journald'|'gelf'|'fluentd'|'awslogs'|'splunk'|'awsfirelens',
'options': {
'string': 'string'
},
'secretOptions': [
{
'name': 'string',
'valueFrom': 'string'
},
]
},
'secrets': [
{
'name': 'string',
'valueFrom': 'string'
},
],
'networkConfiguration': {
'assignPublicIp': 'ENABLED'|'DISABLED'
},
'fargatePlatformConfiguration': {
'platformVersion': 'string'
},
'enableExecuteCommand': True|False,
'ephemeralStorage': {
'sizeInGiB': 123
},
'runtimePlatform': {
'operatingSystemFamily': 'string',
'cpuArchitecture': 'string'
},
'repositoryCredentials': {
'credentialsParameter': 'string'
}
},
'instanceTypes': [
'string',
],
'ecsProperties': {
'taskProperties': [
{
'containers': [
{
'command': [
'string',
],
'dependsOn': [
{
'containerName': 'string',
'condition': 'string'
},
],
'environment': [
{
'name': 'string',
'value': 'string'
},
],
'essential': True|False,
'firelensConfiguration': {
'type': 'fluentd'|'fluentbit',
'options': {
'string': 'string'
}
},
'image': 'string',
'linuxParameters': {
'devices': [
{
'hostPath': 'string',
'containerPath': 'string',
'permissions': [
'READ'|'WRITE'|'MKNOD',
]
},
],
'initProcessEnabled': True|False,
'sharedMemorySize': 123,
'tmpfs': [
{
'containerPath': 'string',
'size': 123,
'mountOptions': [
'string',
]
},
],
'maxSwap': 123,
'swappiness': 123
},
'logConfiguration': {
'logDriver': 'json-file'|'syslog'|'journald'|'gelf'|'fluentd'|'awslogs'|'splunk'|'awsfirelens',
'options': {
'string': 'string'
},
'secretOptions': [
{
'name': 'string',
'valueFrom': 'string'
},
]
},
'mountPoints': [
{
'containerPath': 'string',
'readOnly': True|False,
'sourceVolume': 'string'
},
],
'name': 'string',
'privileged': True|False,
'readonlyRootFilesystem': True|False,
'repositoryCredentials': {
'credentialsParameter': 'string'
},
'resourceRequirements': [
{
'value': 'string',
'type': 'GPU'|'VCPU'|'MEMORY'
},
],
'secrets': [
{
'name': 'string',
'valueFrom': 'string'
},
],
'ulimits': [
{
'hardLimit': 123,
'name': 'string',
'softLimit': 123
},
],
'user': 'string',
'startTimeout': 123,
'stopTimeout': 123
},
],
'ephemeralStorage': {
'sizeInGiB': 123
},
'executionRoleArn': 'string',
'platformVersion': 'string',
'ipcMode': 'string',
'taskRoleArn': 'string',
'pidMode': 'string',
'networkConfiguration': {
'assignPublicIp': 'ENABLED'|'DISABLED'
},
'runtimePlatform': {
'operatingSystemFamily': 'string',
'cpuArchitecture': 'string'
},
'volumes': [
{
'host': {
'sourcePath': 'string'
},
'name': 'string',
'efsVolumeConfiguration': {
'fileSystemId': 'string',
'rootDirectory': 'string',
'transitEncryption': 'ENABLED'|'DISABLED',
'transitEncryptionPort': 123,
'authorizationConfig': {
'accessPointId': 'string',
'iam': 'ENABLED'|'DISABLED'
}
},
's3filesVolumeConfiguration': {
'fileSystemArn': 'string',
'rootDirectory': 'string',
'transitEncryptionPort': 123,
'accessPointArn': 'string'
}
},
],
'enableExecuteCommand': True|False,
'networkMode': 'string'
},
]
},
'eksProperties': {
'podProperties': {
'serviceAccountName': 'string',
'hostNetwork': True|False,
'dnsPolicy': 'string',
'imagePullSecrets': [
{
'name': 'string'
},
],
'containers': [
{
'name': 'string',
'image': 'string',
'imagePullPolicy': 'string',
'command': [
'string',
],
'args': [
'string',
],
'env': [
{
'name': 'string',
'value': 'string'
},
],
'resources': {
'limits': {
'string': 'string'
},
'requests': {
'string': 'string'
}
},
'volumeMounts': [
{
'name': 'string',
'mountPath': 'string',
'subPath': 'string',
'readOnly': True|False
},
],
'securityContext': {
'runAsUser': 123,
'runAsGroup': 123,
'privileged': True|False,
'allowPrivilegeEscalation': True|False,
'readOnlyRootFilesystem': True|False,
'runAsNonRoot': True|False
}
},
],
'initContainers': [
{
'name': 'string',
'image': 'string',
'imagePullPolicy': 'string',
'command': [
'string',
],
'args': [
'string',
],
'env': [
{
'name': 'string',
'value': 'string'
},
],
'resources': {
'limits': {
'string': 'string'
},
'requests': {
'string': 'string'
}
},
'volumeMounts': [
{
'name': 'string',
'mountPath': 'string',
'subPath': 'string',
'readOnly': True|False
},
],
'securityContext': {
'runAsUser': 123,
'runAsGroup': 123,
'privileged': True|False,
'allowPrivilegeEscalation': True|False,
'readOnlyRootFilesystem': True|False,
'runAsNonRoot': True|False
}
},
],
'volumes': [
{
'name': 'string',
'hostPath': {
'path': 'string'
},
'emptyDir': {
'medium': 'string',
'sizeLimit': 'string'
},
'secret': {
'secretName': 'string',
'optional': True|False
},
'persistentVolumeClaim': {
'claimName': 'string',
'readOnly': True|False
}
},
],
'metadata': {
'labels': {
'string': 'string'
},
'annotations': {
'string': 'string'
},
'namespace': 'string'
},
'shareProcessNamespace': True|False
}
},
'consumableResourceProperties': {
'consumableResourceList': [
{
'consumableResource': 'string',
'quantity': 123
},
]
}
},
]
},
retryStrategy={
'attempts': 123,
'evaluateOnExit': [
{
'onStatusReason': 'string',
'onReason': 'string',
'onExitCode': 'string',
'action': 'RETRY'|'EXIT'
},
]
},
propagateTags=True|False,
timeout={
'attemptDurationSeconds': 123
},
tags={
'string': 'string'
},
platformCapabilities=[
'EC2'|'FARGATE'|'MANAGED_INSTANCES',
],
eksProperties={
'podProperties': {
'serviceAccountName': 'string',
'hostNetwork': True|False,
'dnsPolicy': 'string',
'imagePullSecrets': [
{
'name': 'string'
},
],
'containers': [
{
'name': 'string',
'image': 'string',
'imagePullPolicy': 'string',
'command': [
'string',
],
'args': [
'string',
],
'env': [
{
'name': 'string',
'value': 'string'
},
],
'resources': {
'limits': {
'string': 'string'
},
'requests': {
'string': 'string'
}
},
'volumeMounts': [
{
'name': 'string',
'mountPath': 'string',
'subPath': 'string',
'readOnly': True|False
},
],
'securityContext': {
'runAsUser': 123,
'runAsGroup': 123,
'privileged': True|False,
'allowPrivilegeEscalation': True|False,
'readOnlyRootFilesystem': True|False,
'runAsNonRoot': True|False
}
},
],
'initContainers': [
{
'name': 'string',
'image': 'string',
'imagePullPolicy': 'string',
'command': [
'string',
],
'args': [
'string',
],
'env': [
{
'name': 'string',
'value': 'string'
},
],
'resources': {
'limits': {
'string': 'string'
},
'requests': {
'string': 'string'
}
},
'volumeMounts': [
{
'name': 'string',
'mountPath': 'string',
'subPath': 'string',
'readOnly': True|False
},
],
'securityContext': {
'runAsUser': 123,
'runAsGroup': 123,
'privileged': True|False,
'allowPrivilegeEscalation': True|False,
'readOnlyRootFilesystem': True|False,
'runAsNonRoot': True|False
}
},
],
'volumes': [
{
'name': 'string',
'hostPath': {
'path': 'string'
},
'emptyDir': {
'medium': 'string',
'sizeLimit': 'string'
},
'secret': {
'secretName': 'string',
'optional': True|False
},
'persistentVolumeClaim': {
'claimName': 'string',
'readOnly': True|False
}
},
],
'metadata': {
'labels': {
'string': 'string'
},
'annotations': {
'string': 'string'
},
'namespace': 'string'
},
'shareProcessNamespace': True|False
}
},
ecsProperties={
'taskProperties': [
{
'containers': [
{
'command': [
'string',
],
'dependsOn': [
{
'containerName': 'string',
'condition': 'string'
},
],
'environment': [
{
'name': 'string',
'value': 'string'
},
],
'essential': True|False,
'firelensConfiguration': {
'type': 'fluentd'|'fluentbit',
'options': {
'string': 'string'
}
},
'image': 'string',
'linuxParameters': {
'devices': [
{
'hostPath': 'string',
'containerPath': 'string',
'permissions': [
'READ'|'WRITE'|'MKNOD',
]
},
],
'initProcessEnabled': True|False,
'sharedMemorySize': 123,
'tmpfs': [
{
'containerPath': 'string',
'size': 123,
'mountOptions': [
'string',
]
},
],
'maxSwap': 123,
'swappiness': 123
},
'logConfiguration': {
'logDriver': 'json-file'|'syslog'|'journald'|'gelf'|'fluentd'|'awslogs'|'splunk'|'awsfirelens',
'options': {
'string': 'string'
},
'secretOptions': [
{
'name': 'string',
'valueFrom': 'string'
},
]
},
'mountPoints': [
{
'containerPath': 'string',
'readOnly': True|False,
'sourceVolume': 'string'
},
],
'name': 'string',
'privileged': True|False,
'readonlyRootFilesystem': True|False,
'repositoryCredentials': {
'credentialsParameter': 'string'
},
'resourceRequirements': [
{
'value': 'string',
'type': 'GPU'|'VCPU'|'MEMORY'
},
],
'secrets': [
{
'name': 'string',
'valueFrom': 'string'
},
],
'ulimits': [
{
'hardLimit': 123,
'name': 'string',
'softLimit': 123
},
],
'user': 'string',
'startTimeout': 123,
'stopTimeout': 123
},
],
'ephemeralStorage': {
'sizeInGiB': 123
},
'executionRoleArn': 'string',
'platformVersion': 'string',
'ipcMode': 'string',
'taskRoleArn': 'string',
'pidMode': 'string',
'networkConfiguration': {
'assignPublicIp': 'ENABLED'|'DISABLED'
},
'runtimePlatform': {
'operatingSystemFamily': 'string',
'cpuArchitecture': 'string'
},
'volumes': [
{
'host': {
'sourcePath': 'string'
},
'name': 'string',
'efsVolumeConfiguration': {
'fileSystemId': 'string',
'rootDirectory': 'string',
'transitEncryption': 'ENABLED'|'DISABLED',
'transitEncryptionPort': 123,
'authorizationConfig': {
'accessPointId': 'string',
'iam': 'ENABLED'|'DISABLED'
}
},
's3filesVolumeConfiguration': {
'fileSystemArn': 'string',
'rootDirectory': 'string',
'transitEncryptionPort': 123,
'accessPointArn': 'string'
}
},
],
'enableExecuteCommand': True|False,
'networkMode': 'string'
},
]
},
consumableResourceProperties={
'consumableResourceList': [
{
'consumableResource': 'string',
'quantity': 123
},
]
}
)
**Parameters**
::
# This section is too large to render.
# Please see the AWS API Documentation linked below.
`AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/batch-2016-08-10/RegisterJobDefinition>`_
dict
Response Syntax
{
'jobDefinitionName': 'string',
'jobDefinitionArn': 'string',
'revision': 123
}
Response Structure
(dict) --
jobDefinitionName (string) --
The name of the job definition.
jobDefinitionArn (string) --
The Amazon Resource Name (ARN) of the job definition.
revision (integer) --
The revision of the job definition.
{'computeResources': {'capacityTags': {'string': 'string'},
'managedInstancesProvider': {'infrastructureOptimization': {'scaleInAfter': 'integer'},
'infrastructureRoleArn': 'string',
'instanceLaunchTemplate': {'capacityReservations': {'reservationGroupArn': 'string',
'reservationPreference': 'string'},
'ec2InstanceProfileArn': 'string',
'instanceMetadataTagsPropagation': 'boolean',
'instanceRequirements': {'allowedInstanceTypes': ['string']},
'localStorageConfiguration': {'useLocalStorage': 'boolean'},
'monitoring': 'string',
'networkConfiguration': {'securityGroups': ['string'],
'subnets': ['string']},
'storageConfiguration': {'storageSizeGiB': 'integer'}},
'propagateTags': 'string'},
'type': {'ECS_MANAGED_INSTANCES'}}}
Updates an Batch compute environment.
See also: AWS API Documentation
Request Syntax
client.update_compute_environment(
computeEnvironment='string',
state='ENABLED'|'DISABLED',
unmanagedvCpus=123,
computeResources={
'minvCpus': 123,
'maxvCpus': 123,
'desiredvCpus': 123,
'subnets': [
'string',
],
'securityGroupIds': [
'string',
],
'allocationStrategy': 'BEST_FIT_PROGRESSIVE'|'BEST_FIT_PROGRESSIVE_ORDERED'|'SPOT_CAPACITY_OPTIMIZED'|'SPOT_PRICE_CAPACITY_OPTIMIZED'|'SPOT_CAPACITY_OPTIMIZED_PRIORITIZED',
'instanceTypes': [
'string',
],
'ec2KeyPair': 'string',
'instanceRole': 'string',
'tags': {
'string': 'string'
},
'placementGroup': 'string',
'bidPercentage': 123,
'launchTemplate': {
'launchTemplateId': 'string',
'launchTemplateName': 'string',
'version': 'string',
'overrides': [
{
'launchTemplateId': 'string',
'launchTemplateName': 'string',
'version': 'string',
'targetInstanceTypes': [
'string',
],
'userdataType': 'EKS_BOOTSTRAP_SH'|'EKS_NODEADM'
},
],
'userdataType': 'EKS_BOOTSTRAP_SH'|'EKS_NODEADM'
},
'ec2Configuration': [
{
'imageType': 'string',
'imageIdOverride': 'string',
'batchImageStatus': 'string',
'imageKubernetesVersion': 'string'
},
],
'updateToLatestImageVersion': True|False,
'type': 'EC2'|'SPOT'|'FARGATE'|'FARGATE_SPOT'|'ECS_MANAGED_INSTANCES',
'imageId': 'string',
'scalingPolicy': {
'minScaleDownDelayMinutes': 123
},
'managedInstancesProvider': {
'propagateTags': 'string',
'infrastructureRoleArn': 'string',
'instanceLaunchTemplate': {
'ec2InstanceProfileArn': 'string',
'networkConfiguration': {
'subnets': [
'string',
],
'securityGroups': [
'string',
]
},
'instanceRequirements': {
'allowedInstanceTypes': [
'string',
]
},
'storageConfiguration': {
'storageSizeGiB': 123
},
'monitoring': 'string',
'capacityReservations': {
'reservationGroupArn': 'string',
'reservationPreference': 'string'
},
'instanceMetadataTagsPropagation': True|False,
'localStorageConfiguration': {
'useLocalStorage': True|False
}
},
'infrastructureOptimization': {
'scaleInAfter': 123
}
},
'capacityTags': {
'string': 'string'
}
},
serviceRole='string',
updatePolicy={
'terminateJobsOnUpdate': True|False,
'jobExecutionTimeoutMinutes': 123
},
context='string',
ecsSettings={
'containerInsights': 'ENABLED'|'ENHANCED'|'DISABLED'
}
)
string
[REQUIRED]
The name or full Amazon Resource Name (ARN) of the compute environment to update.
string
The state of the compute environment. Compute environments in the ENABLED state can accept jobs from a queue and scale in or out automatically based on the workload demand of its associated queues.
If the state is ENABLED, then the Batch scheduler can attempt to place jobs from an associated job queue on the compute resources within the environment. If the compute environment is managed, then it can scale its instances out or in automatically, based on the job queue demand.
If the state is DISABLED, then the Batch scheduler doesn't attempt to place jobs within the environment. Jobs in a STARTING or RUNNING state continue to progress normally. Managed compute environments in the DISABLED state don't scale out.
When an instance is idle, the instance scales down to the minvCpus value. However, the instance size doesn't change. For example, consider a c5.8xlarge instance with a minvCpus value of 4 and a desiredvCpus value of 36. This instance doesn't scale down to a c5.large instance.
integer
The maximum number of vCPUs expected to be used for an unmanaged compute environment. Don't specify this parameter for a managed compute environment. This parameter is only used for fair-share scheduling to reserve vCPU capacity for new share identifiers. If this parameter isn't provided for a fair-share job queue, no vCPU capacity is reserved.
dict
Details of the compute resources managed by the compute environment. Required for a managed compute environment. For more information, see Compute Environments in the Batch User Guide.
minvCpus (integer) --
The minimum number of vCPUs that an environment should maintain (even if the compute environment is DISABLED).
maxvCpus (integer) --
The maximum number of Amazon EC2 vCPUs that an environment can reach.
desiredvCpus (integer) --
The desired number of vCPUS in the compute environment. Batch modifies this value between the minimum and maximum values based on job queue demand.
subnets (list) --
The VPC subnets where the compute resources are launched. Fargate compute resources can contain up to 16 subnets. For Fargate compute resources, providing an empty list will be handled as if this parameter wasn't specified and no change is made. For Amazon EC2 compute resources, providing an empty list removes the VPC subnets from the compute resource. For more information, see VPCs and subnets in the Amazon VPC User Guide.
When updating a compute environment, changing the VPC subnets requires an infrastructure update of the compute environment. For more information, see Updating compute environments in the Batch User Guide.
(string) --
securityGroupIds (list) --
The Amazon EC2 security groups that are associated with instances launched in the compute environment. This parameter is required for Fargate compute resources, where it can contain up to 5 security groups. For Fargate compute resources, providing an empty list is handled as if this parameter wasn't specified and no change is made. For Amazon EC2 compute resources, providing an empty list removes the security groups from the compute resource.
When updating a compute environment, changing the Amazon EC2 security groups requires an infrastructure update of the compute environment. For more information, see Updating compute environments in the Batch User Guide.
(string) --
allocationStrategy (string) --
The allocation strategy to use for the compute resource if there's not enough instances of the best fitting instance type that can be allocated. This might be because of availability of the instance type in the Region or Amazon EC2 service limits. For more information, see Allocation strategies in the Batch User Guide.
When updating a compute environment, changing the allocation strategy requires an infrastructure update of the compute environment. For more information, see Updating compute environments in the Batch User Guide. BEST_FIT isn't supported when updating a compute environment.
Batch selects additional instance types that are large enough to meet the requirements of the jobs in the queue. Its preference is for instance types with lower cost vCPUs. If additional instances of the previously selected instance types aren't available, Batch selects new instance types.
BEST_FIT_PROGRESSIVE_ORDERED
Batch selects instance types in the order they appear in the instanceTypes list. When an instance family is specified, sizes within that family are expanded using BEST_FIT_PROGRESSIVE logic—preferring sizes that best fit the jobs, with larger sizes as fallback. Instance types that cannot meet the resource requirements of the jobs are skipped. This strategy is only available for On-Demand Instance ( EC2) compute resources.
If an instance family and an explicit instance type from that family both appear in instanceTypes, the explicit type takes its listed position and is excluded from the family expansion. For example, in ["m7a.4xlarge", "m7a", "m6a"], m7a.4xlarge is always placed first and is excluded from the m7a family expansion.
SPOT_CAPACITY_OPTIMIZED
Batch selects one or more instance types that are large enough to meet the requirements of the jobs in the queue. Its preference is for instance types that are less likely to be interrupted. This allocation strategy is only available for Spot Instance compute resources.
SPOT_PRICE_CAPACITY_OPTIMIZED
The price and capacity optimized allocation strategy looks at both price and capacity to select the Spot Instance pools that are the least likely to be interrupted and have the lowest possible price. This allocation strategy is only available for Spot Instance compute resources.
SPOT_CAPACITY_OPTIMIZED_PRIORITIZED
Batch selects instance types in the order they appear in the instanceTypes list, but optimizes for capacity first. The customer-defined priority is honored on a best-effort basis. When Spot Instance capacity pools are similarly available, priority order is respected. When capacity is constrained, Batch selects from the most available pools regardless of priority to minimize the likelihood of Spot Instance interruptions. This strategy is only available for Spot Instance compute resources.
With any allocation strategy except BEST_FIT using On-Demand ( EC2) compute resources, Batch might need to exceed maxvCpus to meet your capacity requirements. In this event, Batch never exceeds maxvCpus by more than a single instance.
instanceTypes (list) --
The instances types that can be launched. You can specify instance families to launch any instance type within those families (for example, c5 or p3), or you can specify specific sizes within a family (such as c5.8xlarge).
Batch can select the instance type for you if you choose one of the following:
optimal to select instance types (from the c4, m4, r4, c5, m5, and r5 instance families) that match the demand of your job queues.
default_x86_64 to choose x86 based instance types (from the m6i, c6i, r6i, and c7i instance families) that matches the resource demands of the job queue.
default_arm64 to choose x86 based instance types (from the m6g, c6g, r6g, and c7g instance families) that matches the resource demands of the job queue.
(string) --
ec2KeyPair (string) --
The Amazon EC2 key pair that's used for instances launched in the compute environment. You can use this key pair to log in to your instances with SSH. To remove the Amazon EC2 key pair, set this value to an empty string.
When updating a compute environment, changing the Amazon EC2 key pair requires an infrastructure update of the compute environment. For more information, see Updating compute environments in the Batch User Guide.
instanceRole (string) --
The Amazon ECS instance profile applied to Amazon EC2 instances in a compute environment. Required for Amazon EC2 instances. You can specify the short name or full Amazon Resource Name (ARN) of an instance profile. For example, ecsInstanceRole or ``arn:aws:iam::<aws_account_id>:instance-profile/ecsInstanceRole ``. For more information, see Amazon ECS instance role in the Batch User Guide.
When updating a compute environment, changing this setting requires an infrastructure update of the compute environment. For more information, see Updating compute environments in the Batch User Guide.
tags (dict) --
Key-value pair tags to be applied to Amazon EC2 resources that are launched in the compute environment. For Batch, these take the form of "String1": "String2", where String1 is the tag key and String2 is the tag value (for example, { "Name": "Batch Instance - C4OnDemand" }). This is helpful for recognizing your Batch instances in the Amazon EC2 console. These tags aren't seen when using the Batch ListTagsForResource API operation.
When updating a compute environment, changing this setting requires an infrastructure update of the compute environment. For more information, see Updating compute environments in the Batch User Guide.
(string) --
(string) --
placementGroup (string) --
The Amazon EC2 placement group to associate with your compute resources. If you intend to submit multi-node parallel jobs to your compute environment, you should consider creating a cluster placement group and associate it with your compute resources. This keeps your multi-node parallel job on a logical grouping of instances within a single Availability Zone with high network flow potential. For more information, see Placement groups in the Amazon EC2 User Guide for Linux Instances.
When updating a compute environment, changing the placement group requires an infrastructure update of the compute environment. For more information, see Updating compute environments in the Batch User Guide.
bidPercentage (integer) --
The maximum percentage that a Spot Instance price can be when compared with the On-Demand price for that instance type before instances are launched. For example, if your maximum percentage is 20%, the Spot price must be less than 20% of the current On-Demand price for that Amazon EC2 instance. You always pay the lowest (market) price and never more than your maximum percentage. For most use cases, we recommend leaving this field empty.
When updating a compute environment, changing the bid percentage requires an infrastructure update of the compute environment. For more information, see Updating compute environments in the Batch User Guide.
launchTemplate (dict) --
The updated launch template to use for your compute resources. You must specify either the launch template ID or launch template name in the request, but not both. For more information, see Launch template support in the Batch User Guide. To remove the custom launch template and use the default launch template, set launchTemplateId or launchTemplateName member of the launch template specification to an empty string. Removing the launch template from a compute environment will not remove the AMI specified in the launch template. In order to update the AMI specified in a launch template, the updateToLatestImageVersion parameter must be set to true.
When updating a compute environment, changing the launch template requires an infrastructure update of the compute environment. For more information, see Updating compute environments in the Batch User Guide.
launchTemplateId (string) --
The ID of the launch template.
launchTemplateName (string) --
The name of the launch template.
version (string) --
The version number of the launch template, $Default, or $Latest.
If the value is $Default, the default version of the launch template is used. If the value is $Latest, the latest version of the launch template is used.
Default: $Default
Latest: $Latest
overrides (list) --
A launch template to use in place of the default launch template. You must specify either the launch template ID or launch template name in the request, but not both.
You can specify up to ten (10) launch template overrides that are associated to unique instance types or families for each compute environment.
(dict) --
An object that represents a launch template to use in place of the default launch template. You must specify either the launch template ID or launch template name in the request, but not both.
If security groups are specified using both the securityGroupIds parameter of CreateComputeEnvironment and the launch template, the values in the securityGroupIds parameter of CreateComputeEnvironment will be used.
You can define up to ten (10) overrides for each compute environment.
launchTemplateId (string) --
The ID of the launch template.
Note: If you specify the launchTemplateId you can't specify the launchTemplateName as well.
launchTemplateName (string) --
The name of the launch template.
Note: If you specify the launchTemplateName you can't specify the launchTemplateId as well.
version (string) --
The version number of the launch template, $Default, or $Latest.
If the value is $Default, the default version of the launch template is used. If the value is $Latest, the latest version of the launch template is used.
Default: $Default
Latest: $Latest
targetInstanceTypes (list) --
The instance type or family that this override launch template should be applied to.
This parameter is required when defining a launch template override.
Information included in this parameter must meet the following requirements:
Must be a valid Amazon EC2 instance type or family.
The following Batch InstanceTypes are not allowed: optimal, default_x86_64, and default_arm64.
targetInstanceTypes can target only instance types and families that are included within the ComputeResource.instanceTypes set. targetInstanceTypes doesn't need to include all of the instances from the instanceType set, but at least a subset. For example, if ComputeResource.instanceTypes includes [m5, g5], targetInstanceTypes can include [m5.2xlarge] and [m5.large] but not [c5.large].
targetInstanceTypes included within the same launch template override or across launch template overrides can't overlap for the same compute environment. For example, you can't define one launch template override to target an instance family and another define an instance type within this same family.
(string) --
userdataType (string) --
The EKS node initialization process to use. You only need to specify this value if you are using a custom AMI. The default value is EKS_BOOTSTRAP_SH. If imageType is a custom AMI based on EKS_AL2023 or EKS_AL2023_NVIDIA then you must choose EKS_NODEADM.
userdataType (string) --
The EKS node initialization process to use. You only need to specify this value if you are using a custom AMI. The default value is EKS_BOOTSTRAP_SH. If imageType is a custom AMI based on EKS_AL2023 or EKS_AL2023_NVIDIA then you must choose EKS_NODEADM.
ec2Configuration (list) --
Provides information used to select Amazon Machine Images (AMIs) for Amazon EC2 instances in the compute environment. If Ec2Configuration isn't specified, the default is ECS_AL2023 for EC2 (ECS) compute environments and EKS_AL2023 for EKS compute environments.
When updating a compute environment, changing this setting requires an infrastructure update of the compute environment. For more information, see Updating compute environments in the Batch User Guide. To remove the Amazon EC2 configuration and any custom AMI ID specified in imageIdOverride, set this value to an empty string.
One or two values can be provided.
(dict) --
Provides information used to select Amazon Machine Images (AMIs) for instances in the compute environment. If Ec2Configuration isn't specified, the default is ECS_AL2023 ( Amazon ECS-optimized Amazon Linux 2023) for EC2 (ECS) compute environments and EKS_AL2023 ( Amazon EKS-optimized Amazon Linux 2023 AMI) for EKS compute environments.
imageType (string) -- [REQUIRED]
The image type to match with the instance type to select an AMI. The supported values are different for ECS and EKS resources.
ECS
If the imageIdOverride parameter isn't specified, then a recent Amazon ECS-optimized Amazon Linux 2023 AMI ( ECS_AL2023) is used. If a new image type is specified in an update, but neither an imageId nor a imageIdOverride parameter is specified, then the latest Amazon ECS optimized AMI for that image type that's supported by Batch is used.
Amazon Linux 2: Used for non-GPU instance families.
ECS_AL2_NVIDIA
Amazon Linux 2 (GPU): Used for GPU instance families (for example P4 and G4) and non Amazon Web Services Graviton-based instance types.
ECS_AL2023
Amazon Linux 2023: Default for all non-GPU instance families.
Amazon Linux 2023 (GPU): Default for all GPU instance families and can be used for all non Amazon Web Services Graviton-based instance types.
If the imageIdOverride parameter isn't specified, then a recent Amazon EKS-optimized Amazon Linux 2023 AMI ( EKS_AL2023) is used. If a new image type is specified in an update, but neither an imageId nor a imageIdOverride parameter is specified, then the latest Amazon EKS optimized AMI for that image type that Batch supports is used.
Amazon Linux 2: Used for non-GPU instance families.
EKS_AL2_NVIDIA
Amazon Linux 2 (accelerated): Used for GPU instance families (for example, P4 and G4) and can be used for all non Amazon Web Services Graviton-based instance types.
EKS_AL2023
Amazon Linux 2023: Default for non-GPU instance families.
Amazon Linux 2023 (accelerated): Default for GPU instance families and can be used for all non Amazon Web Services Graviton-based instance types.
imageIdOverride (string) --
The AMI ID used for instances launched in the compute environment that match the image type. This setting overrides the imageId set in the computeResource object.
batchImageStatus (string) --
The status of the Batch-provided default AMIs associated with the imageType.
The field only appears after the compute environment has begun scaling instances using the imageType. The field is not present when an image is specified in ComputeResources.imageId (deprecated), the default launch template, or Ec2Configuration.imageIdOverride. The field is also not present when the compute environment has a launch template override. For more information on image selection, see AMI selection order.
LATEST − Using the most recent AMI supported
UPDATE_AVAILABLE − An updated AMI is available
If a compute environment has multiple AMIs for the imageType and any one AMI has UPDATE_AVAILABLE, the status shows UPDATE_AVAILABLE.
For compute environments that use BEST_FIT as their allocation strategy, you can perform a blue/green update to update the AMI.
For all other compute environments, you can perform an AMI version update to update the AMI to the latest version.
imageKubernetesVersion (string) --
The Kubernetes version for the compute environment. If you don't specify a value, the latest version that Batch supports is used.
updateToLatestImageVersion (boolean) --
Specifies whether the AMI ID is updated to the latest one that's supported by Batch when the compute environment has an infrastructure update. The default value is false.
When updating a compute environment, changing this setting requires an infrastructure update of the compute environment. For more information, see Updating compute environments in the Batch User Guide.
type (string) --
The type of compute environment: EC2, SPOT, FARGATE, FARGATE_SPOT, or ECS_MANAGED_INSTANCES. For more information, see Compute environments in the Batch User Guide.
If you choose SPOT, you must also specify an Amazon EC2 Spot Fleet role with the spotIamFleetRole parameter. For more information, see Amazon EC2 spot fleet role in the Batch User Guide.
When updating a compute environment, changing the type of a compute environment requires an infrastructure update of the compute environment. For more information, see Updating compute environments in the Batch User Guide.
You cannot change the type to or from ECS_MANAGED_INSTANCES.
imageId (string) --
The Amazon Machine Image (AMI) ID used for instances launched in the compute environment. This parameter is overridden by the imageIdOverride member of the Ec2Configuration structure. To remove the custom AMI ID and use the default AMI ID, set this value to an empty string.
When updating a compute environment, changing the AMI ID requires an infrastructure update of the compute environment. For more information, see Updating compute environments in the Batch User Guide.
scalingPolicy (dict) --
The scaling policy configuration for the compute environment.
minScaleDownDelayMinutes (integer) --
The minimum time (in minutes) that Batch keeps instances running in the compute environment after their jobs complete. For each instance, the delay period begins when the last job finishes. If no new jobs are placed on the instance during this delay, Batch terminates the instance once the delay expires.
Valid Range: Minimum value of 20. Maximum value of 10080. Use 0 to unset and disable the scale down delay.
managedInstancesProvider (dict) --
The updated configuration for the Amazon ECS Managed Instances capacity provider. This parameter is only valid when the compute environment type is ECS_MANAGED_INSTANCES. You cannot change capacityOptionType or fipsEnabled on update.
propagateTags (string) --
Specifies whether tags on the capacity provider are propagated to the Amazon EC2 instances it launches. Valid values:
CAPACITY_PROVIDER — Propagates tags to instances.
NONE — Does not propagate tags to instances.
infrastructureRoleArn (string) --
The updated Amazon Resource Name (ARN) of the IAM role that Amazon ECS assumes to manage Amazon EC2 instances on your behalf.
instanceLaunchTemplate (dict) --
The updated instance launch configuration for the Amazon ECS Managed Instances capacity provider.
ec2InstanceProfileArn (string) --
The updated Amazon Resource Name (ARN) of the Amazon EC2 instance profile for the managed instances.
networkConfiguration (dict) --
The updated network configuration for the managed instances.
subnets (list) -- [REQUIRED]
The VPC subnets where managed instances are launched. If your subnets don't provide public IP addresses, they must have a NAT gateway for outbound internet access.
(string) --
securityGroups (list) -- [REQUIRED]
The VPC security groups to associate with the managed instances.
(string) --
instanceRequirements (dict) --
The updated instance type requirements for the capacity provider.
allowedInstanceTypes (list) --
A list of specific instance types or instance families that Amazon ECS can launch (for example, m5.large or g5). When specified, only these instance types are used.
(string) --
storageConfiguration (dict) --
The updated storage configuration for the managed instances.
storageSizeGiB (integer) --
The size of the root EBS volume in GiB for the managed instances.
monitoring (string) --
The updated monitoring level. Valid values are BASIC and DETAILED.
capacityReservations (dict) --
The updated capacity reservation configuration.
reservationGroupArn (string) --
The Amazon Resource Name (ARN) of the capacity reservation group to target.
reservationPreference (string) --
The capacity reservation preference. Valid values:
RESERVATIONS_ONLY — Use only capacity reservations.
RESERVATIONS_FIRST — Prefer capacity reservations but fall back to On-Demand if unavailable.
RESERVATIONS_EXCLUDED — Do not use capacity reservations.
instanceMetadataTagsPropagation (boolean) --
Specifies whether instance tags are accessible from the instance metadata service (IMDS).
localStorageConfiguration (dict) --
The updated local storage configuration.
useLocalStorage (boolean) --
Specifies whether instance store volumes (local NVMe SSDs) are available to containers. When enabled, containers can use the instance store for high-performance temporary storage.
infrastructureOptimization (dict) --
The updated infrastructure optimization configuration.
scaleInAfter (integer) --
The number of seconds an instance can remain idle before it is terminated. Valid values are -1 or 0 to 3600. Use -1 as a special value to disable scale-in (instances are never terminated for being idle). If not specified, a default value applies.
capacityTags (dict) --
The updated tags to apply to the Amazon ECS capacity provider and Amazon EC2 instances. This parameter is only valid for ECS_MANAGED_INSTANCES compute environments. You must have the batch:SetCapacityTags permission on the compute environment resource to use this parameter.
(string) --
(string) --
string
The full Amazon Resource Name (ARN) of the IAM role that allows Batch to make calls to other Amazon Web Services services on your behalf. For more information, see Batch service IAM role in the Batch User Guide.
If your specified role has a path other than /, then you must either specify the full role ARN (recommended) or prefix the role name with the path.
dict
Specifies the updated infrastructure update policy for the compute environment. For more information about infrastructure updates, see Updating compute environments in the Batch User Guide.
terminateJobsOnUpdate (boolean) --
Specifies whether jobs are automatically terminated when the compute environment infrastructure is updated. The default value is false.
jobExecutionTimeoutMinutes (integer) --
Specifies the job timeout (in minutes) when the compute environment infrastructure is updated. The default value is 30. The maximum value is 7200.
string
Reserved.
dict
The Amazon ECS settings for the compute environment. These settings control CloudWatch Container Insights collection for the compute environment.
containerInsights (string) --
Specifies the CloudWatch Container Insights mode for the compute environment. Valid values are:
ENABLED
Turns on standard Container Insights, which collects CPU, memory, disk, and network utilization metrics for the compute environment.
ENHANCED
Turns on enhanced Container Insights, which collects the standard metrics along with additional per-task observability metrics.
DISABLED
Turns off Container Insights for the compute environment.
If you don't specify a value, the default is DISABLED. For more information, see Container Insights in the Batch User Guide.
dict
Response Syntax
{
'computeEnvironmentName': 'string',
'computeEnvironmentArn': 'string'
}
Response Structure
(dict) --
computeEnvironmentName (string) --
The name of the compute environment. It can be up to 128 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).
computeEnvironmentArn (string) --
The Amazon Resource Name (ARN) of the compute environment.