Menu
Amazon Relational Database Service
Command Line Interface Reference (API Version 2014-10-31)

rds-create-event-subscription

The Amazon RDS Command Line Interface (RDS CLI) has been deprecated. Instead, use the AWS CLI for RDS. To learn how to download and use the AWS CLI, see AWS Command Line Interface User Guide. For RDS commands available in the AWS CLI, see AWS CLI Reference for Amazon RDS.

The AWS CLI does not currently support the DownloadCompleteDBLogFile REST API action. To download an entire log file at once, rather than in parts using the download-db-log-file-portion command, use the last published RDS CLI and the rds-download-db-logfile command.

Description

Creates an Amazon RDS event notification subscription. This action requires a topic ARN created by either the RDS 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 Amazon SNS console.

You can specify the type of source (SourceType) you want to be notified of, provide a list of Amazon RDS sources (SourceIds) that triggers the events, and provide a list of event categories (EventCategories) for events you want to be notified of. For example, you can specify SourceType = db-instance, SourceIds = mydbinstance1, mydbinstance2 and EventCategories = Availability, Backup.

If you specify both the SourceType and SourceIds, such as SourceType = db-instance and SourceIdentifier = myDBInstance1, you will be notified of all the db-instance events for the specified source. If you specify a SourceType but do not specify a SourceIdentifier, you will receive notice of the events for that source type for all your RDS sources. If you do not specify either the SourceType nor the SourceIdentifier, you will be notified of events generated from all Amazon RDS sources belonging to your customer account.

Syntax

rds-create-event-subscription subscription-name

-t (--sns-topic-arn) value

[--event-categories value ]

[--source-ids value ]

[-s (--source-type) value ]

[--disable value ]

[-tk (--tag-key) value ]

[-tv (--tag-value) value ]

[General Options]

Options

Name Description Required

--subscription-name value

The name of the subscription.

This parameter is the default parameter and can be passed as the first value in the command and without a parameter name, for example: rds-create-event-subscription my-subscription-name.

Type: String

Constraints: The name must be less than 255 characters.

Example: --subscription-name mysubscription1

Yes

--sns-topic-arn value

-t value

The Amazon Resource Name (ARN) of the Amazon SNS topic created for event notification. The ARN is created by Amazon SNS when you create a topic and subscribe to it.

Yes

--event-categories value

A list of event categories for a SourceType that you want to subscribe to.You can see a list of the categories for a given SourceType in the Events topic in the Amazon Relational Database Service User Guide.

Type: String list

No

--source-ids value

A list of identifiers of the event sources for which events will be returned. If not specified, then all sources are included in the response. An identifier must begin with a letter and must contain only ASCII letters, digits, and hyphens; it cannot end with a hyphen or contain two consecutive hyphens.

Type: String list

Constraints:

If SourceIds are supplied, SourceType must also be provided.

If the source type is a DB instance, then a DB instance identifier must be supplied.

If the source type is a DB security group, a DB security group name must be supplied.

If the source type is a DB parameter group, a DB parameter group name must be supplied.

If the source type is a DB snapshot, a DB snapshot identifier must be supplied.

No

--source-type value

-s value

The type of source that will be generating the events. For example, if you want to be notified of events generated by a DB instance, you would set this parameter to db-instance. if this value is not specified, all events are returned.

Valid values: db-instance | db-parameter-group | db-security-group | db-snapshot

Type: String

No

--disable value

A Boolean value; set to false to activate the subscription. You can set this value to true if you want to create the subscription but not activate it. The default is true.

Type: Boolean

No

--tag-key

-tk

The name of a tag to add for the new event subscription.

No

--tag-value

-tv

The value of the tag to add for the new event subscription.

No

Output

The command returns a table with the following information:

Note

Output values list the possible values returned by CLI commands. Not all values are returned for every call to a command. If a value is null or empty, it will not be included in the command output. For example, CLI commands to create or restore a DB instance will not return the Endpoint Address value because that value is null until the DB instance has finished being created or restored.

  • CustSubscriptionId—the Id of the event subscription

  • CustomerAwsId—the AWS customer account associated with the Amazon RDS event notification subscription

  • Enabled—a Boolean value indicating if the subscription is enabled. True indicates the subscription is enabled

  • EventCategoriesList—a list of event categories for the Amazon RDS event notification subscription

  • SnsTopicArn—the Amazon SNS topic's ARN for the Amazon RDS event notification subscription

  • SourceIdsList—a list of source Ids for the Amazon RDS event notification subscription

  • SourceType—the source type for the Amazon RDS event notification subscription

  • Status—the status of the Amazon RDS event notification subscription. Can be one of the following: creating | modifying | deleting | active | no-permission | topic-not-exist

    The status "no-permission" indicates that Amazon RDS 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.

  • SubscriptionCreationTime—the time the RDS event notification subscription was created

Examples

Creating an event subscription

This example creates a subscription called MySubscription1 that receives event notifications whenever a Failover category event occurs for the DB instance named MyDBInstance1. value of

Copy
PROMPT> rds-create-event-subscription MySubscription1 -t arn:aws:sns:us-west-2:803981917763:MyTopic --SourceIds MyDBInstance1 --SourceType db-instance --EventCategories Failover

Creating an event subscription with multiple source Ids and event categories

This example creates a subscription called MySubscription2 that receives event notifications from the Failure and Configuration Change event categories for a DB instance and a DB security group.

Copy
PROMPT> rds-create-event-subscription MySubscription2 -t arn:aws:sns:us-west-2:803981917763:MyTopic --SourceIds MyDBInstance1, MySecurityGroup1 --SourceType db-instance, db-security-group --EventCategories Failure, Configuration Change