More complex example for db_event_subscription (#11513)

This commit is contained in:
Thomas Schaaf 2017-01-30 13:13:02 +01:00 committed by Paul Stack
parent 8ea5d53954
commit 22cbca240c
1 changed files with 28 additions and 1 deletions

View File

@ -11,6 +11,18 @@ Provides a DB event subscription resource.
## Example Usage
```
resource "aws_db_instance" "default" {
allocated_storage = 10
engine = "mysql"
engine_version = "5.6.17"
instance_class = "db.t1.micro"
name = "mydb"
username = "foo"
password = "bar"
db_subnet_group_name = "my_database_subnet_group"
parameter_group_name = "default.mysql5.6"
}
resource "aws_sns_topic" "default" {
name = "rds-events"
}
@ -18,6 +30,21 @@ resource "aws_sns_topic" "default" {
resource "aws_db_event_subscription" "default" {
name = "rds-event-sub"
sns_topic = "${aws_sns_topic.default.arn}"
source_type = "db-instance"
source_ids = [ "${aws_db_instance.default.id}" ]
event_categories = [
"availability",
"deletion",
"failover",
"failure",
"low storage",
"maintenance",
"notification",
"read replica",
"recovery",
"restoration"
]
}
```
@ -29,7 +56,7 @@ The following arguments are supported:
* `sns_topic` - (Required) The SNS topic to send events to.
* `source_ids` - (Optional) 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. If specified, a source_type must also be specified.
* `source_type` - (Optional) The type of source that will be generating the events.
* `event_categories` - (Optional) A list of event categories for a SourceType that you want to subscribe to.
* `event_categories` - (Optional) A list of event categories for a SourceType that you want to subscribe to. See http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide//USER_Events.html
* `enabled` - (Optional) A boolean flag to enable/disable the subscription. Defaults to true.
* `tags` - (Optional) A mapping of tags to assign to the resource.