rules
Creates, updates, deletes, gets or lists a rules resource.
Overview
| Name | rules |
| Type | Resource |
| Id | aws.connect.rules |
Fields
The following fields are returned by SELECT queries:
- describe_rule
- list_rules
- search_rules
| Name | Datatype | Description |
|---|---|---|
actions | array | A list of actions to be run when the rule is triggered. |
created_time | string (date-time) | The timestamp for when the rule was created. |
function | string | The conditions of the rule. |
last_updated_by | string | The Amazon Resource Name (ARN) of the user who last updated the rule. |
last_updated_time | string (date-time) | The timestamp for the when the rule was last updated. |
name | string | The name of the rule. (pattern: <code>^[0-9a-zA-Z._-]+</code>) |
publish_status | string | The publish status of the rule. (DRAFT, PUBLISHED) |
rule_arn | string | The Amazon Resource Name (ARN) of the rule. |
rule_capability_tiers | array | The list of capability tiers associated with the rule. Used for categorizing rules by capability (for example, GenerativeAI). |
rule_id | string | A unique identifier for the rule. |
tags | object | The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }. |
trigger_event_source | object | The name of the event source. This field is required if TriggerEventSource is one of the following values: OnZendeskTicketCreate | OnZendeskTicketStatusUpdate | OnSalesforceCaseCreate | OnContactEvaluationSubmit | OnMetricDataUpdate. |
| Name | Datatype | Description |
|---|---|---|
action_summaries | array | A list of ActionTypes associated with a rule. |
created_time | string (date-time) | The timestamp for when the rule was created. |
event_source_name | string | The name of the event source. (OnPostCallAnalysisAvailable, OnRealTimeCallAnalysisAvailable, OnRealTimeChatAnalysisAvailable, OnPostChatAnalysisAvailable, OnAfterCallWorkAvailable, OnAfterChatWorkAvailable, OnEmailAnalysisAvailable, OnZendeskTicketCreate, OnZendeskTicketStatusUpdate, OnSalesforceCaseCreate, OnContactEvaluationSubmit, OnMetricDataUpdate, OnCaseCreate, OnCaseUpdate, OnSlaBreach, OnAlertUpdate, OnSchedulePublish, OnScheduleUpdate, OnScheduleTimeOffRequestActivity) |
last_updated_time | string (date-time) | The timestamp for when the rule was last updated. |
name | string | The name of the rule. (pattern: <code>^[0-9a-zA-Z._-]+</code>) |
publish_status | string | The publish status of the rule. (DRAFT, PUBLISHED) |
rule_arn | string | The Amazon Resource Name (ARN) of the rule. |
rule_capability_tiers | array | The list of capability tiers associated with the rule. Used for categorizing rules by capability (for example, GenerativeAI). |
rule_id | string | A unique identifier for the rule. |
| Name | Datatype | Description |
|---|---|---|
action_summaries | array | A list of ActionTypes associated with a rule. |
created_time | string (date-time) | The timestamp for when the rule was created. |
last_updated_by | string | The Amazon Resource Name (ARN) of the user who last updated the rule. |
last_updated_time | string (date-time) | The timestamp for when the rule was last updated. |
name | string | The name of the rule. (pattern: <code>^[0-9a-zA-Z._-]+</code>) |
publish_status | string | The publish status of the rule. (DRAFT, PUBLISHED) |
rule_arn | string | The Amazon Resource Name (ARN) of the rule. |
rule_capability_tiers | array | The list of capability tiers associated with the rule. Used for categorizing rules by capability (for example, GenerativeAI). |
rule_id | string | A unique identifier for the rule. |
tags | object | The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }. |
trigger_event_source | object | The name of the event source. This field is required if TriggerEventSource is one of the following values: OnZendeskTicketCreate | OnZendeskTicketStatusUpdate | OnSalesforceCaseCreate | OnContactEvaluationSubmit | OnMetricDataUpdate. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_rule | select | instance_id, rule_id, region | Describes a rule for the specified Connect Customer instance. | |
list_rules | select | instance_id, region | publishStatus, eventSourceName, maxResults, nextToken | List all rules for the specified Connect Customer instance. |
search_rules | select | region | Searches rules in an Connect Customer instance, with optional filtering. | |
create_rule | insert | instance_id, region, TriggerEventSource, Function, Actions, PublishStatus | Creates a rule for the specified Connect Customer instance. Use the Rules Function language to code conditions for the rule. | |
update_rule | update | rule_id, instance_id, region, Function, Actions, PublishStatus | Updates a rule for the specified Connect Customer instance. Use the Rules Function language to code conditions for the rule. | |
delete_rule | delete | instance_id, rule_id, region | Deletes a rule for the specified Connect Customer instance. |
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 |
|---|---|---|
instance_id | string | The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance. |
region | string | AWS region (default: us-east-1) |
rule_id | string | A unique identifier for the rule. |
eventSourceName | string | The name of the event source. |
maxResults | integer | The maximum number of results to return per page. |
nextToken | string | The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results. |
publishStatus | string | The publish status of the rule. |
SELECT examples
- describe_rule
- list_rules
- search_rules
Describes a rule for the specified Connect Customer instance.
SELECT
actions,
created_time,
function,
last_updated_by,
last_updated_time,
name,
publish_status,
rule_arn,
rule_capability_tiers,
rule_id,
tags,
trigger_event_source
FROM aws.connect.rules
WHERE instance_id = '{{ instance_id }}' -- required
AND rule_id = '{{ rule_id }}' -- required
AND region = '{{ region }}' -- required
;
List all rules for the specified Connect Customer instance.
SELECT
action_summaries,
created_time,
event_source_name,
last_updated_time,
name,
publish_status,
rule_arn,
rule_capability_tiers,
rule_id
FROM aws.connect.rules
WHERE instance_id = '{{ instance_id }}' -- required
AND region = '{{ region }}' -- required
AND publishStatus = '{{ publishStatus }}'
AND eventSourceName = '{{ eventSourceName }}'
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
Searches rules in an Connect Customer instance, with optional filtering.
SELECT
action_summaries,
created_time,
last_updated_by,
last_updated_time,
name,
publish_status,
rule_arn,
rule_capability_tiers,
rule_id,
tags,
trigger_event_source
FROM aws.connect.rules
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_rule
- Manifest
Creates a rule for the specified Connect Customer instance. Use the Rules Function language to code conditions for the rule.
INSERT INTO aws.connect.rules (
Name,
TriggerEventSource,
Function,
Actions,
PublishStatus,
ClientToken,
instance_id,
region
)
SELECT
'{{ Name }}',
'{{ TriggerEventSource }}' /* required */,
'{{ Function }}' /* required */,
'{{ Actions }}' /* required */,
'{{ PublishStatus }}' /* required */,
'{{ ClientToken }}',
'{{ instance_id }}',
'{{ region }}'
RETURNING
rule_arn,
rule_id
;
# Description fields are for documentation purposes
- name: rules
props:
- name: instance_id
value: "{{ instance_id }}"
description: Required parameter for the rules resource.
- name: region
value: "{{ region }}"
description: Required parameter for the rules resource.
- name: Name
value: "{{ Name }}"
- name: TriggerEventSource
description: |
The name of the event source. This field is required if TriggerEventSource is one of the following values: OnZendeskTicketCreate | OnZendeskTicketStatusUpdate | OnSalesforceCaseCreate | OnContactEvaluationSubmit | OnMetricDataUpdate.
value:
EventSourceName: "{{ EventSourceName }}"
IntegrationAssociationId: "{{ IntegrationAssociationId }}"
- name: Function
value: "{{ Function }}"
- name: Actions
value:
- ActionType: "{{ ActionType }}"
TaskAction:
Name: "{{ Name }}"
Description: "{{ Description }}"
ContactFlowId: "{{ ContactFlowId }}"
References: "{{ References }}"
EventBridgeAction:
Name: "{{ Name }}"
AssignContactCategoryAction: "{{ AssignContactCategoryAction }}"
SendNotificationAction:
DeliveryMethod: "{{ DeliveryMethod }}"
Subject: "{{ Subject }}"
Content: "{{ Content }}"
ContentType: "{{ ContentType }}"
Recipient:
UserTags: "{{ UserTags }}"
UserIds:
- "{{ UserIds }}"
Exclusion:
UserTags: "{{ UserTags }}"
UserIds:
- "{{ UserIds }}"
CreateCaseAction:
Fields:
- Id: "{{ Id }}"
Value:
BooleanValue: {{ BooleanValue }}
DoubleValue: {{ DoubleValue }}
EmptyValue: "{{ EmptyValue }}"
StringValue: "{{ StringValue }}"
TemplateId: "{{ TemplateId }}"
UpdateCaseAction:
Fields:
- Id: "{{ Id }}"
Value:
BooleanValue: {{ BooleanValue }}
DoubleValue: {{ DoubleValue }}
EmptyValue: "{{ EmptyValue }}"
StringValue: "{{ StringValue }}"
AssignSlaAction:
SlaAssignmentType: "{{ SlaAssignmentType }}"
CaseSlaConfiguration:
Name: "{{ Name }}"
Type: "{{ Type }}"
FieldId: "{{ FieldId }}"
TargetFieldValues:
- BooleanValue: {{ BooleanValue }}
DoubleValue: {{ DoubleValue }}
EmptyValue: "{{ EmptyValue }}"
StringValue: "{{ StringValue }}"
TargetSlaMinutes: {{ TargetSlaMinutes }}
EndAssociatedTasksAction: "{{ EndAssociatedTasksAction }}"
SubmitAutoEvaluationAction:
EvaluationFormId: "{{ EvaluationFormId }}"
ExtractInformationAction:
RulesExtractionDefinitions:
- Identifier: "{{ Identifier }}"
- name: PublishStatus
value: "{{ PublishStatus }}"
valid_values: ['DRAFT', 'PUBLISHED']
- name: ClientToken
value: "{{ ClientToken }}"
UPDATE examples
- update_rule
Updates a rule for the specified Connect Customer instance. Use the Rules Function language to code conditions for the rule.
UPDATE aws.connect.rules
SET
Name = '{{ Name }}',
Function = '{{ Function }}',
Actions = '{{ Actions }}',
PublishStatus = '{{ PublishStatus }}'
WHERE
rule_id = '{{ rule_id }}' --required
AND instance_id = '{{ instance_id }}' --required
AND region = '{{ region }}' --required
AND Function = '{{ Function }}' --required
AND Actions = '{{ Actions }}' --required
AND PublishStatus = '{{ PublishStatus }}' --required;
DELETE examples
- delete_rule
Deletes a rule for the specified Connect Customer instance.
DELETE FROM aws.connect.rules
WHERE instance_id = '{{ instance_id }}' --required
AND rule_id = '{{ rule_id }}' --required
AND region = '{{ region }}' --required
;