Skip to main content

job_definitions

Creates, updates, deletes or gets a job_definition resource or lists job_definitions in a region

Overview

Namejob_definitions
TypeResource
DescriptionResource Type definition for AWS::Batch::JobDefinition
Idawscc.batch.job_definitions

Fields

NameDatatypeDescription
container_propertiesobject
ecs_propertiesobject
node_propertiesobject
job_definition_namestring
job_definition_arnstring
scheduling_priorityinteger
parametersobject
platform_capabilitiesarray
propagate_tagsboolean
retry_strategyobject
timeoutobject
typestring
tagsobjectA key-value pair to associate with a resource.
eks_propertiesobject
consumable_resource_propertiesobject
regionstringAWS region.

For more information, see AWS::Batch::JobDefinition.

Methods

NameResourceAccessible byRequired Params
create_resourcejob_definitionsINSERTType, region
delete_resourcejob_definitionsDELETEIdentifier, region
update_resourcejob_definitionsUPDATEIdentifier, PatchDocument, region
list_resourcesjob_definitions_list_onlySELECTregion
get_resourcejob_definitionsSELECTIdentifier, 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
Identifier = '{{ job_definition_name }}';

INSERT example

Use the following StackQL query and manifest file to create a new job_definition resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.batch.job_definitions (
Type,
region
)
SELECT
'{{ type }}',
'{{ region }}';

UPDATE example

Use the following StackQL query and manifest file to update a job_definition resource, using stack-deploy.

/*+ update */
UPDATE awscc.batch.job_definitions
SET PatchDocument = string('{{ {
"ContainerProperties": container_properties,
"EcsProperties": ecs_properties,
"NodeProperties": node_properties,
"SchedulingPriority": scheduling_priority,
"Parameters": parameters,
"PlatformCapabilities": platform_capabilities,
"PropagateTags": propagate_tags,
"RetryStrategy": retry_strategy,
"Timeout": timeout,
"Type": type,
"Tags": tags,
"EksProperties": eks_properties,
"ConsumableResourceProperties": consumable_resource_properties
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ job_definition_name }}';

DELETE example

/*+ delete */
DELETE FROM awscc.batch.job_definitions
WHERE
Identifier = '{{ job_definition_name }}' AND
region = 'us-east-1';

Permissions

To operate on the job_definitions resource, the following permissions are required:

Batch:RegisterJobDefinition,
Batch:TagResource,
Batch:DescribeJobDefinitions,
Iam:PassRole