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 | awscc.batch.job_definitions |
Fields
| Name | Datatype | Description |
|---|---|---|
container_properties | object | |
ecs_properties | object | |
node_properties | object | |
job_definition_name | string | |
job_definition_arn | string | |
scheduling_priority | integer | |
parameters | object | |
platform_capabilities | array | |
propagate_tags | boolean | |
retry_strategy | object | |
timeout | object | |
type | string | |
tags | object | A key-value pair to associate with a resource. |
eks_properties | object | |
consumable_resource_properties | object | |
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 properties from an individual job_definition.
SELECT
region,
container_properties,
ecs_properties,
node_properties,
job_definition_name,
job_definition_arn,
scheduling_priority,
parameters,
platform_capabilities,
propagate_tags,
retry_strategy,
timeout,
type,
tags,
eks_properties,
consumable_resource_properties
FROM awscc.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 awscc.batch.job_definitions (
Type,
region
)
SELECT
'{{ Type }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.batch.job_definitions (
ContainerProperties,
EcsProperties,
NodeProperties,
JobDefinitionName,
SchedulingPriority,
Parameters,
PlatformCapabilities,
PropagateTags,
RetryStrategy,
Timeout,
Type,
Tags,
EksProperties,
ConsumableResourceProperties,
region
)
SELECT
'{{ ContainerProperties }}',
'{{ EcsProperties }}',
'{{ NodeProperties }}',
'{{ JobDefinitionName }}',
'{{ SchedulingPriority }}',
'{{ Parameters }}',
'{{ PlatformCapabilities }}',
'{{ PropagateTags }}',
'{{ RetryStrategy }}',
'{{ Timeout }}',
'{{ Type }}',
'{{ Tags }}',
'{{ EksProperties }}',
'{{ ConsumableResourceProperties }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: job_definition
props:
- name: ContainerProperties
value:
Command:
- '{{ Command[0] }}'
Environment:
- Name: '{{ Name }}'
Value: '{{ Value }}'
Image: '{{ Image }}'
JobRoleArn: '{{ JobRoleArn }}'
Memory: '{{ Memory }}'
MountPoints:
- ContainerPath: '{{ ContainerPath }}'
ReadOnly: '{{ ReadOnly }}'
SourceVolume: '{{ SourceVolume }}'
Privileged: '{{ Privileged }}'
ReadonlyRootFilesystem: '{{ ReadonlyRootFilesystem }}'
Ulimits:
- HardLimit: '{{ HardLimit }}'
Name: '{{ Name }}'
SoftLimit: '{{ SoftLimit }}'
User: '{{ User }}'
Vcpus: '{{ Vcpus }}'
Volumes:
- Host:
SourcePath: '{{ SourcePath }}'
EfsVolumeConfiguration:
FileSystemId: '{{ FileSystemId }}'
RootDirectory: '{{ RootDirectory }}'
TransitEncryption: '{{ TransitEncryption }}'
TransitEncryptionPort: '{{ TransitEncryptionPort }}'
AuthorizationConfig:
AccessPointId: '{{ AccessPointId }}'
Iam: '{{ Iam }}'
Name: '{{ Name }}'
ResourceRequirements:
- Type: '{{ Type }}'
Value: '{{ Value }}'
LinuxParameters:
Devices:
- HostPath: '{{ HostPath }}'
ContainerPath: '{{ ContainerPath }}'
Permissions:
- '{{ Permissions[0] }}'
InitProcessEnabled: '{{ InitProcessEnabled }}'
MaxSwap: '{{ MaxSwap }}'
Swappiness: '{{ Swappiness }}'
SharedMemorySize: '{{ SharedMemorySize }}'
Tmpfs:
- ContainerPath: '{{ ContainerPath }}'
Size: '{{ Size }}'
MountOptions:
- '{{ MountOptions[0] }}'
LogConfiguration:
LogDriver: '{{ LogDriver }}'
Options: {}
SecretOptions:
- Name: '{{ Name }}'
ValueFrom: '{{ ValueFrom }}'
ExecutionRoleArn: '{{ ExecutionRoleArn }}'
Secrets:
- null
NetworkConfiguration:
AssignPublicIp: '{{ AssignPublicIp }}'
FargatePlatformConfiguration:
PlatformVersion: '{{ PlatformVersion }}'
EphemeralStorage:
SizeInGiB: '{{ SizeInGiB }}'
RuntimePlatform:
OperatingSystemFamily: '{{ OperatingSystemFamily }}'
CpuArchitecture: '{{ CpuArchitecture }}'
RepositoryCredentials:
CredentialsParameter: '{{ CredentialsParameter }}'
EnableExecuteCommand: '{{ EnableExecuteCommand }}'
- name: EcsProperties
value:
TaskProperties:
- Containers:
- Command:
- '{{ Command[0] }}'
Environment:
- null
DependsOn:
- ContainerName: '{{ ContainerName }}'
Condition: '{{ Condition }}'
Name: '{{ Name }}'
Image: '{{ Image }}'
LinuxParameters: null
LogConfiguration: null
MountPoints:
- null
Essential: '{{ Essential }}'
Privileged: '{{ Privileged }}'
ReadonlyRootFilesystem: '{{ ReadonlyRootFilesystem }}'
Ulimits:
- null
User: '{{ User }}'
Secrets:
- null
RepositoryCredentials: null
ResourceRequirements:
- null
FirelensConfiguration:
Type: '{{ Type }}'
Options: {}
EphemeralStorage: null
ExecutionRoleArn: '{{ ExecutionRoleArn }}'
RuntimePlatform: null
NetworkConfiguration: null
Volumes:
- null
PidMode: '{{ PidMode }}'
IpcMode: '{{ IpcMode }}'
PlatformVersion: '{{ PlatformVersion }}'
TaskRoleArn: '{{ TaskRoleArn }}'
EnableExecuteCommand: '{{ EnableExecuteCommand }}'
- name: NodeProperties
value:
NumNodes: '{{ NumNodes }}'
MainNode: '{{ MainNode }}'
NodeRangeProperties:
- TargetNodes: '{{ TargetNodes }}'
Container:
Command:
- '{{ Command[0] }}'
Environment:
- null
Image: '{{ Image }}'
JobRoleArn: '{{ JobRoleArn }}'
Memory: '{{ Memory }}'
MountPoints:
- null
Privileged: '{{ Privileged }}'
ReadonlyRootFilesystem: '{{ ReadonlyRootFilesystem }}'
Ulimits:
- null
User: '{{ User }}'
Vcpus: '{{ Vcpus }}'
Volumes:
- null
InstanceType: '{{ InstanceType }}'
ResourceRequirements:
- null
LinuxParameters: null
LogConfiguration: null
ExecutionRoleArn: '{{ ExecutionRoleArn }}'
Secrets:
- null
EphemeralStorage: null
RuntimePlatform: null
RepositoryCredentials: null
EnableExecuteCommand: '{{ EnableExecuteCommand }}'
EcsProperties:
TaskProperties:
- Containers:
- null
ExecutionRoleArn: '{{ ExecutionRoleArn }}'
Volumes:
- null
PidMode: '{{ PidMode }}'
IpcMode: '{{ IpcMode }}'
TaskRoleArn: '{{ TaskRoleArn }}'
EnableExecuteCommand: '{{ EnableExecuteCommand }}'
EksProperties:
PodProperties:
ServiceAccountName: '{{ ServiceAccountName }}'
HostNetwork: '{{ HostNetwork }}'
DnsPolicy: '{{ DnsPolicy }}'
InitContainers:
- Name: '{{ Name }}'
Image: '{{ Image }}'
ImagePullPolicy: '{{ ImagePullPolicy }}'
Command:
- '{{ Command[0] }}'
Args:
- '{{ Args[0] }}'
Env:
- Name: '{{ Name }}'
Value: '{{ Value }}'
Resources:
Limits: {}
Requests: {}
VolumeMounts:
- Name: '{{ Name }}'
MountPath: '{{ MountPath }}'
SubPath: '{{ SubPath }}'
ReadOnly: '{{ ReadOnly }}'
SecurityContext:
RunAsUser: '{{ RunAsUser }}'
RunAsGroup: '{{ RunAsGroup }}'
Privileged: '{{ Privileged }}'
AllowPrivilegeEscalation: '{{ AllowPrivilegeEscalation }}'
ReadOnlyRootFilesystem: '{{ ReadOnlyRootFilesystem }}'
RunAsNonRoot: '{{ RunAsNonRoot }}'
Containers:
- null
Volumes:
- Name: '{{ Name }}'
HostPath:
Path: '{{ Path }}'
EmptyDir:
Medium: '{{ Medium }}'
SizeLimit: '{{ SizeLimit }}'
Secret:
SecretName: '{{ SecretName }}'
Optional: '{{ Optional }}'
PersistentVolumeClaim:
ClaimName: '{{ ClaimName }}'
ReadOnly: '{{ ReadOnly }}'
ImagePullSecrets:
- Name: '{{ Name }}'
Metadata:
Labels: {}
Annotations: {}
Namespace: '{{ Namespace }}'
ShareProcessNamespace: '{{ ShareProcessNamespace }}'
ConsumableResourceProperties:
ConsumableResourceList:
- ConsumableResource: '{{ ConsumableResource }}'
Quantity: '{{ Quantity }}'
InstanceTypes:
- '{{ InstanceTypes[0] }}'
- name: JobDefinitionName
value: '{{ JobDefinitionName }}'
- name: SchedulingPriority
value: '{{ SchedulingPriority }}'
- name: Parameters
value: {}
- name: PlatformCapabilities
value:
- '{{ PlatformCapabilities[0] }}'
- name: PropagateTags
value: '{{ PropagateTags }}'
- name: RetryStrategy
value:
Attempts: '{{ Attempts }}'
EvaluateOnExit:
- OnExitCode: '{{ OnExitCode }}'
OnStatusReason: '{{ OnStatusReason }}'
OnReason: '{{ OnReason }}'
Action: '{{ Action }}'
- name: Timeout
value:
AttemptDurationSeconds: '{{ AttemptDurationSeconds }}'
- name: Type
value: '{{ Type }}'
- name: Tags
value: {}
- name: EksProperties
value: null
- name: ConsumableResourceProperties
value: null
DELETE example
/*+ delete */
DELETE FROM awscc.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:
Create
Batch:RegisterJobDefinition,
Batch:TagResource,
Batch:DescribeJobDefinitions,
Iam:PassRole
Read
Batch:DescribeJobDefinitions
Update
Batch:DescribeJobDefinitions,
Batch:RegisterJobDefinition,
Batch:DeregisterJobDefinition,
Batch:TagResource,
Batch:UntagResource,
Iam:PassRole
Delete
Batch:DescribeJobDefinitions,
Batch:DeregisterJobDefinition,
Iam:PassRole
List
Batch:DescribeJobDefinitions