rules
Creates, updates, deletes or gets a rule
resource or lists rules
in a region
Overview
Name | rules |
Type | Resource |
Description | Resource Type definition for AWS:Connect::Rule |
Id | aws.connect.rules |
Fields
Name | Datatype | Description |
---|---|---|
name | string | The name of the rule. |
rule_arn | string | The Amazon Resource Name (ARN) of the rule. |
instance_arn | string | The Amazon Resource Name (ARN) of the instance. |
trigger_event_source | object | The event source that triggers the rule. |
function | string | The conditions of a rule. |
actions | object | The list of actions that will be executed when a rule is triggered. |
publish_status | string | The publish status of a rule, either draft or published. |
tags | array | One or more tags. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | Name, InstanceArn, TriggerEventSource, Function, Actions, PublishStatus, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
get_resource | SELECT | data__Identifier, 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 aws.connect.rules
WHERE region = 'us-east-1' AND data__Identifier = '<RuleArn>';
INSERT
example
Use the following StackQL query and manifest file to create a new rule
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.connect.rules (
Name,
InstanceArn,
TriggerEventSource,
Function,
Actions,
PublishStatus,
region
)
SELECT
'{{ Name }}',
'{{ InstanceArn }}',
'{{ TriggerEventSource }}',
'{{ Function }}',
'{{ Actions }}',
'{{ PublishStatus }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.connect.rules (
Name,
InstanceArn,
TriggerEventSource,
Function,
Actions,
PublishStatus,
Tags,
region
)
SELECT
'{{ Name }}',
'{{ InstanceArn }}',
'{{ TriggerEventSource }}',
'{{ Function }}',
'{{ Actions }}',
'{{ PublishStatus }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: rule
props:
- name: Name
value: '{{ Name }}'
- name: InstanceArn
value: '{{ InstanceArn }}'
- name: TriggerEventSource
value:
EventSourceName: '{{ EventSourceName }}'
IntegrationAssociationArn: '{{ IntegrationAssociationArn }}'
- name: Function
value: '{{ Function }}'
- name: Actions
value:
AssignContactCategoryActions:
- {}
EventBridgeActions:
- Name: '{{ Name }}'
TaskActions:
- Name: '{{ Name }}'
Description: '{{ Description }}'
ContactFlowArn: '{{ ContactFlowArn }}'
References: null
SendNotificationActions:
- DeliveryMethod: '{{ DeliveryMethod }}'
Subject: '{{ Subject }}'
Content: '{{ Content }}'
ContentType: '{{ ContentType }}'
Recipient:
UserTags: null
UserArns:
- '{{ UserArns[0] }}'
CreateCaseActions:
- Fields:
- Id:
Name: '{{ Name }}'
Description: '{{ Description }}'
Type: '{{ Type }}'
SingleSelectOptions:
- '{{ SingleSelectOptions[0] }}'
TemplateId: '{{ TemplateId }}'
UpdateCaseActions:
- Fields: null
EndAssociatedTasksActions:
- {}
- name: PublishStatus
value: '{{ PublishStatus }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.connect.rules
WHERE data__Identifier = '<RuleArn>'
AND region = 'us-east-1';
Permissions
To operate on the rules
resource, the following permissions are required:
Create
connect:CreateRule,
cases:GetTemplate,
cases:ListFields,
cases:ListFieldOptions
Read
connect:DescribeRule
Delete
connect:DeleteRule,
connect:UntagResource
Update
connect:UpdateRule,
cases:GetTemplate,
cases:ListFields,
cases:ListFieldOptions,
connect:TagResource,
connect:UntagResource