event_subscriptions
Creates, updates, deletes or gets an event_subscription
resource or lists event_subscriptions
in a region
Overview
Name | event_subscriptions |
Type | Resource |
Description | The `AWS::Redshift::EventSubscription` resource creates an Amazon Redshift Event Subscription. |
Id | aws.redshift.event_subscriptions |
Fields
Name | Datatype | Description |
---|---|---|
status | string | The status of the Amazon Redshift event notification subscription. |
cust_subscription_id | string | The name of the Amazon Redshift event notification subscription. |
event_categories_list | array | The list of Amazon Redshift event categories specified in the event notification subscription. |
source_type | string | The type of source that will be generating the events. |
event_categories | array | Specifies the Amazon Redshift event categories to be published by the event notification subscription. |
enabled | boolean | A boolean value; set to true to activate the subscription, and set to false to create the subscription but not activate it. |
severity | string | Specifies the Amazon Redshift event severity to be published by the event notification subscription. |
subscription_name | string | The name of the Amazon Redshift event notification subscription |
source_ids | array | A list of one or more identifiers of Amazon Redshift source objects. |
customer_aws_id | string | The AWS account associated with the Amazon Redshift event notification subscription. |
source_ids_list | array | A list of the sources that publish events to the Amazon Redshift event notification subscription. |
sns_topic_arn | string | The Amazon Resource Name (ARN) of the Amazon SNS topic used to transmit the event notifications. |
subscription_creation_time | string | The date and time the Amazon Redshift event notification subscription was created. |
tags | array | An array of key-value pairs to apply to this resource. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | SubscriptionName, 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 event_subscriptions
in a region.
SELECT
region,
status,
cust_subscription_id,
event_categories_list,
source_type,
event_categories,
enabled,
severity,
subscription_name,
source_ids,
customer_aws_id,
source_ids_list,
sns_topic_arn,
subscription_creation_time,
tags
FROM aws.redshift.event_subscriptions
WHERE region = 'us-east-1';
Gets all properties from an individual event_subscription
.
SELECT
region,
status,
cust_subscription_id,
event_categories_list,
source_type,
event_categories,
enabled,
severity,
subscription_name,
source_ids,
customer_aws_id,
source_ids_list,
sns_topic_arn,
subscription_creation_time,
tags
FROM aws.redshift.event_subscriptions
WHERE region = 'us-east-1' AND data__Identifier = '<SubscriptionName>';
INSERT
example
Use the following StackQL query and manifest file to create a new event_subscription
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.redshift.event_subscriptions (
SubscriptionName,
region
)
SELECT
'{{ SubscriptionName }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.redshift.event_subscriptions (
SourceType,
EventCategories,
Enabled,
Severity,
SubscriptionName,
SourceIds,
SnsTopicArn,
Tags,
region
)
SELECT
'{{ SourceType }}',
'{{ EventCategories }}',
'{{ Enabled }}',
'{{ Severity }}',
'{{ SubscriptionName }}',
'{{ SourceIds }}',
'{{ SnsTopicArn }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: event_subscription
props:
- name: SourceType
value: '{{ SourceType }}'
- name: EventCategories
value:
- '{{ EventCategories[0] }}'
- name: Enabled
value: '{{ Enabled }}'
- name: Severity
value: '{{ Severity }}'
- name: SubscriptionName
value: '{{ SubscriptionName }}'
- name: SourceIds
value:
- '{{ SourceIds[0] }}'
- name: SnsTopicArn
value: '{{ SnsTopicArn }}'
- name: Tags
value:
- Value: '{{ Value }}'
Key: '{{ Key }}'
DELETE
example
/*+ delete */
DELETE FROM aws.redshift.event_subscriptions
WHERE data__Identifier = '<SubscriptionName>'
AND region = 'us-east-1';
Permissions
To operate on the event_subscriptions
resource, the following permissions are required:
Read
redshift:DescribeEventSubscriptions,
redshift:DescribeTags
Create
redshift:CreateEventSubscription,
redshift:CreateTags,
redshift:DescribeTags,
redshift:DescribeEventSubscriptions
Update
redshift:ModifyEventSubscription,
redshift:CreateTags,
redshift:DescribeTags,
redshift:DescribeEventSubscriptions,
redshift:DeleteTags
List
redshift:DescribeTags,
redshift:DescribeEventSubscriptions
Delete
redshift:DescribeEventSubscriptions,
redshift:DeleteEventSubscription,
redshift:DescribeTags,
redshift:DeleteTags