rules
Creates, updates, deletes or gets a rule resource or lists rules in a region
Overview
| Name | rules |
| Type | Resource |
| Description | Creates a rule for the specified CON instance. |
| Id | awscc.connect.rules |
Fields
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the rule. |
rule_arn | string | |
instance_arn | string | The Amazon Resource Name (ARN) of the instance. |
trigger_event_source | object | The event source to trigger the rule. |
function | string | The conditions of the rule. |
actions | object | A list of actions to be run when the rule is triggered. |
publish_status | string | The publish status of the rule.Allowed values:DRAFT | PUBLISHED |
tags | array | The tags used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }. |
region | string | AWS region. |
For more information, see AWS::Connect::Rule.
Methods
| Name | Accessible by | Required Params |
|---|---|---|
create_resource | INSERT | Name, InstanceArn, TriggerEventSource, Function, Actions, PublishStatus, region |
delete_resource | DELETE | Identifier, region |
update_resource | UPDATE | Identifier, PatchDocument, region |
get_resource | SELECT | 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 awscc.connect.rules
WHERE
region = '{{ region }}' AND
Identifier = '{{ rule_arn }}';
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 awscc.connect.rules (
Name,
InstanceArn,
TriggerEventSource,
Function,
Actions,
PublishStatus,
region
)
SELECT
'{{ name }}',
'{{ instance_arn }}',
'{{ trigger_event_source }}',
'{{ function }}',
'{{ actions }}',
'{{ publish_status }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.connect.rules (
Name,
InstanceArn,
TriggerEventSource,
Function,
Actions,
PublishStatus,
Tags,
region
)
SELECT
'{{ name }}',
'{{ instance_arn }}',
'{{ trigger_event_source }}',
'{{ function }}',
'{{ actions }}',
'{{ publish_status }}',
'{{ tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
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: instance_arn
value: '{{ instance_arn }}'
- name: trigger_event_source
value:
event_source_name: '{{ event_source_name }}'
integration_association_arn: '{{ integration_association_arn }}'
- name: function
value: '{{ function }}'
- name: actions
value:
assign_contact_category_actions:
- {}
event_bridge_actions:
- name: '{{ name }}'
task_actions:
- name: '{{ name }}'
description: '{{ description }}'
contact_flow_arn: '{{ contact_flow_arn }}'
references: null
send_notification_actions:
- delivery_method: '{{ delivery_method }}'
subject: '{{ subject }}'
content: '{{ content }}'
content_type: '{{ content_type }}'
recipient:
user_tags: null
user_arns:
- '{{ user_arns[0] }}'
create_case_actions:
- fields:
- id:
name: '{{ name }}'
description: '{{ description }}'
type: '{{ type }}'
single_select_options:
- '{{ single_select_options[0] }}'
template_id: '{{ template_id }}'
update_case_actions:
- fields: null
end_associated_tasks_actions:
- {}
submit_auto_evaluation_actions:
- evaluation_form_arn: '{{ evaluation_form_arn }}'
- name: publish_status
value: '{{ publish_status }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.connect.rules
WHERE
Identifier = '{{ rule_arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the rules resource, the following permissions are required:
- Create
- Read
- Delete
- Update
connect:CreateRule,
cases:GetTemplate,
cases:ListFields,
cases:ListFieldOptions
connect:DescribeRule
connect:DeleteRule,
connect:UntagResource
connect:UpdateRule,
cases:GetTemplate,
cases:ListFields,
cases:ListFieldOptions,
connect:TagResource,
connect:UntagResource