event_subscriptions
Creates, updates, deletes, gets or lists an event_subscriptions resource.
Overview
| Name | event_subscriptions |
| Type | Resource |
| Id | aws.redshift.event_subscriptions |
Fields
The following fields are returned by SELECT queries:
- describe_event_subscriptions
| Name | Datatype | Description |
|---|---|---|
cust_subscription_id | string | The name of the Amazon Redshift event notification subscription. |
customer_aws_id | string | The Amazon Web Services account associated with the Amazon Redshift event notification subscription. |
enabled | boolean | A boolean value indicating whether the subscription is enabled; true indicates that the subscription is enabled. |
event_categories_list | string | The list of Amazon Redshift event categories specified in the event notification subscription. Values: Configuration, Management, Monitoring, Security, Pending |
severity | string | The event severity specified in the Amazon Redshift event notification subscription. Values: ERROR, INFO |
sns_topic_arn | string | The Amazon Resource Name (ARN) of the Amazon SNS topic used by the event notification subscription. |
source_ids_list | string | A list of the sources that publish events to the Amazon Redshift event notification subscription. |
source_type | string | The source type of the events returned by the Amazon Redshift event notification, such as cluster, cluster-snapshot, cluster-parameter-group, cluster-security-group, or scheduled-action. |
status | string | The status of the Amazon Redshift event notification subscription. Constraints: Can be one of the following: active | no-permission | topic-not-exist The status "no-permission" indicates that Amazon Redshift no longer has permission to post to the Amazon SNS topic. The status "topic-not-exist" indicates that the topic was deleted after the subscription was created. |
subscription_creation_time | string | The date and time the Amazon Redshift event notification subscription was created. |
tags | string | The list of tags for the event subscription. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_event_subscriptions | select | region | SubscriptionName, MaxRecords, Marker, TagKeys, TagValues | Lists descriptions of all the Amazon Redshift event notification subscriptions for a customer account. If you specify a subscription name, lists the description for that subscription. If you specify both tag keys and tag values in the same request, Amazon Redshift returns all event notification subscriptions that match any combination of the specified keys and values. For example, if you have owner and environment for tag keys, and admin and test for tag values, all subscriptions that have any combination of those values are returned. If both tag keys and values are omitted from the request, subscriptions are returned regardless of whether they have tag keys or values associated with them. |
create_event_subscription | insert | SubscriptionName, SnsTopicArn, region | SourceType, SourceIds, EventCategories, Severity, Enabled, Tags | Creates an Amazon Redshift event notification subscription. This action requires an ARN (Amazon Resource Name) of an Amazon SNS topic created by either the Amazon Redshift console, the Amazon SNS console, or the Amazon SNS API. To obtain an ARN with Amazon SNS, you must create a topic in Amazon SNS and subscribe to the topic. The ARN is displayed in the SNS console. You can specify the source type, and lists of Amazon Redshift source IDs, event categories, and event severities. Notifications will be sent for all events you want that match those criteria. For example, you can specify source type = cluster, source ID = my-cluster-1 and mycluster2, event categories = Availability, Backup, and severity = ERROR. The subscription will only send notifications for those ERROR events in the Availability and Backup categories for the specified clusters. If you specify both the source type and source IDs, such as source type = cluster and source identifier = my-cluster-1, notifications will be sent for all the cluster events for my-cluster-1. If you specify a source type but do not specify a source identifier, you will receive notice of the events for the objects of that type in your Amazon Web Services account. If you do not specify either the SourceType nor the SourceIdentifier, you will be notified of events generated from all Amazon Redshift sources belonging to your Amazon Web Services account. You must specify a source type if you specify a source ID. |
modify_event_subscription | update | SubscriptionName, region | SnsTopicArn, SourceType, SourceIds, EventCategories, Severity, Enabled | Modifies an existing Amazon Redshift event notification subscription. |
delete_event_subscription | delete | SubscriptionName, region | Deletes an Amazon Redshift event notification subscription. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
SnsTopicArn | string | The Amazon Resource Name (ARN) of the Amazon SNS topic used to transmit the event notifications. The ARN is created by Amazon SNS when you create a topic and subscribe to it. |
SubscriptionName | string | The name of the Amazon Redshift event notification subscription to be deleted. |
region | string | AWS region (default: us-east-1) |
Enabled | boolean | A Boolean value indicating if the subscription is enabled. true indicates the subscription is enabled |
EventCategories | array | Specifies the Amazon Redshift event categories to be published by the event notification subscription. Values: configuration, management, monitoring, security, pending |
Marker | string | An optional parameter that specifies the starting point to return a set of response records. When the results of a DescribeEventSubscriptions request exceed the value specified in MaxRecords, Amazon Web Services returns a value in the Marker field of the response. You can retrieve the next set of response records by providing the returned marker value in the Marker parameter and retrying the request. |
MaxRecords | integer | The maximum number of response records to return in each call. If the number of remaining response records exceeds the specified MaxRecords value, a value is returned in a marker field of the response. You can retrieve the next set of records by retrying the command with the returned marker value. Default: 100 Constraints: minimum 20, maximum 100. |
Severity | string | Specifies the Amazon Redshift event severity to be published by the event notification subscription. Values: ERROR, INFO |
SnsTopicArn | string | The Amazon Resource Name (ARN) of the SNS topic to be used by the event notification subscription. |
SourceIds | array | A list of one or more identifiers of Amazon Redshift source objects. All of the objects must be of the same type as was specified in the source type parameter. The event subscription will return only events generated by the specified objects. If not specified, then events are returned for all objects within the source type specified. Example: my-cluster-1, my-cluster-2 Example: my-snapshot-20131010 |
SourceType | string | The type of source that will be generating the events. For example, if you want to be notified of events generated by a cluster, you would set this parameter to cluster. If this value is not specified, events are returned for all Amazon Redshift objects in your Amazon Web Services account. You must specify a source type in order to specify source IDs. Valid values: cluster, cluster-parameter-group, cluster-security-group, cluster-snapshot, and scheduled-action. |
SubscriptionName | string | The name of the Amazon Redshift event notification subscription to be described. |
TagKeys | array | A tag key or keys for which you want to return all matching event notification subscriptions that are associated with the specified key or keys. For example, suppose that you have subscriptions that are tagged with keys called owner and environment. If you specify both of these tag keys in the request, Amazon Redshift returns a response with the subscriptions that have either or both of these tag keys associated with them. |
TagValues | array | A tag value or values for which you want to return all matching event notification subscriptions that are associated with the specified tag value or values. For example, suppose that you have subscriptions that are tagged with values called admin and test. If you specify both of these tag values in the request, Amazon Redshift returns a response with the subscriptions that have either or both of these tag values associated with them. |
Tags | array | A list of tag instances. |
SELECT examples
- describe_event_subscriptions
Lists descriptions of all the Amazon Redshift event notification subscriptions for a customer account. If you specify a subscription name, lists the description for that subscription. If you specify both tag keys and tag values in the same request, Amazon Redshift returns all event notification subscriptions that match any combination of the specified keys and values. For example, if you have owner and environment for tag keys, and admin and test for tag values, all subscriptions that have any combination of those values are returned. If both tag keys and values are omitted from the request, subscriptions are returned regardless of whether they have tag keys or values associated with them.
SELECT
cust_subscription_id,
customer_aws_id,
enabled,
event_categories_list,
severity,
sns_topic_arn,
source_ids_list,
source_type,
status,
subscription_creation_time,
tags
FROM aws.redshift.event_subscriptions
WHERE region = '{{ region }}' -- required
AND SubscriptionName = '{{ SubscriptionName }}'
AND MaxRecords = '{{ MaxRecords }}'
AND Marker = '{{ Marker }}'
AND TagKeys = '{{ TagKeys }}'
AND TagValues = '{{ TagValues }}'
;
INSERT examples
- create_event_subscription
- Manifest
Creates an Amazon Redshift event notification subscription. This action requires an ARN (Amazon Resource Name) of an Amazon SNS topic created by either the Amazon Redshift console, the Amazon SNS console, or the Amazon SNS API. To obtain an ARN with Amazon SNS, you must create a topic in Amazon SNS and subscribe to the topic. The ARN is displayed in the SNS console. You can specify the source type, and lists of Amazon Redshift source IDs, event categories, and event severities. Notifications will be sent for all events you want that match those criteria. For example, you can specify source type = cluster, source ID = my-cluster-1 and mycluster2, event categories = Availability, Backup, and severity = ERROR. The subscription will only send notifications for those ERROR events in the Availability and Backup categories for the specified clusters. If you specify both the source type and source IDs, such as source type = cluster and source identifier = my-cluster-1, notifications will be sent for all the cluster events for my-cluster-1. If you specify a source type but do not specify a source identifier, you will receive notice of the events for the objects of that type in your Amazon Web Services account. If you do not specify either the SourceType nor the SourceIdentifier, you will be notified of events generated from all Amazon Redshift sources belonging to your Amazon Web Services account. You must specify a source type if you specify a source ID.
INSERT INTO aws.redshift.event_subscriptions (
SubscriptionName,
SnsTopicArn,
region,
SourceType,
SourceIds,
EventCategories,
Severity,
Enabled,
Tags
)
SELECT
'{{ SubscriptionName }}',
'{{ SnsTopicArn }}',
'{{ region }}',
'{{ SourceType }}',
'{{ SourceIds }}',
'{{ EventCategories }}',
'{{ Severity }}',
'{{ Enabled }}',
'{{ Tags }}'
RETURNING
cust_subscription_id,
customer_aws_id,
enabled,
event_categories_list,
severity,
sns_topic_arn,
source_ids_list,
source_type,
status,
subscription_creation_time,
tags
;
# Description fields are for documentation purposes
- name: event_subscriptions
props:
- name: SubscriptionName
value: "{{ SubscriptionName }}"
description: Required parameter for the event_subscriptions resource.
- name: SnsTopicArn
value: "{{ SnsTopicArn }}"
description: Required parameter for the event_subscriptions resource.
- name: region
value: "{{ region }}"
description: Required parameter for the event_subscriptions resource.
- name: SourceType
value: "{{ SourceType }}"
description: The type of source that will be generating the events. For example, if you want to be notified of events generated by a cluster, you would set this parameter to cluster. If this value is not specified, events are returned for all Amazon Redshift objects in your Amazon Web Services account. You must specify a source type in order to specify source IDs. Valid values: cluster, cluster-parameter-group, cluster-security-group, cluster-snapshot, and scheduled-action.
description: The type of source that will be generating the events. For example, if you want to be notified of events generated by a cluster, you would set this parameter to cluster. If this value is not specified, events are returned for all Amazon Redshift objects in your Amazon Web Services account. You must specify a source type in order to specify source IDs. Valid values: cluster, cluster-parameter-group, cluster-security-group, cluster-snapshot, and scheduled-action.
- name: SourceIds
value: "{{ SourceIds }}"
description: A list of one or more identifiers of Amazon Redshift source objects. All of the objects must be of the same type as was specified in the source type parameter. The event subscription will return only events generated by the specified objects. If not specified, then events are returned for all objects within the source type specified. Example: my-cluster-1, my-cluster-2 Example: my-snapshot-20131010
description: A list of one or more identifiers of Amazon Redshift source objects. All of the objects must be of the same type as was specified in the source type parameter. The event subscription will return only events generated by the specified objects. If not specified, then events are returned for all objects within the source type specified. Example: my-cluster-1, my-cluster-2 Example: my-snapshot-20131010
- name: EventCategories
value: "{{ EventCategories }}"
description: Specifies the Amazon Redshift event categories to be published by the event notification subscription. Values: configuration, management, monitoring, security, pending
description: Specifies the Amazon Redshift event categories to be published by the event notification subscription. Values: configuration, management, monitoring, security, pending
- name: Severity
value: "{{ Severity }}"
description: Specifies the Amazon Redshift event severity to be published by the event notification subscription. Values: ERROR, INFO
description: Specifies the Amazon Redshift event severity to be published by the event notification subscription. Values: ERROR, INFO
- name: Enabled
value: {{ Enabled }}
description: A boolean value; set to true to activate the subscription, and set to false to create the subscription but not activate it.
description: A boolean value; set to true to activate the subscription, and set to false to create the subscription but not activate it.
- name: Tags
value: "{{ Tags }}"
description: A list of tag instances.
description: A list of tag instances.
UPDATE examples
- modify_event_subscription
Modifies an existing Amazon Redshift event notification subscription.
UPDATE aws.redshift.event_subscriptions
SET
-- No updatable properties
WHERE
SubscriptionName = '{{ SubscriptionName }}' --required
AND region = '{{ region }}' --required
AND SnsTopicArn = '{{ SnsTopicArn}}'
AND SourceType = '{{ SourceType}}'
AND SourceIds = '{{ SourceIds}}'
AND EventCategories = '{{ EventCategories}}'
AND Severity = '{{ Severity}}'
AND Enabled = {{ Enabled}}
RETURNING
cust_subscription_id,
customer_aws_id,
enabled,
event_categories_list,
severity,
sns_topic_arn,
source_ids_list,
source_type,
status,
subscription_creation_time,
tags;
DELETE examples
- delete_event_subscription
Deletes an Amazon Redshift event notification subscription.
DELETE FROM aws.redshift.event_subscriptions
WHERE SubscriptionName = '{{ SubscriptionName }}' --required
AND region = '{{ region }}' --required
;