Skip to main content

triggers

Creates, updates, deletes, gets or lists a triggers resource.

Overview

Nametriggers
TypeResource
Idaws.glue.triggers

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
triggersarrayA list of trigger definitions.
triggers_not_foundarrayA list of names of triggers not found.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
batch_get_triggersselectregionReturns a list of resource metadata for a given list of trigger names. After calling the ListTriggers operation, you can call this operation to access the data to which you have been granted permissions. This operation supports all IAM permissions, including permission conditions that uses tags.
get_triggerselectregionRetrieves the definition of a trigger.
create_triggerinsertregionCreates a new trigger. Job arguments may be logged. Do not pass plaintext secrets as arguments. Retrieve secrets from a Glue Connection, Amazon Web Services Secrets Manager or other secret management mechanism if you intend to keep them within the Job.
update_triggerupdateregion, TriggerUpdateUpdates a trigger definition. Job arguments may be logged. Do not pass plaintext secrets as arguments. Retrieve secrets from a Glue Connection, Amazon Web Services Secrets Manager or other secret management mechanism if you intend to keep them within the Job.
delete_triggerdeleteregionDeletes a specified trigger. If the trigger is not found, no exception is thrown.
get_triggersexecregionGets all the triggers associated with a job.
list_triggersexecregionRetrieves the names of all trigger resources in this Amazon Web Services account, or the resources with the specified tag. This operation allows you to see which resources are available in your account, and their names. This operation takes the optional Tags field, which you can use as a filter on the response so that tagged resources can be retrieved as a group. If you choose to use tags filtering, only resources with the tag are retrieved.

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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Returns a list of resource metadata for a given list of trigger names. After calling the ListTriggers operation, you can call this operation to access the data to which you have been granted permissions. This operation supports all IAM permissions, including permission conditions that uses tags.

SELECT
triggers,
triggers_not_found
FROM aws.glue.triggers
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a new trigger. Job arguments may be logged. Do not pass plaintext secrets as arguments. Retrieve secrets from a Glue Connection, Amazon Web Services Secrets Manager or other secret management mechanism if you intend to keep them within the Job.

INSERT INTO aws.glue.triggers (
Name,
WorkflowName,
Type,
Schedule,
Predicate,
Actions,
Description,
StartOnCreation,
Tags,
EventBatchingCondition,
region
)
SELECT
'{{ Name }}',
'{{ WorkflowName }}',
'{{ Type }}',
'{{ Schedule }}',
'{{ Predicate }}',
'{{ Actions }}',
'{{ Description }}',
{{ StartOnCreation }},
'{{ Tags }}',
'{{ EventBatchingCondition }}',
'{{ region }}'
RETURNING
name
;

UPDATE examples

Updates a trigger definition. Job arguments may be logged. Do not pass plaintext secrets as arguments. Retrieve secrets from a Glue Connection, Amazon Web Services Secrets Manager or other secret management mechanism if you intend to keep them within the Job.

UPDATE aws.glue.triggers
SET
Name = '{{ Name }}',
TriggerUpdate = '{{ TriggerUpdate }}'
WHERE
region = '{{ region }}' --required
AND TriggerUpdate = '{{ TriggerUpdate }}' --required
RETURNING
trigger;

DELETE examples

Deletes a specified trigger. If the trigger is not found, no exception is thrown.

DELETE FROM aws.glue.triggers
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

Gets all the triggers associated with a job.

EXEC aws.glue.triggers.get_triggers
@region='{{ region }}' --required
@@json=
'{
"NextToken": "{{ NextToken }}",
"DependentJobName": "{{ DependentJobName }}",
"MaxResults": {{ MaxResults }}
}'
;