triggers
Creates, updates, deletes, gets or lists a triggers resource.
Overview
| Name | triggers |
| Type | Resource |
| Id | aws.glue.triggers |
Fields
The following fields are returned by SELECT queries:
- batch_get_triggers
- get_trigger
| Name | Datatype | Description |
|---|---|---|
triggers | array | A list of trigger definitions. |
triggers_not_found | array | A list of names of triggers not found. |
| Name | Datatype | Description |
|---|---|---|
actions | array | The actions initiated by this trigger. |
description | string | A description of this trigger. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>) |
event_batching_condition | object | Batch condition that must be met (specified number of events received or batch time window expired) before EventBridge event trigger fires. |
id | string | Reserved for future use. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>) |
name | string | The name of the trigger. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>) |
predicate | object | The predicate of this trigger, which defines when it will fire. |
schedule | string | A cron expression used to specify the schedule (see Time-Based Schedules for Jobs and Crawlers. For example, to run something every day at 12:15 UTC, you would specify: cron(15 12 * * ? *). |
state | string | The current state of the trigger. (CREATING, CREATED, ACTIVATING, ACTIVATED, DEACTIVATING, DEACTIVATED, DELETING, UPDATING) |
type | string | The type of trigger that this is. (SCHEDULED, CONDITIONAL, ON_DEMAND, EVENT) |
workflow_name | string | The name of the workflow associated with the trigger. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
batch_get_triggers | select | region | 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. | |
get_trigger | select | region | Retrieves the definition of a trigger. | |
create_trigger | insert | region | 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. | |
update_trigger | update | region, TriggerUpdate | 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. | |
delete_trigger | delete | region | Deletes a specified trigger. If the trigger is not found, no exception is thrown. | |
get_triggers | exec | region | Gets all the triggers associated with a job. | |
list_triggers | exec | region | Retrieves 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- batch_get_triggers
- get_trigger
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
;
Retrieves the definition of a trigger.
SELECT
actions,
description,
event_batching_condition,
id,
name,
predicate,
schedule,
state,
type,
workflow_name
FROM aws.glue.triggers
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_trigger
- Manifest
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
;
# Description fields are for documentation purposes
- name: triggers
props:
- name: region
value: "{{ region }}"
description: Required parameter for the triggers resource.
- name: Name
value: "{{ Name }}"
description: |
The name of the trigger.
- name: WorkflowName
value: "{{ WorkflowName }}"
description: |
The name of the workflow associated with the trigger.
- name: Type
value: "{{ Type }}"
description: |
The type of the new trigger.
valid_values: ['SCHEDULED', 'CONDITIONAL', 'ON_DEMAND', 'EVENT']
- name: Schedule
value: "{{ Schedule }}"
description: |
A cron expression used to specify the schedule (see Time-Based Schedules for Jobs and Crawlers. For example, to run something every day at 12:15 UTC, you would specify: cron(15 12 * * ? *). This field is required when the trigger type is SCHEDULED.
- name: Predicate
description: |
A predicate to specify when the new trigger should fire. This field is required when the trigger type is CONDITIONAL.
value:
Logical: "{{ Logical }}"
Conditions:
- LogicalOperator: "{{ LogicalOperator }}"
JobName: "{{ JobName }}"
State: "{{ State }}"
CrawlerName: "{{ CrawlerName }}"
CrawlState: "{{ CrawlState }}"
- name: Actions
description: |
The actions initiated by this trigger when it fires.
value:
- JobName: "{{ JobName }}"
Arguments: "{{ Arguments }}"
Timeout: {{ Timeout }}
SecurityConfiguration: "{{ SecurityConfiguration }}"
NotificationProperty:
NotifyDelayAfter: {{ NotifyDelayAfter }}
CrawlerName: "{{ CrawlerName }}"
- name: Description
value: "{{ Description }}"
description: |
A description of the new trigger.
- name: StartOnCreation
value: {{ StartOnCreation }}
description: |
Set to true to start SCHEDULED and CONDITIONAL triggers when created. True is not supported for ON_DEMAND triggers.
- name: Tags
value: "{{ Tags }}"
description: |
The tags to use with this trigger. You may use tags to limit access to the trigger. For more information about tags in Glue, see Amazon Web Services Tags in Glue in the developer guide.
- name: EventBatchingCondition
description: |
Batch condition that must be met (specified number of events received or batch time window expired) before EventBridge event trigger fires.
value:
BatchSize: {{ BatchSize }}
BatchWindow: {{ BatchWindow }}
UPDATE examples
- update_trigger
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
- delete_trigger
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
- get_triggers
- list_triggers
Gets all the triggers associated with a job.
EXEC aws.glue.triggers.get_triggers
@region='{{ region }}' --required
@@json=
'{
"NextToken": "{{ NextToken }}",
"DependentJobName": "{{ DependentJobName }}",
"MaxResults": {{ MaxResults }}
}'
;
Retrieves 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.
EXEC aws.glue.triggers.list_triggers
@region='{{ region }}' --required
@@json=
'{
"NextToken": "{{ NextToken }}",
"DependentJobName": "{{ DependentJobName }}",
"MaxResults": {{ MaxResults }},
"Tags": "{{ Tags }}"
}'
;