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 = '{{ region }}' AND
Identifier = '{{ arn }}';
Lists all event_rules in a region.
SELECT
region,
arn
FROM awscc.notifications.event_rules_list_only
WHERE
region = '{{ region }}';
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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.notifications.event_rules (
EventPattern,
EventType,
NotificationConfigurationArn,
Regions,
Source,
region
)
SELECT
'{{ event_pattern }}',
'{{ event_type }}',
'{{ notification_configuration_arn }}',
'{{ regions }}',
'{{ source }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.notifications.event_rules
WHERE
Identifier = '{{ arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
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