Skip to main content

event_rules

Creates, updates, deletes, gets or lists an event_rules resource.

Overview

Nameevent_rules
TypeResource
Idaws.notifications.event_rules

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe Amazon Resource Name (ARN) of the EventRule. CloudFormation stack generates this ARN and then uses this ARN to associate with the NotificationConfiguration. (pattern: <code>arn:aws:notifications::[0-9]{12}:configuration/[a-z0-9]{27}/rule/[a-z0-9]{27}</code>)
creation_timestring (date-time)The creation time of the EventRule.
event_patternstringAn additional event pattern used to further filter the events this EventRule receives. For more information, see Amazon EventBridge event patterns in the Amazon EventBridge User Guide.
event_typestringThe event type this rule should match with the EventBridge events. It must match with atleast one of the valid EventBridge event types. For example, Amazon EC2 Instance State change Notification and Amazon CloudWatch State Change. For more information, see Event delivery from Amazon Web Services services in the Amazon EventBridge User Guide. (pattern: <code>([a-zA-Z0-9 -()])+</code>)
managed_rulesarrayA list of Amazon EventBridge Managed Rule ARNs associated with this EventRule. These are created by User Notifications within your account so your EventRules can function.
notification_configuration_arnstringThe ARN for the NotificationConfiguration associated with this EventRule. (pattern: <code>arn:aws:notifications::[0-9]{12}:configuration/[a-z0-9]{27}</code>)
regionsarrayA list of Amazon Web Services Regions that send events to this EventRule.
sourcestringThe event source this rule should match with the EventBridge event sources. It must match with atleast one of the valid EventBridge event sources. Only Amazon Web Services service sourced events are supported. For example, aws.ec2 and aws.cloudwatch. For more information, see Event delivery from Amazon Web Services services in the Amazon EventBridge User Guide. (pattern: <code>aws.([a-z0-9-])+</code>)
status_summary_by_regionobjectA list of an EventRule's status by Region. Regions are mapped to EventRuleStatusSummary.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_event_rulesselectnotificationConfigurationArn, regionmaxResults, nextTokenReturns a list of EventRules according to specified filters, in reverse chronological order (newest first).
get_event_ruleselectarn, regionReturns a specified EventRule.
create_event_ruleinsertregion, notificationConfigurationArn, source, eventType, regionsCreates an EventRule that is associated with a specified NotificationConfiguration.
update_event_ruleupdatearn, regionUpdates an existing EventRule.
delete_event_ruledeletearn, regionDeletes an EventRule.

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
arnstringThe Amazon Resource Name (ARN) of the EventRule to delete.
notificationConfigurationArnstringThe Amazon Resource Name (ARN) of the NotificationConfiguration.
regionstringAWS region (default: us-east-1)
maxResultsintegerThe maximum number of results to be returned in this call. The default value is 20.
nextTokenstringThe start token for paginated calls. Retrieved from the response of a previous ListEventRules call. Next token uses Base64 encoding.

SELECT examples

Returns a list of EventRules according to specified filters, in reverse chronological order (newest first).

SELECT
arn,
creation_time,
event_pattern,
event_type,
managed_rules,
notification_configuration_arn,
regions,
source,
status_summary_by_region
FROM aws.notifications.event_rules
WHERE notificationConfigurationArn = '{{ notificationConfigurationArn }}' -- required
AND region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;

INSERT examples

Creates an EventRule that is associated with a specified NotificationConfiguration.

INSERT INTO aws.notifications.event_rules (
notificationConfigurationArn,
source,
eventType,
eventPattern,
regions,
region
)
SELECT
'{{ notificationConfigurationArn }}' /* required */,
'{{ source }}' /* required */,
'{{ eventType }}' /* required */,
'{{ eventPattern }}',
'{{ regions }}' /* required */,
'{{ region }}'
RETURNING
arn,
notification_configuration_arn,
status_summary_by_region
;

UPDATE examples

Updates an existing EventRule.

UPDATE aws.notifications.event_rules
SET
eventPattern = '{{ eventPattern }}',
regions = '{{ regions }}'
WHERE
arn = '{{ arn }}' --required
AND region = '{{ region }}' --required
RETURNING
arn,
notification_configuration_arn,
status_summary_by_region;

DELETE examples

Deletes an EventRule.

DELETE FROM aws.notifications.event_rules
WHERE arn = '{{ arn }}' --required
AND region = '{{ region }}' --required
;