batch

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-aws repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-aws repo.

class pulumi_aws.batch.AwaitableGetComputeEnvironmentResult(arn=None, compute_environment_name=None, ecs_cluster_arn=None, service_role=None, state=None, status=None, status_reason=None, type=None, id=None)
class pulumi_aws.batch.AwaitableGetJobQueueResult(arn=None, compute_environment_orders=None, name=None, priority=None, state=None, status=None, status_reason=None, id=None)
class pulumi_aws.batch.ComputeEnvironment(resource_name, opts=None, compute_environment_name=None, compute_resources=None, service_role=None, state=None, type=None, __props__=None, __name__=None, __opts__=None)

Creates a AWS Batch compute environment. Compute environments contain the Amazon ECS container instances that are used to run containerized batch jobs.

For information about AWS Batch, see [What is AWS Batch?][1] . For information about compute environment, see [Compute Environments][2] .

Note: To prevent a race condition during environment deletion, make sure to set depends_on to the related iam.RolePolicyAttachment;

otherwise, the policy may be destroyed too soon and the compute environment will then get stuck in the DELETING state, see [Troubleshooting AWS Batch][3] .

Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • compute_environment_name (pulumi.Input[str]) – The name for your compute environment. Up to 128 letters (uppercase and lowercase), numbers, and underscores are allowed.

  • compute_resources (pulumi.Input[dict]) – Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.

  • service_role (pulumi.Input[str]) – The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.

  • state (pulumi.Input[str]) – The state of the compute environment. If the state is ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues. Valid items are ENABLED or DISABLED. Defaults to ENABLED.

  • type (pulumi.Input[str]) – The type of compute environment. Valid items are EC2 or SPOT.

The compute_resources object supports the following:

  • bidPercentage (pulumi.Input[float]) - Integer of minimum percentage that a Spot Instance price must be when compared with the On-Demand price for that instance type before instances are launched. For example, if your bid percentage is 20% (20), then the Spot price must be below 20% of the current On-Demand price for that EC2 instance. This parameter is required for SPOT compute environments.

  • desiredVcpus (pulumi.Input[float]) - The desired number of EC2 vCPUS in the compute environment.

  • ec2KeyPair (pulumi.Input[str]) - The EC2 key pair that is used for instances launched in the compute environment.

  • imageId (pulumi.Input[str]) - The Amazon Machine Image (AMI) ID used for instances launched in the compute environment.

  • instanceRole (pulumi.Input[str]) - The Amazon ECS instance role applied to Amazon EC2 instances in a compute environment.

  • instanceTypes (pulumi.Input[list]) - A list of instance types that may be launched.

  • launch_template (pulumi.Input[dict]) - The launch template to use for your compute resources. See details below.

    • launchTemplateId (pulumi.Input[str]) - ID of the launch template. You must specify either the launch template ID or launch template name in the request, but not both.

    • launchTemplateName (pulumi.Input[str]) - Name of the launch template.

    • version (pulumi.Input[str]) - The version number of the launch template. Default: The default version of the launch template.

  • maxVcpus (pulumi.Input[float]) - The maximum number of EC2 vCPUs that an environment can reach.

  • minVcpus (pulumi.Input[float]) - The minimum number of EC2 vCPUs that an environment should maintain.

  • securityGroupIds (pulumi.Input[list]) - A list of EC2 security group that are associated with instances launched in the compute environment.

  • spotIamFleetRole (pulumi.Input[str]) - The Amazon Resource Name (ARN) of the Amazon EC2 Spot Fleet IAM role applied to a SPOT compute environment. This parameter is required for SPOT compute environments.

  • subnets (pulumi.Input[list]) - A list of VPC subnets into which the compute resources are launched.

  • tags (pulumi.Input[dict]) - Key-value pair tags to be applied to resources that are launched in the compute environment.

  • type (pulumi.Input[str]) - The type of compute environment. Valid items are EC2 or SPOT.

arn = None

The Amazon Resource Name (ARN) of the compute environment.

compute_environment_name = None

The name for your compute environment. Up to 128 letters (uppercase and lowercase), numbers, and underscores are allowed.

compute_resources = None

Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.

  • bidPercentage (float) - Integer of minimum percentage that a Spot Instance price must be when compared with the On-Demand price for that instance type before instances are launched. For example, if your bid percentage is 20% (20), then the Spot price must be below 20% of the current On-Demand price for that EC2 instance. This parameter is required for SPOT compute environments.

  • desiredVcpus (float) - The desired number of EC2 vCPUS in the compute environment.

  • ec2KeyPair (str) - The EC2 key pair that is used for instances launched in the compute environment.

  • imageId (str) - The Amazon Machine Image (AMI) ID used for instances launched in the compute environment.

  • instanceRole (str) - The Amazon ECS instance role applied to Amazon EC2 instances in a compute environment.

  • instanceTypes (list) - A list of instance types that may be launched.

  • launch_template (dict) - The launch template to use for your compute resources. See details below.

    • launchTemplateId (str) - ID of the launch template. You must specify either the launch template ID or launch template name in the request, but not both.

    • launchTemplateName (str) - Name of the launch template.

    • version (str) - The version number of the launch template. Default: The default version of the launch template.

  • maxVcpus (float) - The maximum number of EC2 vCPUs that an environment can reach.

  • minVcpus (float) - The minimum number of EC2 vCPUs that an environment should maintain.

  • securityGroupIds (list) - A list of EC2 security group that are associated with instances launched in the compute environment.

  • spotIamFleetRole (str) - The Amazon Resource Name (ARN) of the Amazon EC2 Spot Fleet IAM role applied to a SPOT compute environment. This parameter is required for SPOT compute environments.

  • subnets (list) - A list of VPC subnets into which the compute resources are launched.

  • tags (dict) - Key-value pair tags to be applied to resources that are launched in the compute environment.

  • type (str) - The type of compute environment. Valid items are EC2 or SPOT.

ecs_cluster_arn = None

The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.

service_role = None

The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.

state = None

The state of the compute environment. If the state is ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues. Valid items are ENABLED or DISABLED. Defaults to ENABLED.

status = None

The current status of the compute environment (for example, CREATING or VALID).

status_reason = None

A short, human-readable string to provide additional details about the current status of the compute environment.

type = None

The type of compute environment. Valid items are EC2 or SPOT.

static get(resource_name, id, opts=None, arn=None, compute_environment_name=None, compute_resources=None, ecs_cluster_arn=None, service_role=None, state=None, status=None, status_reason=None, type=None)

Get an existing ComputeEnvironment resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • arn (pulumi.Input[str]) – The Amazon Resource Name (ARN) of the compute environment.

  • compute_environment_name (pulumi.Input[str]) – The name for your compute environment. Up to 128 letters (uppercase and lowercase), numbers, and underscores are allowed.

  • compute_resources (pulumi.Input[dict]) – Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.

  • ecs_cluster_arn (pulumi.Input[str]) – The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.

  • service_role (pulumi.Input[str]) – The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.

  • state (pulumi.Input[str]) – The state of the compute environment. If the state is ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues. Valid items are ENABLED or DISABLED. Defaults to ENABLED.

  • status (pulumi.Input[str]) – The current status of the compute environment (for example, CREATING or VALID).

  • status_reason (pulumi.Input[str]) – A short, human-readable string to provide additional details about the current status of the compute environment.

  • type (pulumi.Input[str]) – The type of compute environment. Valid items are EC2 or SPOT.

The compute_resources object supports the following:

  • bidPercentage (pulumi.Input[float]) - Integer of minimum percentage that a Spot Instance price must be when compared with the On-Demand price for that instance type before instances are launched. For example, if your bid percentage is 20% (20), then the Spot price must be below 20% of the current On-Demand price for that EC2 instance. This parameter is required for SPOT compute environments.

  • desiredVcpus (pulumi.Input[float]) - The desired number of EC2 vCPUS in the compute environment.

  • ec2KeyPair (pulumi.Input[str]) - The EC2 key pair that is used for instances launched in the compute environment.

  • imageId (pulumi.Input[str]) - The Amazon Machine Image (AMI) ID used for instances launched in the compute environment.

  • instanceRole (pulumi.Input[str]) - The Amazon ECS instance role applied to Amazon EC2 instances in a compute environment.

  • instanceTypes (pulumi.Input[list]) - A list of instance types that may be launched.

  • launch_template (pulumi.Input[dict]) - The launch template to use for your compute resources. See details below.

    • launchTemplateId (pulumi.Input[str]) - ID of the launch template. You must specify either the launch template ID or launch template name in the request, but not both.

    • launchTemplateName (pulumi.Input[str]) - Name of the launch template.

    • version (pulumi.Input[str]) - The version number of the launch template. Default: The default version of the launch template.

  • maxVcpus (pulumi.Input[float]) - The maximum number of EC2 vCPUs that an environment can reach.

  • minVcpus (pulumi.Input[float]) - The minimum number of EC2 vCPUs that an environment should maintain.

  • securityGroupIds (pulumi.Input[list]) - A list of EC2 security group that are associated with instances launched in the compute environment.

  • spotIamFleetRole (pulumi.Input[str]) - The Amazon Resource Name (ARN) of the Amazon EC2 Spot Fleet IAM role applied to a SPOT compute environment. This parameter is required for SPOT compute environments.

  • subnets (pulumi.Input[list]) - A list of VPC subnets into which the compute resources are launched.

  • tags (pulumi.Input[dict]) - Key-value pair tags to be applied to resources that are launched in the compute environment.

  • type (pulumi.Input[str]) - The type of compute environment. Valid items are EC2 or SPOT.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_aws.batch.GetComputeEnvironmentResult(arn=None, compute_environment_name=None, ecs_cluster_arn=None, service_role=None, state=None, status=None, status_reason=None, type=None, id=None)

A collection of values returned by getComputeEnvironment.

arn = None

The ARN of the compute environment.

ecs_cluster_arn = None

The ARN of the underlying Amazon ECS cluster used by the compute environment.

service_role = None

The ARN of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.

state = None

The state of the compute environment (for example, ENABLED or DISABLED). If the state is ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues.

status = None

The current status of the compute environment (for example, CREATING or VALID).

status_reason = None

A short, human-readable string to provide additional details about the current status of the compute environment.

type = None

The type of the compute environment (for example, MANAGED or UNMANAGED).

id = None

id is the provider-assigned unique ID for this managed resource.

class pulumi_aws.batch.GetJobQueueResult(arn=None, compute_environment_orders=None, name=None, priority=None, state=None, status=None, status_reason=None, id=None)

A collection of values returned by getJobQueue.

arn = None

The ARN of the job queue.

compute_environment_orders = None

The compute environments that are attached to the job queue and the order in which job placement is preferred. Compute environments are selected for job placement in ascending order.

  • compute_environment_order.#.order - The order of the compute environment.

  • compute_environment_order.#.compute_environment - The ARN of the compute environment.

priority = None

The priority of the job queue. Job queues with a higher priority are evaluated first when associated with the same compute environment.

state = None

Describes the ability of the queue to accept new jobs (for example, ENABLED or DISABLED).

status = None

The current status of the job queue (for example, CREATING or VALID).

status_reason = None

A short, human-readable string to provide additional details about the current status of the job queue.

id = None

id is the provider-assigned unique ID for this managed resource.

class pulumi_aws.batch.JobDefinition(resource_name, opts=None, container_properties=None, name=None, parameters=None, retry_strategy=None, timeout=None, type=None, __props__=None, __name__=None, __opts__=None)

Provides a Batch Job Definition resource.

retry_strategy supports the following:

  • attempts - (Optional) The number of times to move a job to the RUNNABLE status. You may specify between 1 and 10 attempts.

timeout supports the following:

  • attempt_duration_seconds - (Optional) The time duration in seconds after which AWS Batch terminates your jobs if they have not finished. The minimum value for the timeout is 60 seconds.

Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • container_properties (pulumi.Input[str]) – A valid container properties provided as a single valid JSON document. This parameter is required if the type parameter is container.

  • name (pulumi.Input[str]) – Specifies the name of the job definition.

  • parameters (pulumi.Input[dict]) – Specifies the parameter substitution placeholders to set in the job definition.

  • retry_strategy (pulumi.Input[dict]) – Specifies the retry strategy to use for failed jobs that are submitted with this job definition. Maximum number of retry_strategy is 1. Defined below.

  • timeout (pulumi.Input[dict]) – Specifies the timeout for jobs so that if a job runs longer, AWS Batch terminates the job. Maximum number of timeout is 1. Defined below.

  • type (pulumi.Input[str]) – The type of job definition. Must be container

The retry_strategy object supports the following:

  • attempts (pulumi.Input[float])

The timeout object supports the following:

  • attemptDurationSeconds (pulumi.Input[float])

arn = None

The Amazon Resource Name of the job definition.

container_properties = None

A valid container properties provided as a single valid JSON document. This parameter is required if the type parameter is container.

name = None

Specifies the name of the job definition.

parameters = None

Specifies the parameter substitution placeholders to set in the job definition.

retry_strategy = None

Specifies the retry strategy to use for failed jobs that are submitted with this job definition. Maximum number of retry_strategy is 1. Defined below.

  • attempts (float)

revision = None

The revision of the job definition.

timeout = None

Specifies the timeout for jobs so that if a job runs longer, AWS Batch terminates the job. Maximum number of timeout is 1. Defined below.

  • attemptDurationSeconds (float)

type = None

The type of job definition. Must be container

static get(resource_name, id, opts=None, arn=None, container_properties=None, name=None, parameters=None, retry_strategy=None, revision=None, timeout=None, type=None)

Get an existing JobDefinition resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • arn (pulumi.Input[str]) – The Amazon Resource Name of the job definition.

  • container_properties (pulumi.Input[str]) –

    A valid container properties provided as a single valid JSON document. This parameter is required if the type parameter is container.

  • name (pulumi.Input[str]) – Specifies the name of the job definition.

  • parameters (pulumi.Input[dict]) – Specifies the parameter substitution placeholders to set in the job definition.

  • retry_strategy (pulumi.Input[dict]) – Specifies the retry strategy to use for failed jobs that are submitted with this job definition. Maximum number of retry_strategy is 1. Defined below.

  • revision (pulumi.Input[float]) – The revision of the job definition.

  • timeout (pulumi.Input[dict]) – Specifies the timeout for jobs so that if a job runs longer, AWS Batch terminates the job. Maximum number of timeout is 1. Defined below.

  • type (pulumi.Input[str]) – The type of job definition. Must be container

The retry_strategy object supports the following:

  • attempts (pulumi.Input[float])

The timeout object supports the following:

  • attemptDurationSeconds (pulumi.Input[float])

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_aws.batch.JobQueue(resource_name, opts=None, compute_environments=None, name=None, priority=None, state=None, __props__=None, __name__=None, __opts__=None)

Provides a Batch Job Queue resource.

Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • compute_environments (pulumi.Input[list]) – Specifies the set of compute environments mapped to a job queue and their order. The position of the compute environments in the list will dictate the order. You can associate up to 3 compute environments with a job queue.

  • name (pulumi.Input[str]) – Specifies the name of the job queue.

  • priority (pulumi.Input[float]) – The priority of the job queue. Job queues with a higher priority are evaluated first when associated with the same compute environment.

  • state (pulumi.Input[str]) – The state of the job queue. Must be one of: ENABLED or DISABLED

arn = None

The Amazon Resource Name of the job queue.

compute_environments = None

Specifies the set of compute environments mapped to a job queue and their order. The position of the compute environments in the list will dictate the order. You can associate up to 3 compute environments with a job queue.

name = None

Specifies the name of the job queue.

priority = None

The priority of the job queue. Job queues with a higher priority are evaluated first when associated with the same compute environment.

state = None

The state of the job queue. Must be one of: ENABLED or DISABLED

static get(resource_name, id, opts=None, arn=None, compute_environments=None, name=None, priority=None, state=None)

Get an existing JobQueue resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • arn (pulumi.Input[str]) – The Amazon Resource Name of the job queue.

  • compute_environments (pulumi.Input[list]) – Specifies the set of compute environments mapped to a job queue and their order. The position of the compute environments in the list will dictate the order. You can associate up to 3 compute environments with a job queue.

  • name (pulumi.Input[str]) – Specifies the name of the job queue.

  • priority (pulumi.Input[float]) – The priority of the job queue. Job queues with a higher priority are evaluated first when associated with the same compute environment.

  • state (pulumi.Input[str]) – The state of the job queue. Must be one of: ENABLED or DISABLED

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

pulumi_aws.batch.get_compute_environment(compute_environment_name=None, opts=None)

The Batch Compute Environment data source allows access to details of a specific compute environment within AWS Batch.

Parameters

compute_environment_name (str) – The name of the Batch Compute Environment

pulumi_aws.batch.get_job_queue(name=None, opts=None)

The Batch Job Queue data source allows access to details of a specific job queue within AWS Batch.

Parameters

name (str) – The name of the job queue.