Provides a DocumentDB event subscription resource.
resource "aws_docdb_cluster" "example" {
cluster_identifier = "example"
availability_zones = [data.aws_availability_zones.available.names[0], data.aws_availability_zones.available.names[1], data.aws_availability_zones.available.names[2]]
master_username = "foo"
master_password = "mustbeeightcharaters"
skip_final_snapshot = true
}
resource "aws_sns_topic" "example" {
name = "example-events"
}
resource "aws_docdb_event_subscription" "example" {
name = "example"
enabled = true
event_categories = ["creation", "failure"]
source_type = "db-cluster"
source_ids = [aws_docdb_cluster.example.id]
sns_topic_arn = aws_sns_topic.example.arn
}
This resource supports the following arguments:
name
- (Optional) The name of the DocumentDB event subscription. By default generated by Terraform.name_prefix
- (Optional) The name of the DocumentDB event subscription. Conflicts with name
.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. Valid options are db-instance
, db-cluster
, db-parameter-group
, db-security-group
,db-cluster-snapshot
. If not set, all sources will be subscribed to.event_categories
- (Optional) A list of event categories for a SourceType that you want to subscribe to. See https://docs.aws.amazon.com/documentdb/latest/developerguide/API_Event.html or run aws docdb describe-event-categories
.enabled
- (Optional) A boolean flag to enable/disable the subscription. Defaults to true.tags
- (Optional) A map of tags to assign to the resource. If configured with a provider default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.This resource exports the following attributes in addition to the arguments above:
id
- The name of the DocumentDB event notification subscriptionarn
- The Amazon Resource Name of the DocumentDB event notification subscriptioncustomer_aws_id
- The AWS customer account associated with the DocumentDB event notification subscriptiontags_all
- A map of tags assigned to the resource, including those inherited from the provider default_tags
configuration block.create
- (Default 40m
)delete
- (Default 40m
)update
- (Default 40m
)In Terraform v1.5.0 and later, use an import
block to import DocumentDB Event Subscriptions using the name
. For example:
import {
to = aws_docdb_event_subscription.example
id = "event-sub"
}
Using terraform import
, import DocumentDB Event Subscriptions using the name
. For example:
% terraform import aws_docdb_event_subscription.example event-sub