Resource: aws_docdb_event_subscription

Provides a DocumentDB event subscription resource.

Example Usage

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
}

Argument Reference

This resource supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Timeouts

Configuration options:

Import

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