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 | aws.codestarnotifications.notification_rules |
Fields
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. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | EventTypeIds, Resource, DetailType, Targets, Name, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all notification_rules
in a region.
SELECT
region,
event_type_id,
created_by,
target_address,
event_type_ids,
status,
detail_type,
resource,
targets,
tags,
name,
arn
FROM aws.codestarnotifications.notification_rules
WHERE region = 'us-east-1';
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 aws.codestarnotifications.notification_rules
WHERE region = 'us-east-1' AND data__Identifier = '<Arn>';
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 aws.codestarnotifications.notification_rules (
EventTypeIds,
DetailType,
Resource,
Targets,
Name,
region
)
SELECT
'{{ EventTypeIds }}',
'{{ DetailType }}',
'{{ Resource }}',
'{{ Targets }}',
'{{ Name }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.codestarnotifications.notification_rules (
EventTypeId,
CreatedBy,
TargetAddress,
EventTypeIds,
Status,
DetailType,
Resource,
Targets,
Tags,
Name,
region
)
SELECT
'{{ EventTypeId }}',
'{{ CreatedBy }}',
'{{ TargetAddress }}',
'{{ EventTypeIds }}',
'{{ Status }}',
'{{ DetailType }}',
'{{ 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: EventTypeId
value: '{{ EventTypeId }}'
- name: CreatedBy
value: '{{ CreatedBy }}'
- name: TargetAddress
value: '{{ TargetAddress }}'
- name: EventTypeIds
value:
- '{{ EventTypeIds[0] }}'
- name: Status
value: '{{ Status }}'
- name: DetailType
value: '{{ DetailType }}'
- name: Resource
value: '{{ Resource }}'
- name: Targets
value:
- TargetType: '{{ TargetType }}'
TargetAddress: '{{ TargetAddress }}'
- name: Tags
value: {}
- name: Name
value: '{{ Name }}'
DELETE
example
/*+ delete */
DELETE FROM aws.codestarnotifications.notification_rules
WHERE data__Identifier = '<Arn>'
AND region = 'us-east-1';
Permissions
To operate on the notification_rules
resource, the following permissions are required:
Create
codestar-notifications:createNotificationRule
List
codestar-notifications:listNotificationRules
Read
codestar-notifications:describeNotificationRule
Delete
codestar-notifications:deleteNotificationRule,
codestar-notifications:describeNotificationRule
Update
codestar-notifications:updateNotificationRule,
codestar-notifications:TagResource,
codestar-notifications:UntagResource