Resource: aws_sesv2_configuration_set_event_destination

Terraform resource for managing an AWS SESv2 (Simple Email V2) Configuration Set Event Destination.

Example Usage

Cloud Watch Destination

resource "aws_sesv2_configuration_set" "example" {
  configuration_set_name = "example"
}

resource "aws_sesv2_configuration_set_event_destination" "example" {
  configuration_set_name = aws_sesv2_configuration_set.example.configuration_set_name
  event_destination_name = "example"

  event_destination {
    cloud_watch_destination {
      dimension_configuration {
        default_dimension_value = "example"
        dimension_name          = "example"
        dimension_value_source  = "MESSAGE_TAG"
      }
    }

    enabled              = true
    matching_event_types = ["SEND"]
  }
}

Kinesis Firehose Destination

resource "aws_sesv2_configuration_set" "example" {
  configuration_set_name = "example"
}

resource "aws_sesv2_configuration_set_event_destination" "example" {
  configuration_set_name = aws_sesv2_configuration_set.example.configuration_set_name
  event_destination_name = "example"

  event_destination {
    kinesis_firehose_destination {
      delivery_stream_arn = aws_kinesis_firehose_delivery_stream.example.arn
      iam_role_arn        = aws_iam_role.example.arn
    }

    enabled              = true
    matching_event_types = ["SEND"]
  }
}

Pinpoint Destination

resource "aws_sesv2_configuration_set" "example" {
  configuration_set_name = "example"
}

resource "aws_sesv2_configuration_set_event_destination" "example" {
  configuration_set_name = aws_sesv2_configuration_set.example.configuration_set_name
  event_destination_name = "example"

  event_destination {
    pinpoint_destination {
      application_arn = aws_pinpoint_app.example.arn
    }

    enabled              = true
    matching_event_types = ["SEND"]
  }
}

SNS Destination

resource "aws_sesv2_configuration_set" "example" {
  configuration_set_name = "example"
}

resource "aws_sesv2_configuration_set_event_destination" "example" {
  configuration_set_name = aws_sesv2_configuration_set.example.configuration_set_name
  event_destination_name = "example"

  event_destination {
    sns_destination {
      topic_arn = aws_sns_topic.example.arn
    }

    enabled              = true
    matching_event_types = ["SEND"]
  }
}

Argument Reference

The following arguments are required:

event_destination

The following arguments are required:

The following arguments are optional:

cloud_watch_destination

The following arguments are required:

dimension_configuration

The following arguments are required:

kinesis_firehose_destination

The following arguments are required:

pinpoint_destination

The following arguments are required:

sns_destination

The following arguments are required:

Attribute Reference

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

Import

In Terraform v1.5.0 and later, use an import block to import SESv2 (Simple Email V2) Configuration Set Event Destination using the id (configuration_set_name|event_destination_name). For example:

import {
  to = aws_sesv2_configuration_set_event_destination.example
  id = "example_configuration_set|example_event_destination"
}

Using terraform import, import SESv2 (Simple Email V2) Configuration Set Event Destination using the id (configuration_set_name|event_destination_name). For example:

% terraform import aws_sesv2_configuration_set_event_destination.example example_configuration_set|example_event_destination