notification_rules
Creates, updates, deletes, gets or lists a notification_rules resource.
Overview
| Name | notification_rules |
| Type | Resource |
| Id | aws.codestar_notifications.notification_rules |
Fields
The following fields are returned by SELECT queries:
- describe_notification_rule
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) of the notification rule. (pattern: <code>^arn:aws[^:\s]:codestar-notifications:[^:\s]+:\d{12}:notificationrule/(.\S)?$</code>) |
created_by | string | The name or email alias of the person who created the notification rule. |
created_timestamp | string (date-time) | The date and time the notification rule was created, in timestamp format. |
detail_type | string | The level of detail included in the notifications for this resource. BASIC will include only the contents of the event as it would appear in Amazon CloudWatch. FULL will include any supplemental information provided by CodeStar Notifications and/or the service for the resource for which the notification is created. (BASIC, FULL) |
event_types | array | A list of the event types associated with the notification rule. |
last_modified_timestamp | string (date-time) | The date and time the notification rule was most recently updated, in timestamp format. |
name | string | The name of the notification rule. (pattern: <code>[A-Za-z0-9-_ ]+$</code>) |
resource | string | The Amazon Resource Name (ARN) of the resource associated with the notification rule. (pattern: <code>^arn:aws[^:\s]:[^:\s]:[^:\s]*:[0-9]{12}:[^\s]+$</code>) |
status | string | The status of the notification rule. Valid statuses are on (sending notifications) or off (not sending notifications). (ENABLED, DISABLED) |
tags | object | The tags associated with the notification rule. |
targets | array | A list of the Amazon Q Developer in chat applications topics and Amazon Q Developer in chat applications clients associated with the notification rule. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_notification_rule | select | region | Returns information about a specified notification rule. | |
create_notification_rule | insert | region, EventTypeIds, DetailType | Creates a notification rule for a resource. The rule specifies the events you want notifications about and the targets (such as Amazon Q Developer in chat applications topics or Amazon Q Developer in chat applications clients configured for Slack) where you want to receive them. | |
update_notification_rule | update | region | Updates a notification rule for a resource. You can change the events that trigger the notification rule, the status of the rule, and the targets that receive the notifications. To add or remove tags for a notification rule, you must use TagResource and UntagResource. | |
delete_notification_rule | delete | region | Deletes a notification rule for a resource. | |
list_notification_rules | exec | region | Returns a list of the notification rules for an Amazon Web Services account. |
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 |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_notification_rule
Returns information about a specified notification rule.
SELECT
arn,
created_by,
created_timestamp,
detail_type,
event_types,
last_modified_timestamp,
name,
resource,
status,
tags,
targets
FROM aws.codestar_notifications.notification_rules
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_notification_rule
- Manifest
Creates a notification rule for a resource. The rule specifies the events you want notifications about and the targets (such as Amazon Q Developer in chat applications topics or Amazon Q Developer in chat applications clients configured for Slack) where you want to receive them.
INSERT INTO aws.codestar_notifications.notification_rules (
Name,
EventTypeIds,
Resource,
Targets,
DetailType,
ClientRequestToken,
Tags,
Status,
region
)
SELECT
'{{ Name }}',
'{{ EventTypeIds }}' /* required */,
'{{ Resource }}',
'{{ Targets }}',
'{{ DetailType }}' /* required */,
'{{ ClientRequestToken }}',
'{{ Tags }}',
'{{ Status }}',
'{{ region }}'
RETURNING
arn
;
# Description fields are for documentation purposes
- name: notification_rules
props:
- name: region
value: "{{ region }}"
description: Required parameter for the notification_rules resource.
- name: Name
value: "{{ Name }}"
- name: EventTypeIds
value:
- "{{ EventTypeIds }}"
- name: Resource
value: "{{ Resource }}"
- name: Targets
value:
- TargetType: "{{ TargetType }}"
TargetAddress: "{{ TargetAddress }}"
- name: DetailType
value: "{{ DetailType }}"
valid_values: ['BASIC', 'FULL']
- name: ClientRequestToken
value: "{{ ClientRequestToken }}"
- name: Tags
value: "{{ Tags }}"
- name: Status
value: "{{ Status }}"
valid_values: ['ENABLED', 'DISABLED']
UPDATE examples
- update_notification_rule
Updates a notification rule for a resource. You can change the events that trigger the notification rule, the status of the rule, and the targets that receive the notifications. To add or remove tags for a notification rule, you must use TagResource and UntagResource.
UPDATE aws.codestar_notifications.notification_rules
SET
Arn = '{{ Arn }}',
Name = '{{ Name }}',
Status = '{{ Status }}',
EventTypeIds = '{{ EventTypeIds }}',
Targets = '{{ Targets }}',
DetailType = '{{ DetailType }}'
WHERE
region = '{{ region }}' --required;
DELETE examples
- delete_notification_rule
Deletes a notification rule for a resource.
DELETE FROM aws.codestar_notifications.notification_rules
WHERE region = '{{ region }}' --required
;
Lifecycle Methods
- list_notification_rules
Returns a list of the notification rules for an Amazon Web Services account.
EXEC aws.codestar_notifications.notification_rules.list_notification_rules
@region='{{ region }}' --required
@@json=
'{
"Filters": "{{ Filters }}",
"NextToken": "{{ NextToken }}",
"MaxResults": {{ MaxResults }}
}'
;