job_definitions
Creates, updates, deletes, gets or lists a job_definitions resource.
Overview
| Name | job_definitions |
| Type | Resource |
| Id | aws.batch.job_definitions |
Fields
The following fields are returned by SELECT queries:
- describe_job_definitions
| Name | Datatype | Description |
|---|---|---|
consumable_resource_properties | object | Contains a list of consumable resources required by the job. |
container_orchestration_type | string | The orchestration type of the compute environment. The valid values are ECS (default) or EKS. (ECS, EKS) |
container_properties | object | An object with properties specific to Amazon ECS-based jobs. When containerProperties is used in the job definition, it can't be used in addition to eksProperties, ecsProperties, or nodeProperties. |
ecs_properties | object | An object that contains the properties for the Amazon ECS resources of a job.When ecsProperties is used in the job definition, it can't be used in addition to containerProperties, eksProperties, or nodeProperties. |
eks_properties | object | An object with properties that are specific to Amazon EKS-based jobs. When eksProperties is used in the job definition, it can't be used in addition to containerProperties, ecsProperties, or nodeProperties. |
job_definition_arn | string | The Amazon Resource Name (ARN) for the job definition. |
job_definition_name | string | The name of the job definition. |
node_properties | object | An object with properties that are specific to multi-node parallel jobs. When nodeProperties is used in the job definition, it can't be used in addition to containerProperties, ecsProperties, or eksProperties. If the job runs on Fargate resources, don't specify nodeProperties. Use containerProperties instead. |
parameters | object | Default parameters or parameter substitution placeholders that are set in the job definition. Parameters are specified as a key-value pair mapping. Parameters in a SubmitJob request override any corresponding parameter defaults from the job definition. For more information about specifying parameters, see Job definition parameters in the Batch User Guide. |
platform_capabilities | array | The platform capabilities required by the job definition. If no value is specified, it defaults to EC2. Jobs run on Fargate resources specify FARGATE. |
propagate_tags | boolean | Specifies whether to propagate the tags from the job or job definition to the corresponding Amazon ECS task. If no value is specified, the tags aren't propagated. Tags can only be propagated to the tasks when the tasks are created. For tags with the same name, job tags are given priority over job definitions tags. If the total number of combined tags from the job and job definition is over 50, the job is moved to the FAILED state. |
retry_strategy | object | The retry strategy to use for failed jobs that are submitted with this job definition. |
revision | integer | The revision of the job definition. |
scheduling_priority | integer | The scheduling priority of the job definition. This only affects jobs in job queues with a fair-share policy. Jobs with a higher scheduling priority are scheduled before jobs with a lower scheduling priority. |
status | string | The status of the job definition. |
tags | object | The tags that are applied to the job definition. |
timeout | object | The timeout time for jobs that are submitted with this job definition. After the amount of time you specify passes, Batch terminates your jobs if they aren't finished. |
type_ | string | The type of job definition. It's either container or multinode. If the job is run on Fargate resources, then multinode isn't supported. For more information about multi-node parallel jobs, see Creating a multi-node parallel job definition in the Batch User Guide. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_job_definitions | select | region | Describes a list of job definitions. You can specify a status (such as ACTIVE) to only return job definitions that match that status. | |
register_job_definition | insert | region, jobDefinitionName, type | Registers an Batch job definition. | |
deregister_job_definition | delete | region | Deregisters an Batch job definition. Job definitions are permanently deleted after 180 days. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_job_definitions
Describes a list of job definitions. You can specify a status (such as ACTIVE) to only return job definitions that match that status.
SELECT
consumable_resource_properties,
container_orchestration_type,
container_properties,
ecs_properties,
eks_properties,
job_definition_arn,
job_definition_name,
node_properties,
parameters,
platform_capabilities,
propagate_tags,
retry_strategy,
revision,
scheduling_priority,
status,
tags,
timeout,
type_
FROM aws.batch.job_definitions
WHERE region = '{{ region }}' -- required
;
INSERT examples
- register_job_definition
- Manifest
Registers an Batch job definition.
INSERT INTO aws.batch.job_definitions (
jobDefinitionName,
type,
parameters,
schedulingPriority,
containerProperties,
nodeProperties,
retryStrategy,
propagateTags,
timeout,
tags,
platformCapabilities,
eksProperties,
ecsProperties,
consumableResourceProperties,
region
)
SELECT
'{{ jobDefinitionName }}' /* required */,
'{{ type }}' /* required */,
'{{ parameters }}',
{{ schedulingPriority }},
'{{ containerProperties }}',
'{{ nodeProperties }}',
'{{ retryStrategy }}',
{{ propagateTags }},
'{{ timeout }}',
'{{ tags }}',
'{{ platformCapabilities }}',
'{{ eksProperties }}',
'{{ ecsProperties }}',
'{{ consumableResourceProperties }}',
'{{ region }}'
RETURNING
job_definition_arn,
job_definition_name,
revision
;
# Description fields are for documentation purposes
- name: job_definitions
props:
- name: region
value: "{{ region }}"
description: Required parameter for the job_definitions resource.
- name: jobDefinitionName
value: "{{ jobDefinitionName }}"
- name: type
value: "{{ type }}"
valid_values: ['container', 'multinode']
- name: parameters
value: "{{ parameters }}"
- name: schedulingPriority
value: {{ schedulingPriority }}
- name: containerProperties
description: |
Container properties are used for Amazon ECS based job definitions. These properties to describe the container that's launched as part of a job.
value:
image: "{{ image }}"
vcpus: {{ vcpus }}
memory: {{ memory }}
command:
- "{{ command }}"
jobRoleArn: "{{ jobRoleArn }}"
executionRoleArn: "{{ executionRoleArn }}"
volumes:
- host:
sourcePath: "{{ sourcePath }}"
name: "{{ name }}"
efsVolumeConfiguration:
fileSystemId: "{{ fileSystemId }}"
rootDirectory: "{{ rootDirectory }}"
transitEncryption: "{{ transitEncryption }}"
transitEncryptionPort: {{ transitEncryptionPort }}
authorizationConfig:
accessPointId: "{{ accessPointId }}"
iam: "{{ iam }}"
s3filesVolumeConfiguration:
fileSystemArn: "{{ fileSystemArn }}"
rootDirectory: "{{ rootDirectory }}"
transitEncryptionPort: {{ transitEncryptionPort }}
accessPointArn: "{{ accessPointArn }}"
environment:
- name: "{{ name }}"
value: "{{ value }}"
mountPoints:
- containerPath: "{{ containerPath }}"
readOnly_: {{ readOnly_ }}
sourceVolume: "{{ sourceVolume }}"
readonlyRootFilesystem: {{ readonlyRootFilesystem }}
privileged: {{ privileged }}
ulimits:
- hardLimit: {{ hardLimit }}
name: "{{ name }}"
softLimit: {{ softLimit }}
user: "{{ user }}"
instanceType: "{{ instanceType }}"
resourceRequirements:
- value: "{{ value }}"
type_: "{{ type_ }}"
linuxParameters:
devices:
- hostPath: "{{ hostPath }}"
containerPath: "{{ containerPath }}"
permissions: "{{ permissions }}"
initProcessEnabled: {{ initProcessEnabled }}
sharedMemorySize: {{ sharedMemorySize }}
tmpfs:
- containerPath: "{{ containerPath }}"
size: {{ size }}
mountOptions: "{{ mountOptions }}"
maxSwap: {{ maxSwap }}
swappiness: {{ swappiness }}
logConfiguration:
logDriver: "{{ logDriver }}"
options: "{{ options }}"
secretOptions:
- name: "{{ name }}"
valueFrom: "{{ valueFrom }}"
secrets:
- name: "{{ name }}"
valueFrom: "{{ valueFrom }}"
networkConfiguration:
assignPublicIp: "{{ assignPublicIp }}"
fargatePlatformConfiguration:
platformVersion: "{{ platformVersion }}"
enableExecuteCommand: {{ enableExecuteCommand }}
ephemeralStorage:
sizeInGiB: {{ sizeInGiB }}
runtimePlatform:
operatingSystemFamily: "{{ operatingSystemFamily }}"
cpuArchitecture: "{{ cpuArchitecture }}"
repositoryCredentials:
credentialsParameter: "{{ credentialsParameter }}"
- name: nodeProperties
description: |
An object that represents the node properties of a multi-node parallel job. Node properties can't be specified for Amazon EKS based job definitions.
value:
numNodes: {{ numNodes }}
mainNode: {{ mainNode }}
nodeRangeProperties:
- targetNodes: "{{ targetNodes }}"
container:
image: "{{ image }}"
vcpus: {{ vcpus }}
memory: {{ memory }}
command:
- "{{ command }}"
jobRoleArn: "{{ jobRoleArn }}"
executionRoleArn: "{{ executionRoleArn }}"
volumes:
- host:
sourcePath: "{{ sourcePath }}"
name: "{{ name }}"
efsVolumeConfiguration:
fileSystemId: "{{ fileSystemId }}"
rootDirectory: "{{ rootDirectory }}"
transitEncryption: "{{ transitEncryption }}"
transitEncryptionPort: {{ transitEncryptionPort }}
authorizationConfig: "{{ authorizationConfig }}"
s3filesVolumeConfiguration:
fileSystemArn: "{{ fileSystemArn }}"
rootDirectory: "{{ rootDirectory }}"
transitEncryptionPort: {{ transitEncryptionPort }}
accessPointArn: "{{ accessPointArn }}"
environment:
- name: "{{ name }}"
value: "{{ value }}"
mountPoints:
- containerPath: "{{ containerPath }}"
readOnly_: {{ readOnly_ }}
sourceVolume: "{{ sourceVolume }}"
readonlyRootFilesystem: {{ readonlyRootFilesystem }}
privileged: {{ privileged }}
ulimits:
- hardLimit: {{ hardLimit }}
name: "{{ name }}"
softLimit: {{ softLimit }}
user: "{{ user }}"
instanceType: "{{ instanceType }}"
resourceRequirements:
- value: "{{ value }}"
type_: "{{ type_ }}"
linuxParameters:
devices:
- hostPath: "{{ hostPath }}"
containerPath: "{{ containerPath }}"
permissions: "{{ permissions }}"
initProcessEnabled: {{ initProcessEnabled }}
sharedMemorySize: {{ sharedMemorySize }}
tmpfs:
- containerPath: "{{ containerPath }}"
size: {{ size }}
mountOptions: "{{ mountOptions }}"
maxSwap: {{ maxSwap }}
swappiness: {{ swappiness }}
logConfiguration:
logDriver: "{{ logDriver }}"
options: "{{ options }}"
secretOptions:
- name: "{{ name }}"
valueFrom: "{{ valueFrom }}"
secrets:
- name: "{{ name }}"
valueFrom: "{{ valueFrom }}"
networkConfiguration:
assignPublicIp: "{{ assignPublicIp }}"
fargatePlatformConfiguration:
platformVersion: "{{ platformVersion }}"
enableExecuteCommand: {{ enableExecuteCommand }}
ephemeralStorage:
sizeInGiB: {{ sizeInGiB }}
runtimePlatform:
operatingSystemFamily: "{{ operatingSystemFamily }}"
cpuArchitecture: "{{ cpuArchitecture }}"
repositoryCredentials:
credentialsParameter: "{{ credentialsParameter }}"
instanceTypes: "{{ instanceTypes }}"
ecsProperties:
taskProperties:
- containers: "{{ containers }}"
ephemeralStorage:
sizeInGiB: {{ sizeInGiB }}
executionRoleArn: "{{ executionRoleArn }}"
platformVersion: "{{ platformVersion }}"
ipcMode: "{{ ipcMode }}"
taskRoleArn: "{{ taskRoleArn }}"
pidMode: "{{ pidMode }}"
networkConfiguration:
assignPublicIp: "{{ assignPublicIp }}"
runtimePlatform:
operatingSystemFamily: "{{ operatingSystemFamily }}"
cpuArchitecture: "{{ cpuArchitecture }}"
volumes: "{{ volumes }}"
enableExecuteCommand: {{ enableExecuteCommand }}
eksProperties:
podProperties:
serviceAccountName: "{{ serviceAccountName }}"
hostNetwork: {{ hostNetwork }}
dnsPolicy: "{{ dnsPolicy }}"
imagePullSecrets:
- name: "{{ name }}"
containers:
- name: "{{ name }}"
image: "{{ image }}"
imagePullPolicy: "{{ imagePullPolicy }}"
command: "{{ command }}"
args: "{{ args }}"
env: "{{ env }}"
resources:
limits: "{{ limits }}"
requests: "{{ requests }}"
volumeMounts: "{{ volumeMounts }}"
securityContext:
runAsUser: {{ runAsUser }}
runAsGroup: {{ runAsGroup }}
privileged: {{ privileged }}
allowPrivilegeEscalation: {{ allowPrivilegeEscalation }}
readOnlyRootFilesystem: {{ readOnlyRootFilesystem }}
runAsNonRoot: {{ runAsNonRoot }}
initContainers:
- name: "{{ name }}"
image: "{{ image }}"
imagePullPolicy: "{{ imagePullPolicy }}"
command: "{{ command }}"
args: "{{ args }}"
env: "{{ env }}"
resources:
limits: "{{ limits }}"
requests: "{{ requests }}"
volumeMounts: "{{ volumeMounts }}"
securityContext:
runAsUser: {{ runAsUser }}
runAsGroup: {{ runAsGroup }}
privileged: {{ privileged }}
allowPrivilegeEscalation: {{ allowPrivilegeEscalation }}
readOnlyRootFilesystem: {{ readOnlyRootFilesystem }}
runAsNonRoot: {{ runAsNonRoot }}
volumes:
- name: "{{ name }}"
hostPath:
path: "{{ path }}"
emptyDir:
medium: "{{ medium }}"
sizeLimit: "{{ sizeLimit }}"
secret:
secretName: "{{ secretName }}"
optional: {{ optional }}
persistentVolumeClaim:
claimName: "{{ claimName }}"
readOnly_: {{ readOnly_ }}
metadata:
labels: "{{ labels }}"
annotations: "{{ annotations }}"
namespace: "{{ namespace }}"
shareProcessNamespace: {{ shareProcessNamespace }}
consumableResourceProperties:
consumableResourceList:
- consumableResource: "{{ consumableResource }}"
quantity: {{ quantity }}
- name: retryStrategy
description: |
The retry strategy that's associated with a job. For more information, see Automated job retries in the Batch User Guide.
value:
attempts: {{ attempts }}
evaluateOnExit:
- onStatusReason: "{{ onStatusReason }}"
onReason: "{{ onReason }}"
onExitCode: "{{ onExitCode }}"
action: "{{ action }}"
- name: propagateTags
value: {{ propagateTags }}
- name: timeout
description: |
An object that represents a job timeout configuration.
value:
attemptDurationSeconds: {{ attemptDurationSeconds }}
- name: tags
value: "{{ tags }}"
- name: platformCapabilities
value:
- "{{ platformCapabilities }}"
- name: eksProperties
description: |
An object that contains the properties for the Kubernetes resources of a job.
value:
podProperties:
serviceAccountName: "{{ serviceAccountName }}"
hostNetwork: {{ hostNetwork }}
dnsPolicy: "{{ dnsPolicy }}"
imagePullSecrets:
- name: "{{ name }}"
containers:
- name: "{{ name }}"
image: "{{ image }}"
imagePullPolicy: "{{ imagePullPolicy }}"
command: "{{ command }}"
args: "{{ args }}"
env: "{{ env }}"
resources:
limits: "{{ limits }}"
requests: "{{ requests }}"
volumeMounts: "{{ volumeMounts }}"
securityContext:
runAsUser: {{ runAsUser }}
runAsGroup: {{ runAsGroup }}
privileged: {{ privileged }}
allowPrivilegeEscalation: {{ allowPrivilegeEscalation }}
readOnlyRootFilesystem: {{ readOnlyRootFilesystem }}
runAsNonRoot: {{ runAsNonRoot }}
initContainers:
- name: "{{ name }}"
image: "{{ image }}"
imagePullPolicy: "{{ imagePullPolicy }}"
command: "{{ command }}"
args: "{{ args }}"
env: "{{ env }}"
resources:
limits: "{{ limits }}"
requests: "{{ requests }}"
volumeMounts: "{{ volumeMounts }}"
securityContext:
runAsUser: {{ runAsUser }}
runAsGroup: {{ runAsGroup }}
privileged: {{ privileged }}
allowPrivilegeEscalation: {{ allowPrivilegeEscalation }}
readOnlyRootFilesystem: {{ readOnlyRootFilesystem }}
runAsNonRoot: {{ runAsNonRoot }}
volumes:
- name: "{{ name }}"
hostPath:
path: "{{ path }}"
emptyDir:
medium: "{{ medium }}"
sizeLimit: "{{ sizeLimit }}"
secret:
secretName: "{{ secretName }}"
optional: {{ optional }}
persistentVolumeClaim:
claimName: "{{ claimName }}"
readOnly_: {{ readOnly_ }}
metadata:
labels: "{{ labels }}"
annotations: "{{ annotations }}"
namespace: "{{ namespace }}"
shareProcessNamespace: {{ shareProcessNamespace }}
- name: ecsProperties
description: |
An object that contains the properties for the Amazon ECS resources of a job.
value:
taskProperties:
- containers: "{{ containers }}"
ephemeralStorage:
sizeInGiB: {{ sizeInGiB }}
executionRoleArn: "{{ executionRoleArn }}"
platformVersion: "{{ platformVersion }}"
ipcMode: "{{ ipcMode }}"
taskRoleArn: "{{ taskRoleArn }}"
pidMode: "{{ pidMode }}"
networkConfiguration:
assignPublicIp: "{{ assignPublicIp }}"
runtimePlatform:
operatingSystemFamily: "{{ operatingSystemFamily }}"
cpuArchitecture: "{{ cpuArchitecture }}"
volumes: "{{ volumes }}"
enableExecuteCommand: {{ enableExecuteCommand }}
- name: consumableResourceProperties
description: |
Contains a list of consumable resources required by a job.
value:
consumableResourceList:
- consumableResource: "{{ consumableResource }}"
quantity: {{ quantity }}
DELETE examples
- deregister_job_definition
Deregisters an Batch job definition. Job definitions are permanently deleted after 180 days.
DELETE FROM aws.batch.job_definitions
WHERE region = '{{ region }}' --required
;