» Resource: aws_batch_job_definition
Provides a Batch Job Definition resource.
» Example Usage
resource "aws_batch_job_definition" "test" {
name = "tf_test_batch_job_definition"
type = "container"
container_properties = <<CONTAINER_PROPERTIES
{
"command": ["ls", "-la"],
"image": "busybox",
"memory": 1024,
"vcpus": 1,
"volumes": [
{
"host": {
"sourcePath": "/tmp"
},
"name": "tmp"
}
],
"environment": [
{"name": "VARNAME", "value": "VARVAL"}
],
"mountPoints": [
{
"sourceVolume": "tmp",
"containerPath": "/tmp",
"readOnly": false
}
],
"ulimits": [
{
"hardLimit": 1024,
"name": "nofile",
"softLimit": 1024
}
]
}
CONTAINER_PROPERTIES
}
» Argument Reference
The following arguments are supported:
-
name
- (Required) Specifies the name of the job definition. -
container_properties
- (Optional) A valid container properties provided as a single valid JSON document. This parameter is required if thetype
parameter iscontainer
. -
parameters
- (Optional) Specifies the parameter substitution placeholders to set in the job definition. -
retry_strategy
- (Optional) Specifies the retry strategy to use for failed jobs that are submitted with this job definition. Maximum number ofretry_strategy
is1
. Defined below. -
timeout
- (Optional) Specifies the timeout for jobs so that if a job runs longer, AWS Batch terminates the job. Maximum number oftimeout
is1
. Defined below. -
type
- (Required) The type of job definition. Must becontainer
» retry_strategy
retry_strategy
supports the following:
-
attempts
- (Optional) The number of times to move a job to theRUNNABLE
status. You may specify between1
and10
attempts.
» timeout
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 is60
seconds.
» Attribute Reference
In addition to all arguments above, the following attributes are exported: