Skip to main content

rules

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

Overview

Namerules
TypeResource
Idaws.connect.rules

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
actionsarrayA list of actions to be run when the rule is triggered.
created_timestring (date-time)The timestamp for when the rule was created.
functionstringThe conditions of the rule.
last_updated_bystringThe Amazon Resource Name (ARN) of the user who last updated the rule.
last_updated_timestring (date-time)The timestamp for the when the rule was last updated.
namestringThe name of the rule. (pattern: <code>^[0-9a-zA-Z._-]+</code>)
publish_statusstringThe publish status of the rule. (DRAFT, PUBLISHED)
rule_arnstringThe Amazon Resource Name (ARN) of the rule.
rule_capability_tiersarrayThe list of capability tiers associated with the rule. Used for categorizing rules by capability (for example, GenerativeAI).
rule_idstringA unique identifier for the rule.
tagsobjectThe tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.
trigger_event_sourceobjectThe 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:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_ruleselectinstance_id, rule_id, regionDescribes a rule for the specified Connect Customer instance.
list_rulesselectinstance_id, regionpublishStatus, eventSourceName, maxResults, nextTokenList all rules for the specified Connect Customer instance.
search_rulesselectregionSearches rules in an Connect Customer instance, with optional filtering.
create_ruleinsertinstance_id, region, TriggerEventSource, Function, Actions, PublishStatusCreates a rule for the specified Connect Customer instance. Use the Rules Function language to code conditions for the rule.
update_ruleupdaterule_id, instance_id, region, Function, Actions, PublishStatusUpdates a rule for the specified Connect Customer instance. Use the Rules Function language to code conditions for the rule.
delete_ruledeleteinstance_id, rule_id, regionDeletes 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.

NameDatatypeDescription
instance_idstringThe identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.
regionstringAWS region (default: us-east-1)
rule_idstringA unique identifier for the rule.
eventSourceNamestringThe name of the event source.
maxResultsintegerThe maximum number of results to return per page.
nextTokenstringThe 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.
publishStatusstringThe publish status of the rule.

SELECT examples

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
;

INSERT examples

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
;

UPDATE examples

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

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
;