event_rules
Creates, updates, deletes or gets an event_rule resource or lists event_rules in a region
Overview
| Name | event_rules |
| Type | Resource |
| Description | Resource Type definition for AWS::Notifications::EventRule |
| Id | awscc.notifications.event_rules |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
arn | string | |
creation_time | string | |
event_pattern | string | |
event_type | string | |
managed_rules | array | |
notification_configuration_arn | string | |
regions | array | |
source | string | |
status_summary_by_region | object | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
arn | string | |
region | string | AWS region. |
For more information, see AWS::Notifications::EventRule.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | event_rules | INSERT | EventType, NotificationConfigurationArn, Regions, Source, region |
delete_resource | event_rules | DELETE | Identifier, region |
update_resource | event_rules | UPDATE | Identifier, PatchDocument, region |
list_resources | event_rules_list_only | SELECT | region |
get_resource | event_rules | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual event_rule.
SELECT
region,
arn,
creation_time,
event_pattern,
event_type,
managed_rules,
notification_configuration_arn,
regions,
source,
status_summary_by_region
FROM awscc.notifications.event_rules
WHERE
region = 'us-east-1' AND
Identifier = '{{ arn }}';
Lists all event_rules in a region.
SELECT
region,
arn
FROM awscc.notifications.event_rules_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new event_rule resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.notifications.event_rules (
EventType,
NotificationConfigurationArn,
Regions,
Source,
region
)
SELECT
'{{ event_type }}',
'{{ notification_configuration_arn }}',
'{{ regions }}',
'{{ source }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.notifications.event_rules (
EventPattern,
EventType,
NotificationConfigurationArn,
Regions,
Source,
region
)
SELECT
'{{ event_pattern }}',
'{{ event_type }}',
'{{ notification_configuration_arn }}',
'{{ regions }}',
'{{ source }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: event_rule
props:
- name: event_pattern
value: '{{ event_pattern }}'
- name: event_type
value: '{{ event_type }}'
- name: notification_configuration_arn
value: '{{ notification_configuration_arn }}'
- name: regions
value:
- '{{ regions[0] }}'
- name: source
value: '{{ source }}'
UPDATE example
Use the following StackQL query and manifest file to update a event_rule resource, using stack-deploy.
/*+ update */
UPDATE awscc.notifications.event_rules
SET PatchDocument = string('{{ {
"EventPattern": event_pattern,
"Regions": regions
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';
DELETE example
/*+ delete */
DELETE FROM awscc.notifications.event_rules
WHERE
Identifier = '{{ arn }}' AND
region = 'us-east-1';
Permissions
To operate on the event_rules resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
notifications:CreateEventRule,
notifications:UpdateEventRule,
notifications:GetEventRule
notifications:GetEventRule
notifications:UpdateEventRule,
notifications:GetEventRule
notifications:DeleteEventRule,
notifications:GetEventRule
notifications:ListEventRules,
notifications:GetEventRule