triggers
Creates, updates, deletes, gets or lists a triggers resource.
Overview
| Name | triggers |
| Type | Resource |
| Id | aws.devops_agent.triggers |
Fields
The following fields are returned by SELECT queries:
- get_trigger
- list_triggers
| Name | Datatype | Description |
|---|---|---|
action | object | Action a Trigger performs when it fires |
agent_space_id | string | Unique identifier for an agent space (allows alphanumeric characters and hyphens; 1-64 characters) (pattern: <code>[a-zA-Z0-9-]{1,64}</code>) |
condition | object | Defines the firing condition for a Trigger |
created_at | string (date-time) | Timestamp when this Trigger was created |
status | string | The status of a Trigger |
trigger_id | string | Generic resource identifier (allows alphanumeric characters, hyphens, and underscores; 1-128 characters) (pattern: <code>[a-zA-Z0-9_.-]+</code>) |
type_ | string | How a Trigger is fired |
updated_at | string (date-time) | Timestamp when this Trigger was last updated |
| Name | Datatype | Description |
|---|---|---|
action | object | Action a Trigger performs when it fires |
agent_space_id | string | Unique identifier for an agent space (allows alphanumeric characters and hyphens; 1-64 characters) (pattern: <code>[a-zA-Z0-9-]{1,64}</code>) |
condition | object | Defines the firing condition for a Trigger |
created_at | string (date-time) | Timestamp when this Trigger was created |
status | string | The status of a Trigger |
trigger_id | string | Generic resource identifier (allows alphanumeric characters, hyphens, and underscores; 1-128 characters) (pattern: <code>[a-zA-Z0-9_.-]+</code>) |
type_ | string | How a Trigger is fired |
updated_at | string (date-time) | Timestamp when this Trigger was last updated |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_trigger | select | agent_space_id, trigger_id, region | Gets a Trigger from the specified agent space | |
list_triggers | select | agent_space_id, region | status, nextToken, maxResults | Lists Triggers in the specified agent space |
create_trigger | insert | agent_space_id, region, type, condition, action | Creates a new Trigger in the specified agent space | |
update_trigger | update | agent_space_id, trigger_id, region | Updates the status of an existing Trigger | |
delete_trigger | delete | agent_space_id, trigger_id, region | Deletes a Trigger from the specified agent space |
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 |
|---|---|---|
agent_space_id | string | The unique identifier for the agent space containing the Trigger |
region | string | AWS region (default: us-east-1) |
trigger_id | string | The unique identifier of the Trigger to delete |
maxResults | integer | The maximum number of results to return in a single response |
nextToken | string | Pagination token from a previous response to retrieve the next page of results |
status | string | Filter results to Triggers in this status |
SELECT examples
- get_trigger
- list_triggers
Gets a Trigger from the specified agent space
SELECT
action,
agent_space_id,
condition,
created_at,
status,
trigger_id,
type_,
updated_at
FROM aws.devops_agent.triggers
WHERE agent_space_id = '{{ agent_space_id }}' -- required
AND trigger_id = '{{ trigger_id }}' -- required
AND region = '{{ region }}' -- required
;
Lists Triggers in the specified agent space
SELECT
action,
agent_space_id,
condition,
created_at,
status,
trigger_id,
type_,
updated_at
FROM aws.devops_agent.triggers
WHERE agent_space_id = '{{ agent_space_id }}' -- required
AND region = '{{ region }}' -- required
AND status = '{{ status }}'
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;
INSERT examples
- create_trigger
- Manifest
Creates a new Trigger in the specified agent space
INSERT INTO aws.devops_agent.triggers (
type,
condition,
action,
status,
clientToken,
agent_space_id,
region
)
SELECT
'{{ type }}' /* required */,
'{{ condition }}' /* required */,
'{{ action }}' /* required */,
'{{ status }}',
'{{ clientToken }}',
'{{ agent_space_id }}',
'{{ region }}'
RETURNING
trigger
;
# Description fields are for documentation purposes
- name: triggers
props:
- name: agent_space_id
value: "{{ agent_space_id }}"
description: Required parameter for the triggers resource.
- name: region
value: "{{ region }}"
description: Required parameter for the triggers resource.
- name: type
value: "{{ type }}"
description: |
How a Trigger is fired
- name: condition
description: |
Defines the firing condition for a Trigger
value:
schedule:
expression: "{{ expression }}"
- name: action
value: "{{ action }}"
description: |
Action a Trigger performs when it fires
- name: status
value: "{{ status }}"
description: |
The status of a Trigger
- name: clientToken
value: "{{ clientToken }}"
UPDATE examples
- update_trigger
Updates the status of an existing Trigger
UPDATE aws.devops_agent.triggers
SET
status = '{{ status }}',
clientToken = '{{ clientToken }}'
WHERE
agent_space_id = '{{ agent_space_id }}' --required
AND trigger_id = '{{ trigger_id }}' --required
AND region = '{{ region }}' --required
RETURNING
trigger;
DELETE examples
- delete_trigger
Deletes a Trigger from the specified agent space
DELETE FROM aws.devops_agent.triggers
WHERE agent_space_id = '{{ agent_space_id }}' --required
AND trigger_id = '{{ trigger_id }}' --required
AND region = '{{ region }}' --required
;