github.com/nevins-b/terraform@v0.3.8-0.20170215184714-bbae22007d5a/website/source/docs/providers/aws/r/db_event_subscription.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_db_event_subscription" 4 sidebar_current: "docs-aws-resource-db-event-subscription" 5 --- 6 7 # aws\_db\_event\_subscription 8 9 Provides a DB event subscription resource. 10 11 ## Example Usage 12 13 ``` 14 resource "aws_db_instance" "default" { 15 allocated_storage = 10 16 engine = "mysql" 17 engine_version = "5.6.17" 18 instance_class = "db.t1.micro" 19 name = "mydb" 20 username = "foo" 21 password = "bar" 22 db_subnet_group_name = "my_database_subnet_group" 23 parameter_group_name = "default.mysql5.6" 24 } 25 26 resource "aws_sns_topic" "default" { 27 name = "rds-events" 28 } 29 30 resource "aws_db_event_subscription" "default" { 31 name = "rds-event-sub" 32 sns_topic = "${aws_sns_topic.default.arn}" 33 34 source_type = "db-instance" 35 source_ids = [ "${aws_db_instance.default.id}" ] 36 event_categories = [ 37 "availability", 38 "deletion", 39 "failover", 40 "failure", 41 "low storage", 42 "maintenance", 43 "notification", 44 "read replica", 45 "recovery", 46 "restoration" 47 ] 48 } 49 ``` 50 51 ## Argument Reference 52 53 The following arguments are supported: 54 55 * `name` - (Required) The name of the DB event subscription. 56 * `sns_topic` - (Required) The SNS topic to send events to. 57 * `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. 58 * `source_type` - (Optional) The type of source that will be generating the events. 59 * `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 60 * `enabled` - (Optional) A boolean flag to enable/disable the subscription. Defaults to true. 61 * `tags` - (Optional) A mapping of tags to assign to the resource. 62 63 64 ## Import 65 66 DB Event Subscriptions can be imported using the `name`, e.g. 67 68 ``` 69 $ terraform import aws_db_event_subscription.default rds-event-sub 70 ```