Resource: aws_pinpoint_email_channel

Provides a Pinpoint Email Channel resource.

Example Usage

resource "aws_pinpoint_email_channel" "email" {
  application_id = aws_pinpoint_app.app.application_id
  from_address   = "user@example.com"
  role_arn       = aws_iam_role.role.arn
}

resource "aws_pinpoint_app" "app" {}

resource "aws_ses_domain_identity" "identity" {
  domain = "example.com"
}

data "aws_iam_policy_document" "assume_role" {
  statement {
    effect = "Allow"

    principals {
      type        = "Service"
      identifiers = ["pinpoint.amazonaws.com"]
    }

    actions = ["sts:AssumeRole"]
  }
}

resource "aws_iam_role" "role" {
  assume_role_policy = data.aws_iam_policy_document.assume_role.json
}

data "aws_iam_policy_document" "role_policy" {
  statement {
    effect = "Allow"

    actions = [
      "mobileanalytics:PutEvents",
      "mobileanalytics:PutItems",
    ]

    resources = ["*"]
  }
}

resource "aws_iam_role_policy" "role_policy" {
  name   = "role_policy"
  role   = aws_iam_role.role.id
  policy = data.aws_iam_policy_document.role_policy.json
}

Argument Reference

This resource supports the following arguments:

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 Pinpoint Email Channel using the application-id. For example:

import {
  to = aws_pinpoint_email_channel.email
  id = "application-id"
}

Using terraform import, import Pinpoint Email Channel using the application-id. For example:

% terraform import aws_pinpoint_email_channel.email application-id