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 | awscc.redshift.event_subscriptions |
Fields
- get (all properties)
- list (identifiers only)
| 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. |
| Name | Datatype | Description |
|---|---|---|
subscription_name | string | The name of the Amazon Redshift event notification subscription |
region | string | AWS region. |
For more information, see AWS::Redshift::EventSubscription.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | event_subscriptions | INSERT | SubscriptionName, region |
delete_resource | event_subscriptions | DELETE | Identifier, region |
update_resource | event_subscriptions | UPDATE | Identifier, PatchDocument, region |
list_resources | event_subscriptions_list_only | SELECT | region |
get_resource | event_subscriptions | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 awscc.redshift.event_subscriptions
WHERE
region = '{{ region }}' AND
Identifier = '{{ subscription_name }}';
Lists all event_subscriptions in a region.
SELECT
region,
subscription_name
FROM awscc.redshift.event_subscriptions_list_only
WHERE
region = '{{ region }}';
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 awscc.redshift.event_subscriptions (
SubscriptionName,
region
)
SELECT
'{{ subscription_name }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.redshift.event_subscriptions (
SourceType,
EventCategories,
Enabled,
Severity,
SubscriptionName,
SourceIds,
SnsTopicArn,
Tags,
region
)
SELECT
'{{ source_type }}',
'{{ event_categories }}',
'{{ enabled }}',
'{{ severity }}',
'{{ subscription_name }}',
'{{ source_ids }}',
'{{ sns_topic_arn }}',
'{{ tags }}',
'{{ 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_subscription
props:
- name: source_type
value: '{{ source_type }}'
- name: event_categories
value:
- '{{ event_categories[0] }}'
- name: enabled
value: '{{ enabled }}'
- name: severity
value: '{{ severity }}'
- name: subscription_name
value: '{{ subscription_name }}'
- name: source_ids
value:
- '{{ source_ids[0] }}'
- name: sns_topic_arn
value: '{{ sns_topic_arn }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a event_subscription resource, using stack-deploy.
/*+ update */
UPDATE awscc.redshift.event_subscriptions
SET PatchDocument = string('{{ {
"SourceType": source_type,
"EventCategories": event_categories,
"Enabled": enabled,
"Severity": severity,
"SourceIds": source_ids,
"SnsTopicArn": sns_topic_arn,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ subscription_name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.redshift.event_subscriptions
WHERE
Identifier = '{{ subscription_name }}' 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_subscriptions resource, the following permissions are required:
- Read
- Create
- Update
- List
- Delete
redshift:DescribeEventSubscriptions,
redshift:DescribeTags
redshift:CreateEventSubscription,
redshift:CreateTags,
redshift:DescribeTags,
redshift:DescribeEventSubscriptions
redshift:ModifyEventSubscription,
redshift:CreateTags,
redshift:DescribeTags,
redshift:DescribeEventSubscriptions,
redshift:DeleteTags
redshift:DescribeTags,
redshift:DescribeEventSubscriptions
redshift:DescribeEventSubscriptions,
redshift:DeleteEventSubscription,
redshift:DescribeTags,
redshift:DeleteTags