job_definitions
Creates, updates, deletes or gets a job_definition
resource or lists job_definitions
in a region
Overview
Name | job_definitions |
Type | Resource |
Description | Resource Type definition for AWS::Batch::JobDefinition |
Id | aws.batch.job_definitions |
Fields
Name | Datatype | Description |
---|---|---|
parameters | object | |
timeout | object | |
job_definition_name | string | |
propagate_tags | boolean | |
platform_capabilities | array | |
eks_properties | object | |
type | string | |
node_properties | object | |
scheduling_priority | integer | |
container_properties | object | |
ecs_properties | object | |
retry_strategy | object | |
tags | object | A key-value pair to associate with a resource. |
region | string | AWS region. |
For more information, see AWS::Batch::JobDefinition
.
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | Type, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all job_definitions
in a region.
SELECT
region,
parameters,
timeout,
job_definition_name,
propagate_tags,
platform_capabilities,
eks_properties,
type,
node_properties,
scheduling_priority,
container_properties,
ecs_properties,
retry_strategy,
tags
FROM aws.batch.job_definitions
WHERE region = 'us-east-1';
Gets all properties from an individual job_definition
.
SELECT
region,
parameters,
timeout,
job_definition_name,
propagate_tags,
platform_capabilities,
eks_properties,
type,
node_properties,
scheduling_priority,
container_properties,
ecs_properties,
retry_strategy,
tags
FROM aws.batch.job_definitions
WHERE region = 'us-east-1' AND data__Identifier = '<JobDefinitionName>';
INSERT
example
Use the following StackQL query and manifest file to create a new job_definition
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.batch.job_definitions (
Type,
region
)
SELECT
'{{ Type }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.batch.job_definitions (
Parameters,
Timeout,
JobDefinitionName,
PropagateTags,
PlatformCapabilities,
EksProperties,
Type,
NodeProperties,
SchedulingPriority,
ContainerProperties,
EcsProperties,
RetryStrategy,
Tags,
region
)
SELECT
'{{ Parameters }}',
'{{ Timeout }}',
'{{ JobDefinitionName }}',
'{{ PropagateTags }}',
'{{ PlatformCapabilities }}',
'{{ EksProperties }}',
'{{ Type }}',
'{{ NodeProperties }}',
'{{ SchedulingPriority }}',
'{{ ContainerProperties }}',
'{{ EcsProperties }}',
'{{ RetryStrategy }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: job_definition
props:
- name: Parameters
value: {}
- name: Timeout
value:
AttemptDurationSeconds: '{{ AttemptDurationSeconds }}'
- name: JobDefinitionName
value: '{{ JobDefinitionName }}'
- name: PropagateTags
value: '{{ PropagateTags }}'
- name: PlatformCapabilities
value:
- '{{ PlatformCapabilities[0] }}'
- name: EksProperties
value:
PodProperties:
InitContainers:
- Args:
- '{{ Args[0] }}'
VolumeMounts:
- MountPath: '{{ MountPath }}'
ReadOnly: '{{ ReadOnly }}'
Name: '{{ Name }}'
ImagePullPolicy: '{{ ImagePullPolicy }}'
Command:
- '{{ Command[0] }}'
SecurityContext:
RunAsUser: '{{ RunAsUser }}'
AllowPrivilegeEscalation: '{{ AllowPrivilegeEscalation }}'
RunAsNonRoot: '{{ RunAsNonRoot }}'
Privileged: '{{ Privileged }}'
ReadOnlyRootFilesystem: '{{ ReadOnlyRootFilesystem }}'
RunAsGroup: '{{ RunAsGroup }}'
Resources:
Limits: {}
Requests: {}
Image: '{{ Image }}'
Env:
- Value: '{{ Value }}'
Name: '{{ Name }}'
Name: '{{ Name }}'
Volumes:
- Secret:
SecretName: '{{ SecretName }}'
Optional: '{{ Optional }}'
EmptyDir:
Medium: '{{ Medium }}'
SizeLimit: '{{ SizeLimit }}'
HostPath:
Path: '{{ Path }}'
Name: '{{ Name }}'
DnsPolicy: '{{ DnsPolicy }}'
Containers:
- null
Metadata:
Labels: {}
ServiceAccountName: '{{ ServiceAccountName }}'
ImagePullSecrets:
- Name: '{{ Name }}'
HostNetwork: '{{ HostNetwork }}'
ShareProcessNamespace: '{{ ShareProcessNamespace }}'
- name: Type
value: '{{ Type }}'
- name: NodeProperties
value:
MainNode: '{{ MainNode }}'
NodeRangeProperties:
- Container:
RepositoryCredentials:
CredentialsParameter: '{{ CredentialsParameter }}'
User: '{{ User }}'
Secrets:
- ValueFrom: '{{ ValueFrom }}'
Name: '{{ Name }}'
Memory: '{{ Memory }}'
Privileged: '{{ Privileged }}'
LinuxParameters:
Swappiness: '{{ Swappiness }}'
Tmpfs:
- Size: '{{ Size }}'
ContainerPath: '{{ ContainerPath }}'
MountOptions:
- '{{ MountOptions[0] }}'
SharedMemorySize: '{{ SharedMemorySize }}'
Devices:
- HostPath: '{{ HostPath }}'
Permissions:
- '{{ Permissions[0] }}'
ContainerPath: '{{ ContainerPath }}'
InitProcessEnabled: '{{ InitProcessEnabled }}'
MaxSwap: '{{ MaxSwap }}'
JobRoleArn: '{{ JobRoleArn }}'
ReadonlyRootFilesystem: '{{ ReadonlyRootFilesystem }}'
Vcpus: '{{ Vcpus }}'
Image: '{{ Image }}'
ResourceRequirements:
- Type: '{{ Type }}'
Value: '{{ Value }}'
LogConfiguration:
SecretOptions:
- null
Options: {}
LogDriver: '{{ LogDriver }}'
MountPoints:
- ReadOnly: '{{ ReadOnly }}'
SourceVolume: '{{ SourceVolume }}'
ContainerPath: '{{ ContainerPath }}'
ExecutionRoleArn: '{{ ExecutionRoleArn }}'
RuntimePlatform:
OperatingSystemFamily: '{{ OperatingSystemFamily }}'
CpuArchitecture: '{{ CpuArchitecture }}'
Volumes:
- Host:
SourcePath: '{{ SourcePath }}'
EfsVolumeConfiguration:
TransitEncryption: '{{ TransitEncryption }}'
AuthorizationConfig:
Iam: '{{ Iam }}'
AccessPointId: '{{ AccessPointId }}'
FileSystemId: '{{ FileSystemId }}'
RootDirectory: '{{ RootDirectory }}'
TransitEncryptionPort: '{{ TransitEncryptionPort }}'
Name: '{{ Name }}'
Command:
- '{{ Command[0] }}'
Environment:
- Value: '{{ Value }}'
Name: '{{ Name }}'
Ulimits:
- SoftLimit: '{{ SoftLimit }}'
HardLimit: '{{ HardLimit }}'
Name: '{{ Name }}'
InstanceType: '{{ InstanceType }}'
EphemeralStorage:
SizeInGiB: '{{ SizeInGiB }}'
TargetNodes: '{{ TargetNodes }}'
EcsProperties:
TaskProperties:
- ExecutionRoleArn: '{{ ExecutionRoleArn }}'
TaskRoleArn: '{{ TaskRoleArn }}'
IpcMode: '{{ IpcMode }}'
Volumes:
- null
Containers:
- RepositoryCredentials: null
User: '{{ User }}'
Secrets:
- null
Privileged: '{{ Privileged }}'
LinuxParameters: null
ReadonlyRootFilesystem: '{{ ReadonlyRootFilesystem }}'
Image: '{{ Image }}'
LogConfiguration: null
Essential: '{{ Essential }}'
ResourceRequirements:
- null
Name: '{{ Name }}'
MountPoints:
- null
DependsOn:
- Condition: '{{ Condition }}'
ContainerName: '{{ ContainerName }}'
Command:
- '{{ Command[0] }}'
Environment:
- null
Ulimits:
- null
PidMode: '{{ PidMode }}'
InstanceTypes:
- '{{ InstanceTypes[0] }}'
EksProperties: null
NumNodes: '{{ NumNodes }}'
- name: SchedulingPriority
value: '{{ SchedulingPriority }}'
- name: ContainerProperties
value:
RepositoryCredentials: null
User: '{{ User }}'
Secrets:
- null
Memory: '{{ Memory }}'
Privileged: '{{ Privileged }}'
LinuxParameters: null
FargatePlatformConfiguration:
PlatformVersion: '{{ PlatformVersion }}'
JobRoleArn: '{{ JobRoleArn }}'
ReadonlyRootFilesystem: '{{ ReadonlyRootFilesystem }}'
Vcpus: '{{ Vcpus }}'
Image: '{{ Image }}'
ResourceRequirements:
- null
LogConfiguration: null
MountPoints:
- null
ExecutionRoleArn: '{{ ExecutionRoleArn }}'
RuntimePlatform: null
Volumes:
- null
Command:
- '{{ Command[0] }}'
Environment:
- null
Ulimits:
- null
NetworkConfiguration:
AssignPublicIp: '{{ AssignPublicIp }}'
EphemeralStorage: null
- name: EcsProperties
value:
TaskProperties:
- PlatformVersion: '{{ PlatformVersion }}'
ExecutionRoleArn: '{{ ExecutionRoleArn }}'
RuntimePlatform: null
TaskRoleArn: '{{ TaskRoleArn }}'
IpcMode: '{{ IpcMode }}'
Volumes:
- null
Containers:
- null
NetworkConfiguration: null
PidMode: '{{ PidMode }}'
EphemeralStorage: null
- name: RetryStrategy
value:
EvaluateOnExit:
- Action: '{{ Action }}'
OnExitCode: '{{ OnExitCode }}'
OnReason: '{{ OnReason }}'
OnStatusReason: '{{ OnStatusReason }}'
Attempts: '{{ Attempts }}'
- name: Tags
value: {}
DELETE
example
/*+ delete */
DELETE FROM aws.batch.job_definitions
WHERE data__Identifier = '<JobDefinitionName>'
AND region = 'us-east-1';
Permissions
To operate on the job_definitions
resource, the following permissions are required:
Read
Batch:DescribeJobDefinitions
Create
Batch:RegisterJobDefinition,
Batch:TagResource,
Batch:DescribeJobDefinitions,
Iam:PassRole
Update
Batch:DescribeJobDefinitions,
Batch:RegisterJobDefinition,
Batch:DeregisterJobDefinition,
Batch:TagResource,
Batch:UntagResource,
Iam:PassRole
List
Batch:DescribeJobDefinitions
Delete
Batch:DescribeJobDefinitions,
Batch:DeregisterJobDefinition,
Iam:PassRole