create_event_subscription
¶
create_event_subscription(
*,
config_overrides: Optional[RedshiftClientConfig] = None,
subscription_name: Optional[String] = None,
sns_topic_arn: Optional[String] = None,
source_type: Optional[String] = None,
source_ids: Optional[SourceIdsList] = None,
event_categories: Optional[EventCategoriesList] = None,
severity: Optional[String] = None,
enabled: Optional[BooleanOptional] = None,
tags: Optional[TagList] = None,
) -> CreateEventSubscriptionResult
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.
Parameters:
-
subscription_name(Optional[String], default:None) –The name of the event subscription to be created.
Constraints:
-
Cannot be null, empty, or blank.
-
Must contain from 1 to 255 alphanumeric characters or hyphens.
-
First character must be a letter.
-
Cannot end with a hyphen or contain two consecutive hyphens.
-
-
sns_topic_arn(Optional[String], default:None) –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.
-
source_type(Optional[String], default:None) –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.
-
source_ids(Optional[SourceIdsList], default:None) –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
-
event_categories(Optional[EventCategoriesList], default:None) –Specifies the Amazon Redshift event categories to be published by the event notification subscription.
Values: configuration, management, monitoring, security, pending
-
severity(Optional[String], default:None) –Specifies the Amazon Redshift event severity to be published by the event notification subscription.
Values: ERROR, INFO
-
enabled(Optional[BooleanOptional], default:None) –A boolean value; set to
trueto activate the subscription, and set tofalseto create the subscription but not activate it. -
tags(Optional[TagList], default:None) –A list of tag instances.
Raises:
-
EventSubscriptionQuotaExceededFault–The request would exceed the allowed number of event subscriptions for this account. For information about increasing your quota, go to Limits in Amazon Redshift in the Amazon Redshift Cluster Management Guide.
-
InvalidTagFault–The tag is invalid.
-
SNSInvalidTopicFault–Amazon SNS has responded that there is a problem with the specified Amazon SNS topic.
-
SNSNoAuthorizationFault–You do not have permission to publish to the specified Amazon SNS topic.
-
SNSTopicArnNotFoundFault–An Amazon SNS topic with the specified Amazon Resource Name (ARN) does not exist.
-
SourceNotFoundFault–The specified Amazon Redshift event source could not be found.
-
SubscriptionAlreadyExistFault–There is already an existing event notification subscription with the specified name.
-
SubscriptionCategoryNotFoundFault–The value specified for the event category was not one of the allowed values, or it specified a category that does not apply to the specified source type. The allowed values are Configuration, Management, Monitoring, and Security.
-
SubscriptionEventIdNotFoundFault–An Amazon Redshift event with the specified event ID does not exist.
-
SubscriptionSeverityNotFoundFault–The value specified for the event severity was not one of the allowed values, or it specified a severity that does not apply to the specified source type. The allowed values are ERROR and INFO.
-
TagLimitExceededFault–You have exceeded the number of tags allowed.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_redshift/_services/redshift.py
1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 | |