Skip to main content

rules

Creates, updates, deletes or gets a rule resource or lists rules in a region

Overview

Namerules
TypeResource
DescriptionCreates a rule for the specified CON instance.
Idawscc.connect.rules

Fields

NameDatatypeDescription
namestringThe name of the rule.
rule_arnstring
instance_arnstringThe Amazon Resource Name (ARN) of the instance.
trigger_event_sourceobjectThe event source to trigger the rule.
functionstringThe conditions of the rule.
actionsobjectA list of actions to be run when the rule is triggered.
publish_statusstringThe publish status of the rule.<br />&#42;Allowed values&#42;: &#96;&#96;DRAFT&#96;&#96; &#124; &#96;&#96;PUBLISHED&#96;&#96;
tagsarrayThe tags used to organize, track, or control access for this resource. For example, &#123; "tags": &#123;"key1":"value1", "key2":"value2"&#125; &#125;.
regionstringAWS region.

For more information, see AWS::Connect::Rule.

Methods

NameAccessible byRequired Params
create_resourceINSERTName, InstanceArn, TriggerEventSource, Function, Actions, PublishStatus, region
delete_resourceDELETEIdentifier, region
update_resourceUPDATEIdentifier, PatchDocument, region
get_resourceSELECTIdentifier, region

SELECT examples

Gets all properties from an individual rule.

SELECT
region,
name,
rule_arn,
instance_arn,
trigger_event_source,
function,
actions,
publish_status,
tags
FROM awscc.connect.rules
WHERE
region = 'us-east-1' AND
Identifier = '{{ rule_arn }}';

INSERT example

Use the following StackQL query and manifest file to create a new rule resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.connect.rules (
Name,
InstanceArn,
TriggerEventSource,
Function,
Actions,
PublishStatus,
region
)
SELECT
'{{ name }}',
'{{ instance_arn }}',
'{{ trigger_event_source }}',
'{{ function }}',
'{{ actions }}',
'{{ publish_status }}',
'{{ region }}';

UPDATE example

Use the following StackQL query and manifest file to update a rule resource, using stack-deploy.

/*+ update */
UPDATE awscc.connect.rules
SET PatchDocument = string('{{ {
"Name": name,
"Function": function,
"Actions": actions,
"PublishStatus": publish_status,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ rule_arn }}';

DELETE example

/*+ delete */
DELETE FROM awscc.connect.rules
WHERE
Identifier = '{{ rule_arn }}' AND
region = 'us-east-1';

Permissions

To operate on the rules resource, the following permissions are required:

connect:CreateRule,
cases:GetTemplate,
cases:ListFields,
cases:ListFieldOptions