Skip to main content

notification_rules

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

Overview

Namenotification_rules
TypeResource
Idaws.codestar_notifications.notification_rules

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe Amazon Resource Name (ARN) of the notification rule. (pattern: <code>^arn:aws[^:\s]:codestar-notifications:[^:\s]+:\d{12}:notificationrule/(.\S)?$</code>)
created_bystringThe name or email alias of the person who created the notification rule.
created_timestampstring (date-time)The date and time the notification rule was created, in timestamp format.
detail_typestringThe 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_typesarrayA list of the event types associated with the notification rule.
last_modified_timestampstring (date-time)The date and time the notification rule was most recently updated, in timestamp format.
namestringThe name of the notification rule. (pattern: <code>[A-Za-z0-9-_ ]+$</code>)
resourcestringThe Amazon Resource Name (ARN) of the resource associated with the notification rule. (pattern: <code>^arn:aws[^:\s]:[^:\s]:[^:\s]*:[0-9]{12}:[^\s]+$</code>)
statusstringThe status of the notification rule. Valid statuses are on (sending notifications) or off (not sending notifications). (ENABLED, DISABLED)
tagsobjectThe tags associated with the notification rule.
targetsarrayA 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:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_notification_ruleselectregionReturns information about a specified notification rule.
create_notification_ruleinsertregion, EventTypeIds, DetailTypeCreates 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_ruleupdateregionUpdates 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_ruledeleteregionDeletes a notification rule for a resource.
list_notification_rulesexecregionReturns 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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

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

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
;

UPDATE examples

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

Deletes a notification rule for a resource.

DELETE FROM aws.codestar_notifications.notification_rules
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

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 }}
}'
;