custom_actions
Creates, updates, deletes, gets or lists a custom_actions resource.
Overview
| Name | custom_actions |
| Type | Resource |
| Id | aws.chatbot.custom_actions |
Fields
The following fields are returned by SELECT queries:
- get_custom_action
- list_custom_actions
| Name | Datatype | Description |
|---|---|---|
action_name | string | The name of the custom action that is included in the ARN. (pattern: <code>[a-zA-Z0-9_-]{1,64}</code>) |
alias_name | string | The name used to invoke this action in the chat channel. For example, @aws run my-alias. (pattern: <code>[A-Za-z0-9-_]+</code>) |
attachments | array | Defines when this custom action button should be attached to a notification. |
custom_action_arn | string | The fully defined Amazon Resource Name (ARN) of the custom action. (pattern: <code>arn:aws:chatbot:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:custom-action/[a-zA-Z0-9_-]{1,64}</code>) |
definition | object | The definition of the command to run when invoked as an alias or as an action button. |
| Name | Datatype | Description |
|---|---|---|
custom_action | string | A list of custom actions. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_custom_action | select | region | Returns a custom action. | |
list_custom_actions | select | region | Lists custom actions defined in this account. | |
create_custom_action | insert | region, Definition, ActionName | Creates a custom action that can be invoked as an alias or as a button on a notification. | |
update_custom_action | update | region, CustomActionArn, Definition | Updates a custom action. | |
delete_custom_action | delete | region | Deletes a custom action. |
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
- get_custom_action
- list_custom_actions
Returns a custom action.
SELECT
action_name,
alias_name,
attachments,
custom_action_arn,
definition
FROM aws.chatbot.custom_actions
WHERE region = '{{ region }}' -- required
;
Lists custom actions defined in this account.
SELECT
custom_action
FROM aws.chatbot.custom_actions
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_custom_action
- Manifest
Creates a custom action that can be invoked as an alias or as a button on a notification.
INSERT INTO aws.chatbot.custom_actions (
Definition,
AliasName,
Attachments,
Tags,
ClientToken,
ActionName,
region
)
SELECT
'{{ Definition }}' /* required */,
'{{ AliasName }}',
'{{ Attachments }}',
'{{ Tags }}',
'{{ ClientToken }}',
'{{ ActionName }}' /* required */,
'{{ region }}'
RETURNING
custom_action_arn
;
# Description fields are for documentation purposes
- name: custom_actions
props:
- name: region
value: "{{ region }}"
description: Required parameter for the custom_actions resource.
- name: Definition
description: |
The definition of the command to run when invoked as an alias or as an action button.
value:
CommandText: "{{ CommandText }}"
- name: AliasName
value: "{{ AliasName }}"
- name: Attachments
value:
- NotificationType: "{{ NotificationType }}"
ButtonText: "{{ ButtonText }}"
Criteria: "{{ Criteria }}"
Variables: "{{ Variables }}"
- name: Tags
value:
- TagKey: "{{ TagKey }}"
TagValue: "{{ TagValue }}"
- name: ClientToken
value: "{{ ClientToken }}"
- name: ActionName
value: "{{ ActionName }}"
UPDATE examples
- update_custom_action
Updates a custom action.
UPDATE aws.chatbot.custom_actions
SET
CustomActionArn = '{{ CustomActionArn }}',
Definition = '{{ Definition }}',
AliasName = '{{ AliasName }}',
Attachments = '{{ Attachments }}'
WHERE
region = '{{ region }}' --required
AND CustomActionArn = '{{ CustomActionArn }}' --required
AND Definition = '{{ Definition }}' --required
RETURNING
custom_action_arn;
DELETE examples
- delete_custom_action
Deletes a custom action.
DELETE FROM aws.chatbot.custom_actions
WHERE region = '{{ region }}' --required
;