job_templates
Creates, updates, deletes, gets or lists a job_templates resource.
Overview
| Name | job_templates |
| Type | Resource |
| Id | aws.emr_containers.job_templates |
Fields
The following fields are returned by SELECT queries:
- describe_job_template
- list_job_templates
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the job template. (pattern: <code>[0-9a-z]+</code>) |
name | string | The name of the job template. (pattern: <code>[.-_/#A-Za-z0-9]+</code>) |
arn | string | The ARN of the job template. (pattern: <code>^arn:(aws[a-zA-Z0-9-]*):emr-containers:.+:(\d{12}):/jobtemplates/[0-9a-zA-Z]+$</code>) |
created_at | string (date-time) | The date and time when the job template was created. |
created_by | string | The user who created the job template. (pattern: <code>^arn:(aws[a-zA-Z0-9-]*):(iam|sts)::(\d{12})?:[\w/+=,.@-]+$</code>) |
decryption_error | string | The error message in case the decryption of job template fails. (pattern: <code>.\S.</code>) |
job_template_data | object | The values of StartJobRun API requests used in job runs started using the job template. |
kms_key_arn | string | The KMS key ARN used to encrypt the job template. (pattern: <code>^(arn:(aws[a-zA-Z0-9-]):kms:.+:(\d{12})?:key/[(0-9a-zA-Z)-?]+|${[a-zA-Z]\w})$</code>) |
tags | object | The tags assigned to the job template. |
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the job template. (pattern: <code>[0-9a-z]+</code>) |
name | string | The name of the job template. (pattern: <code>[.-_/#A-Za-z0-9]+</code>) |
arn | string | The ARN of the job template. (pattern: <code>^arn:(aws[a-zA-Z0-9-]*):emr-containers:.+:(\d{12}):/jobtemplates/[0-9a-zA-Z]+$</code>) |
created_at | string (date-time) | The date and time when the job template was created. |
created_by | string | The user who created the job template. (pattern: <code>^arn:(aws[a-zA-Z0-9-]*):(iam|sts)::(\d{12})?:[\w/+=,.@-]+$</code>) |
decryption_error | string | The error message in case the decryption of job template fails. (pattern: <code>.\S.</code>) |
job_template_data | object | The values of StartJobRun API requests used in job runs started using the job template. |
kms_key_arn | string | The KMS key ARN used to encrypt the job template. (pattern: <code>^(arn:(aws[a-zA-Z0-9-]):kms:.+:(\d{12})?:key/[(0-9a-zA-Z)-?]+|${[a-zA-Z]\w})$</code>) |
tags | object | The tags assigned to the job template. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_job_template | select | template_id, region | Displays detailed information about a specified job template. Job template stores values of StartJobRun API request in a template and can be used to start a job run. Job template allows two use cases: avoid repeating recurring StartJobRun API request values, enforcing certain values in StartJobRun API request. | |
list_job_templates | select | region | createdAfter, createdBefore, maxResults, nextToken | Lists job templates based on a set of parameters. Job template stores values of StartJobRun API request in a template and can be used to start a job run. Job template allows two use cases: avoid repeating recurring StartJobRun API request values, enforcing certain values in StartJobRun API request. |
create_job_template | insert | region, name, clientToken, jobTemplateData | Creates a job template. Job template stores values of StartJobRun API request in a template and can be used to start a job run. Job template allows two use cases: avoid repeating recurring StartJobRun API request values, enforcing certain values in StartJobRun API request. | |
delete_job_template | delete | template_id, region | Deletes a job template. Job template stores values of StartJobRun API request in a template and can be used to start a job run. Job template allows two use cases: avoid repeating recurring StartJobRun API request values, enforcing certain values in StartJobRun API request. |
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) |
template_id | string | The ID of the job template that will be deleted. |
createdAfter | string (date-time) | The date and time after which the job templates were created. |
createdBefore | string (date-time) | The date and time before which the job templates were created. |
maxResults | integer | The maximum number of job templates that can be listed. |
nextToken | string | The token for the next set of job templates to return. |
SELECT examples
- describe_job_template
- list_job_templates
Displays detailed information about a specified job template. Job template stores values of StartJobRun API request in a template and can be used to start a job run. Job template allows two use cases: avoid repeating recurring StartJobRun API request values, enforcing certain values in StartJobRun API request.
SELECT
id,
name,
arn,
created_at,
created_by,
decryption_error,
job_template_data,
kms_key_arn,
tags
FROM aws.emr_containers.job_templates
WHERE template_id = '{{ template_id }}' -- required
AND region = '{{ region }}' -- required
;
Lists job templates based on a set of parameters. Job template stores values of StartJobRun API request in a template and can be used to start a job run. Job template allows two use cases: avoid repeating recurring StartJobRun API request values, enforcing certain values in StartJobRun API request.
SELECT
id,
name,
arn,
created_at,
created_by,
decryption_error,
job_template_data,
kms_key_arn,
tags
FROM aws.emr_containers.job_templates
WHERE region = '{{ region }}' -- required
AND createdAfter = '{{ createdAfter }}'
AND createdBefore = '{{ createdBefore }}'
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
INSERT examples
- create_job_template
- Manifest
Creates a job template. Job template stores values of StartJobRun API request in a template and can be used to start a job run. Job template allows two use cases: avoid repeating recurring StartJobRun API request values, enforcing certain values in StartJobRun API request.
INSERT INTO aws.emr_containers.job_templates (
name,
clientToken,
jobTemplateData,
tags,
kmsKeyArn,
region
)
SELECT
'{{ name }}' /* required */,
'{{ clientToken }}' /* required */,
'{{ jobTemplateData }}' /* required */,
'{{ tags }}',
'{{ kmsKeyArn }}',
'{{ region }}'
RETURNING
id,
name,
arn,
created_at
;
# Description fields are for documentation purposes
- name: job_templates
props:
- name: region
value: "{{ region }}"
description: Required parameter for the job_templates resource.
- name: name
value: "{{ name }}"
- name: clientToken
value: "{{ clientToken }}"
- name: jobTemplateData
description: |
The values of StartJobRun API requests used in job runs started using the job template.
value:
executionRoleArn: "{{ executionRoleArn }}"
releaseLabel: "{{ releaseLabel }}"
configurationOverrides:
applicationConfiguration:
- classification: "{{ classification }}"
properties_: "{{ properties_ }}"
configurations: "{{ configurations }}"
monitoringConfiguration:
persistentAppUI: "{{ persistentAppUI }}"
cloudWatchMonitoringConfiguration:
logGroupName: "{{ logGroupName }}"
logStreamNamePrefix: "{{ logStreamNamePrefix }}"
s3MonitoringConfiguration:
logUri: "{{ logUri }}"
jobDriver:
sparkSubmitJobDriver:
entryPoint: "{{ entryPoint }}"
entryPointArguments:
- "{{ entryPointArguments }}"
sparkSubmitParameters: "{{ sparkSubmitParameters }}"
sparkSqlJobDriver:
entryPoint: "{{ entryPoint }}"
sparkSqlParameters: "{{ sparkSqlParameters }}"
parameterConfiguration: "{{ parameterConfiguration }}"
jobTags: "{{ jobTags }}"
- name: tags
value: "{{ tags }}"
- name: kmsKeyArn
value: "{{ kmsKeyArn }}"
DELETE examples
- delete_job_template
Deletes a job template. Job template stores values of StartJobRun API request in a template and can be used to start a job run. Job template allows two use cases: avoid repeating recurring StartJobRun API request values, enforcing certain values in StartJobRun API request.
DELETE FROM aws.emr_containers.job_templates
WHERE template_id = '{{ template_id }}' --required
AND region = '{{ region }}' --required
;