jobs
Creates, updates, deletes, gets or lists a jobs resource.
Overview
| Name | jobs |
| Type | Resource |
| Id | aws.dataexchange.jobs |
Fields
The following fields are returned by SELECT queries:
- get_job
- list_jobs
| Name | Datatype | Description |
|---|---|---|
arn | string | The ARN for the job. |
asset_configuration | object | The configuration for the asset, including tags applied to assets created by the job. |
created_at | string (date-time) | The date and time that the job was created, in ISO 8601 format. |
details | object | Details about the job. |
errors | array | The errors associated with jobs. |
id | string | The unique identifier for the job. (pattern: <code>[a-zA-Z0-9]{30,40}</code>) |
state | string | The state of the job. (WAITING, IN_PROGRESS, ERROR, COMPLETED, CANCELLED, TIMED_OUT) |
type | string | The job type. (IMPORT_ASSETS_FROM_S3, IMPORT_ASSET_FROM_SIGNED_URL, EXPORT_ASSETS_TO_S3, EXPORT_ASSET_TO_SIGNED_URL, EXPORT_REVISIONS_TO_S3, IMPORT_ASSETS_FROM_REDSHIFT_DATA_SHARES, IMPORT_ASSET_FROM_API_GATEWAY_API, CREATE_S3_DATA_ACCESS_FROM_S3_BUCKET, IMPORT_ASSETS_FROM_LAKE_FORMATION_TAG_POLICY) |
updated_at | string (date-time) | The date and time that the job was last updated, in ISO 8601 format. |
| Name | Datatype | Description |
|---|---|---|
arn | string | The ARN for the job. |
asset_configuration | object | The configuration for the asset, which can include tags. |
created_at | string (date-time) | The date and time that the job was created, in ISO 8601 format. |
details | object | Details of the operation to be performed by the job, such as export destination details or import source details. |
errors | array | Errors for jobs. |
id | string | The unique identifier for the job. (pattern: <code>[a-zA-Z0-9]{30,40}</code>) |
state | string | The state of the job. (WAITING, IN_PROGRESS, ERROR, COMPLETED, CANCELLED, TIMED_OUT) |
type | string | The job type. (IMPORT_ASSETS_FROM_S3, IMPORT_ASSET_FROM_SIGNED_URL, EXPORT_ASSETS_TO_S3, EXPORT_ASSET_TO_SIGNED_URL, EXPORT_REVISIONS_TO_S3, IMPORT_ASSETS_FROM_REDSHIFT_DATA_SHARES, IMPORT_ASSET_FROM_API_GATEWAY_API, CREATE_S3_DATA_ACCESS_FROM_S3_BUCKET, IMPORT_ASSETS_FROM_LAKE_FORMATION_TAG_POLICY) |
updated_at | string (date-time) | The date and time that the job was last updated, in ISO 8601 format. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_job | select | job_id, region | This operation returns information about a job. | |
list_jobs | select | region | dataSetId, maxResults, nextToken, revisionId | This operation lists your jobs sorted by CreatedAt in descending order. |
create_job | insert | region | This operation creates a job. | |
cancel_job | exec | job_id, region | This operation cancels a job. Jobs can be cancelled only when they are in the WAITING state. | |
start_job | exec | job_id, region | This operation starts a job. |
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 |
|---|---|---|
job_id | string | The unique identifier for a job. |
region | string | AWS region (default: us-east-1) |
dataSetId | string | The unique identifier for a data set. |
maxResults | integer | The maximum number of results returned by a single call. |
nextToken | string | The token value retrieved from a previous call to access the next page of results. |
revisionId | string | The unique identifier for a revision. |
SELECT examples
- get_job
- list_jobs
This operation returns information about a job.
SELECT
arn,
asset_configuration,
created_at,
details,
errors,
id,
state,
type,
updated_at
FROM aws.dataexchange.jobs
WHERE job_id = '{{ job_id }}' -- required
AND region = '{{ region }}' -- required
;
This operation lists your jobs sorted by CreatedAt in descending order.
SELECT
arn,
asset_configuration,
created_at,
details,
errors,
id,
state,
type,
updated_at
FROM aws.dataexchange.jobs
WHERE region = '{{ region }}' -- required
AND dataSetId = '{{ dataSetId }}'
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
AND revisionId = '{{ revisionId }}'
;
INSERT examples
- create_job
- Manifest
This operation creates a job.
INSERT INTO aws.dataexchange.jobs (
AssetConfiguration,
Details,
Type,
region
)
SELECT
'{{ AssetConfiguration }}',
'{{ Details }}',
'{{ Type }}',
'{{ region }}'
RETURNING
arn,
asset_configuration,
created_at,
details,
errors,
id,
state,
type,
updated_at
;
# Description fields are for documentation purposes
- name: jobs
props:
- name: region
value: "{{ region }}"
description: Required parameter for the jobs resource.
- name: AssetConfiguration
description: |
The configuration for the asset, which can include tags.
value:
Tags:
- Key: "{{ Key }}"
Value: "{{ Value }}"
- name: Details
description: |
The details for the request.
value:
ExportAssetToSignedUrl:
AssetId: "{{ AssetId }}"
DataSetId: "{{ DataSetId }}"
RevisionId: "{{ RevisionId }}"
ExportAssetsToS3:
AssetDestinations:
- AssetId: "{{ AssetId }}"
Bucket: "{{ Bucket }}"
Key: "{{ Key }}"
DataSetId: "{{ DataSetId }}"
Encryption:
KmsKeyArn: "{{ KmsKeyArn }}"
Type: "{{ Type }}"
RevisionId: "{{ RevisionId }}"
ExportRevisionsToS3:
DataSetId: "{{ DataSetId }}"
Encryption:
KmsKeyArn: "{{ KmsKeyArn }}"
Type: "{{ Type }}"
RevisionDestinations:
- Bucket: "{{ Bucket }}"
KeyPattern: "{{ KeyPattern }}"
RevisionId: "{{ RevisionId }}"
ImportAssetFromSignedUrl:
AssetName: "{{ AssetName }}"
DataSetId: "{{ DataSetId }}"
Md5Hash: "{{ Md5Hash }}"
RevisionId: "{{ RevisionId }}"
ImportAssetsFromS3:
AssetSources:
- Bucket: "{{ Bucket }}"
Key: "{{ Key }}"
DataSetId: "{{ DataSetId }}"
RevisionId: "{{ RevisionId }}"
ImportAssetsFromRedshiftDataShares:
AssetSources:
- DataShareArn: "{{ DataShareArn }}"
DataSetId: "{{ DataSetId }}"
RevisionId: "{{ RevisionId }}"
ImportAssetFromApiGatewayApi:
ApiDescription: "{{ ApiDescription }}"
ApiId: "{{ ApiId }}"
ApiKey: "{{ ApiKey }}"
ApiName: "{{ ApiName }}"
ApiSpecificationMd5Hash: "{{ ApiSpecificationMd5Hash }}"
DataSetId: "{{ DataSetId }}"
ProtocolType: "{{ ProtocolType }}"
RevisionId: "{{ RevisionId }}"
Stage: "{{ Stage }}"
CreateS3DataAccessFromS3Bucket:
AssetSource:
Bucket: "{{ Bucket }}"
KeyPrefixes:
- "{{ KeyPrefixes }}"
Keys:
- "{{ Keys }}"
KmsKeysToGrant:
- KmsKeyArn: "{{ KmsKeyArn }}"
DataSetId: "{{ DataSetId }}"
RevisionId: "{{ RevisionId }}"
ImportAssetsFromLakeFormationTagPolicy:
CatalogId: "{{ CatalogId }}"
Database:
Expression:
- TagKey: "{{ TagKey }}"
TagValues: "{{ TagValues }}"
Permissions:
- "{{ Permissions }}"
Table:
Expression:
- TagKey: "{{ TagKey }}"
TagValues: "{{ TagValues }}"
Permissions:
- "{{ Permissions }}"
RoleArn: "{{ RoleArn }}"
DataSetId: "{{ DataSetId }}"
RevisionId: "{{ RevisionId }}"
- name: Type
value: "{{ Type }}"
valid_values: ['IMPORT_ASSETS_FROM_S3', 'IMPORT_ASSET_FROM_SIGNED_URL', 'EXPORT_ASSETS_TO_S3', 'EXPORT_ASSET_TO_SIGNED_URL', 'EXPORT_REVISIONS_TO_S3', 'IMPORT_ASSETS_FROM_REDSHIFT_DATA_SHARES', 'IMPORT_ASSET_FROM_API_GATEWAY_API', 'CREATE_S3_DATA_ACCESS_FROM_S3_BUCKET', 'IMPORT_ASSETS_FROM_LAKE_FORMATION_TAG_POLICY']
Lifecycle Methods
- cancel_job
- start_job
This operation cancels a job. Jobs can be cancelled only when they are in the WAITING state.
EXEC aws.dataexchange.jobs.cancel_job
@job_id='{{ job_id }}' --required,
@region='{{ region }}' --required
;
This operation starts a job.
EXEC aws.dataexchange.jobs.start_job
@job_id='{{ job_id }}' --required,
@region='{{ region }}' --required
;