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 = '{{ region }}' 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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.batch.job_definitions
WHERE
Identifier = '{{ job_definition_name }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

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

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