event_rules
Creates, updates, deletes, gets or lists an event_rules resource.
Overview
| Name | event_rules |
| Type | Resource |
| Id | aws.notifications.event_rules |
Fields
The following fields are returned by SELECT queries:
- list_event_rules
- get_event_rule
| Name | Datatype | Description |
|---|---|---|
arn | string | The 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_time | string (date-time) | The creation time of the EventRule. |
event_pattern | string | An 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_type | string | The 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_rules | array | A 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_arn | string | The ARN for the NotificationConfiguration associated with this EventRule. (pattern: <code>arn:aws:notifications::[0-9]{12}:configuration/[a-z0-9]{27}</code>) |
regions | array | A list of Amazon Web Services Regions that send events to this EventRule. |
source | string | The 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_region | object | A list of an EventRule's status by Region. Regions are mapped to EventRuleStatusSummary. |
| Name | Datatype | Description |
|---|---|---|
arn | string | The ARN of the resource. (pattern: <code>arn:aws:notifications::[0-9]{12}:configuration/[a-z0-9]{27}/rule/[a-z0-9]{27}</code>) |
creation_time | string (date-time) | The date when the EventRule was created. |
event_pattern | string | An 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_type | string | The event type to match. Must match one of the valid Amazon EventBridge event types. For example, EC2 Instance State-change Notification and Amazon CloudWatch Alarm 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_rules | array | A list of managed rules from EventBridge that are associated with this EventRule. These are created by User Notifications within your account so this EventRule functions. |
notification_configuration_arn | string | The ARN of a NotificationConfiguration. (pattern: <code>arn:aws:notifications::[0-9]{12}:configuration/[a-z0-9]{27}</code>) |
regions | array | A list of Amazon Web Services Regions that send events to this EventRule. |
source | string | The matched event source. Must match one of the valid EventBridge 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_region | object | A list of an EventRule's status by Region. Regions are mapped to EventRuleStatusSummary. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_event_rules | select | notificationConfigurationArn, region | maxResults, nextToken | Returns a list of EventRules according to specified filters, in reverse chronological order (newest first). |
get_event_rule | select | arn, region | Returns a specified EventRule. | |
create_event_rule | insert | region, notificationConfigurationArn, source, eventType, regions | Creates an EventRule that is associated with a specified NotificationConfiguration. | |
update_event_rule | update | arn, region | Updates an existing EventRule. | |
delete_event_rule | delete | arn, region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) of the EventRule to delete. |
notificationConfigurationArn | string | The Amazon Resource Name (ARN) of the NotificationConfiguration. |
region | string | AWS region (default: us-east-1) |
maxResults | integer | The maximum number of results to be returned in this call. The default value is 20. |
nextToken | string | The start token for paginated calls. Retrieved from the response of a previous ListEventRules call. Next token uses Base64 encoding. |
SELECT examples
- list_event_rules
- get_event_rule
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 }}'
;
Returns a specified EventRule.
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 arn = '{{ arn }}' -- required
AND region = '{{ region }}' -- required
;
INSERT examples
- create_event_rule
- Manifest
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
;
# Description fields are for documentation purposes
- name: event_rules
props:
- name: region
value: "{{ region }}"
description: Required parameter for the event_rules resource.
- name: notificationConfigurationArn
value: "{{ notificationConfigurationArn }}"
- name: source
value: "{{ source }}"
- name: eventType
value: "{{ eventType }}"
- name: eventPattern
value: "{{ eventPattern }}"
- name: regions
value:
- "{{ regions }}"
UPDATE examples
- update_event_rule
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
- delete_event_rule
Deletes an EventRule.
DELETE FROM aws.notifications.event_rules
WHERE arn = '{{ arn }}' --required
AND region = '{{ region }}' --required
;