github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/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 37 event_categories = [ 38 "availability", 39 "deletion", 40 "failover", 41 "failure", 42 "low storage", 43 "maintenance", 44 "notification", 45 "read replica", 46 "recovery", 47 "restoration", 48 ] 49 } 50 ``` 51 52 ## Argument Reference 53 54 The following arguments are supported: 55 56 * `name` - (Required) The name of the DB event subscription. 57 * `sns_topic` - (Required) The SNS topic to send events to. 58 * `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. 59 * `source_type` - (Optional) The type of source that will be generating the events. 60 * `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 61 * `enabled` - (Optional) A boolean flag to enable/disable the subscription. Defaults to true. 62 * `tags` - (Optional) A mapping of tags to assign to the resource. 63 64 65 ## Import 66 67 DB Event Subscriptions can be imported using the `name`, e.g. 68 69 ``` 70 $ terraform import aws_db_event_subscription.default rds-event-sub 71 ```