notification_rules
Creates, updates, deletes or gets a notification_rule resource or lists notification_rules in a region
Overview
| Name | notification_rules |
| Type | Resource |
| Description | Resource Type definition for AWS::CodeStarNotifications::NotificationRule |
| Id | awscc.codestarnotifications.notification_rules |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
event_type_id | string | |
created_by | string | |
target_address | string | |
event_type_ids | array | |
status | string | |
detail_type | string | |
resource | string | |
targets | array | |
tags | object | |
name | string | |
arn | string | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
arn | string | |
region | string | AWS region. |
For more information, see AWS::CodeStarNotifications::NotificationRule.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | notification_rules | INSERT | EventTypeIds, Resource, DetailType, Targets, Name, region |
delete_resource | notification_rules | DELETE | Identifier, region |
update_resource | notification_rules | UPDATE | Identifier, PatchDocument, region |
list_resources | notification_rules_list_only | SELECT | region |
get_resource | notification_rules | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual notification_rule.
SELECT
region,
event_type_id,
created_by,
target_address,
event_type_ids,
status,
detail_type,
resource,
targets,
tags,
name,
arn
FROM awscc.codestarnotifications.notification_rules
WHERE
region = 'us-east-1' AND
Identifier = '{{ arn }}';
Lists all notification_rules in a region.
SELECT
region,
arn
FROM awscc.codestarnotifications.notification_rules_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new notification_rule resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.codestarnotifications.notification_rules (
EventTypeIds,
DetailType,
Resource,
Targets,
Name,
region
)
SELECT
'{{ event_type_ids }}',
'{{ detail_type }}',
'{{ resource }}',
'{{ targets }}',
'{{ name }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.codestarnotifications.notification_rules (
EventTypeId,
CreatedBy,
TargetAddress,
EventTypeIds,
Status,
DetailType,
Resource,
Targets,
Tags,
Name,
region
)
SELECT
'{{ event_type_id }}',
'{{ created_by }}',
'{{ target_address }}',
'{{ event_type_ids }}',
'{{ status }}',
'{{ detail_type }}',
'{{ resource }}',
'{{ targets }}',
'{{ tags }}',
'{{ name }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: notification_rule
props:
- name: event_type_id
value: '{{ event_type_id }}'
- name: created_by
value: '{{ created_by }}'
- name: target_address
value: '{{ target_address }}'
- name: event_type_ids
value:
- '{{ event_type_ids[0] }}'
- name: status
value: '{{ status }}'
- name: detail_type
value: '{{ detail_type }}'
- name: resource
value: '{{ resource }}'
- name: targets
value:
- target_type: '{{ target_type }}'
target_address: '{{ target_address }}'
- name: tags
value: {}
- name: name
value: '{{ name }}'
UPDATE example
Use the following StackQL query and manifest file to update a notification_rule resource, using stack-deploy.
/*+ update */
UPDATE awscc.codestarnotifications.notification_rules
SET PatchDocument = string('{{ {
"EventTypeId": event_type_id,
"CreatedBy": created_by,
"TargetAddress": target_address,
"EventTypeIds": event_type_ids,
"Status": status,
"DetailType": detail_type,
"Targets": targets,
"Tags": tags,
"Name": name
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';
DELETE example
/*+ delete */
DELETE FROM awscc.codestarnotifications.notification_rules
WHERE
Identifier = '{{ arn }}' AND
region = 'us-east-1';
Permissions
To operate on the notification_rules resource, the following permissions are required:
- Create
- List
- Read
- Delete
- Update
codestar-notifications:createNotificationRule
codestar-notifications:listNotificationRules
codestar-notifications:describeNotificationRule
codestar-notifications:deleteNotificationRule,
codestar-notifications:describeNotificationRule
codestar-notifications:updateNotificationRule,
codestar-notifications:TagResource,
codestar-notifications:UntagResource