EmailChannel class
> NOTE: This resource is deprecated. AWS End User Messaging email features are being discontinued on October 30, 2026. Migrate to Amazon SES using aws.ses.DomainIdentity, aws.sesv2.EmailIdentity, and related SES/SESv2 resources. See the AWS End User Messaging migration guide for details.
Provides an End User Messaging Email Channel resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const app = new aws.pinpoint.App("app", {});
const assumeRole = aws.iam.getPolicyDocument({
statements: [{
principals: [{
type: "Service",
identifiers: ["pinpoint.amazonaws.com"],
}],
effect: "Allow",
actions: ["sts:AssumeRole"],
}],
});
const role = new aws.iam.Role("role", {assumeRolePolicy: assumeRole.then(assumeRole => assumeRole.json)});
const email = new aws.pinpoint.EmailChannel("email", {
applicationId: app.applicationId,
fromAddress: "user@example.com",
roleArn: role.arn,
});
const identity = new aws.ses.DomainIdentity("identity", {domain: "example.com"});
const rolePolicy = aws.iam.getPolicyDocument({
statements: [{
effect: "Allow",
actions: [
"mobileanalytics:PutEvents",
"mobileanalytics:PutItems",
],
resources: ["*"],
}],
});
const rolePolicyRolePolicy = new aws.iam.RolePolicy("role_policy", {
name: "role_policy",
role: role.id,
policy: rolePolicy.then(rolePolicy => rolePolicy.json),
});
import pulumi
import pulumi_aws as aws
app = aws.pinpoint.App("app")
assume_role = aws.iam.get_policy_document(statements=[{
"principals": [{
"type": "Service",
"identifiers": ["pinpoint.amazonaws.com"],
}],
"effect": "Allow",
"actions": ["sts:AssumeRole"],
}])
role = aws.iam.Role("role", assume_role_policy=assume_role.json)
email = aws.pinpoint.EmailChannel("email",
application_id=app.application_id,
from_address="user@example.com",
role_arn=role.arn)
identity = aws.ses.DomainIdentity("identity", domain="example.com")
role_policy = aws.iam.get_policy_document(statements=[{
"effect": "Allow",
"actions": [
"mobileanalytics:PutEvents",
"mobileanalytics:PutItems",
],
"resources": ["*"],
}])
role_policy_role_policy = aws.iam.RolePolicy("role_policy",
name="role_policy",
role=role.id,
policy=role_policy.json)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var app = new Aws.Pinpoint.App("app");
var assumeRole = Aws.Iam.GetPolicyDocument.Invoke(new()
{
Statements = new[]
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
{
Principals = new[]
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs
{
Type = "Service",
Identifiers = new[]
{
"pinpoint.amazonaws.com",
},
},
},
Effect = "Allow",
Actions = new[]
{
"sts:AssumeRole",
},
},
},
});
var role = new Aws.Iam.Role("role", new()
{
AssumeRolePolicy = assumeRole.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
});
var email = new Aws.Pinpoint.EmailChannel("email", new()
{
ApplicationId = app.ApplicationId,
FromAddress = "user@example.com",
RoleArn = role.Arn,
});
var identity = new Aws.Ses.DomainIdentity("identity", new()
{
Domain = "example.com",
});
var rolePolicy = Aws.Iam.GetPolicyDocument.Invoke(new()
{
Statements = new[]
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
{
Effect = "Allow",
Actions = new[]
{
"mobileanalytics:PutEvents",
"mobileanalytics:PutItems",
},
Resources = new[]
{
"*",
},
},
},
});
var rolePolicyRolePolicy = new Aws.Iam.RolePolicy("role_policy", new()
{
Name = "role_policy",
Role = role.Id,
Policy = rolePolicy.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/iam"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/pinpoint"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/ses"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
app, err := pinpoint.NewApp(ctx, "app", nil)
if err != nil {
return err
}
assumeRole, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
Statements: []iam.GetPolicyDocumentStatement{
{
Principals: []iam.GetPolicyDocumentStatementPrincipal{
{
Type: "Service",
Identifiers: []string{
"pinpoint.amazonaws.com",
},
},
},
Effect: pulumi.StringRef("Allow"),
Actions: []string{
"sts:AssumeRole",
},
},
},
}, nil)
if err != nil {
return err
}
role, err := iam.NewRole(ctx, "role", &iam.RoleArgs{
AssumeRolePolicy: pulumi.String(assumeRole.Json),
})
if err != nil {
return err
}
_, err = pinpoint.NewEmailChannel(ctx, "email", &pinpoint.EmailChannelArgs{
ApplicationId: app.ApplicationId,
FromAddress: pulumi.String("user@example.com"),
RoleArn: role.Arn,
})
if err != nil {
return err
}
_, err = ses.NewDomainIdentity(ctx, "identity", &ses.DomainIdentityArgs{
Domain: pulumi.String("example.com"),
})
if err != nil {
return err
}
rolePolicy, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
Statements: []iam.GetPolicyDocumentStatement{
{
Effect: pulumi.StringRef("Allow"),
Actions: []string{
"mobileanalytics:PutEvents",
"mobileanalytics:PutItems",
},
Resources: []string{
"*",
},
},
},
}, nil)
if err != nil {
return err
}
_, err = iam.NewRolePolicy(ctx, "role_policy", &iam.RolePolicyArgs{
Name: pulumi.String("role_policy"),
Role: role.ID().ToIDOutput().ToStringOutput(),
Policy: pulumi.String(rolePolicy.Json),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
data "aws_iam_getpolicydocument" "assumeRole" {
statements {
principals {
type = "Service"
identifiers = ["pinpoint.amazonaws.com"]
}
effect = "Allow"
actions = ["sts:AssumeRole"]
}
}
data "aws_iam_getpolicydocument" "rolePolicy" {
statements {
effect = "Allow"
actions = ["mobileanalytics:PutEvents", "mobileanalytics:PutItems"]
resources = ["*"]
}
}
resource "aws_pinpoint_emailchannel" "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_domainidentity" "identity" {
domain = "example.com"
}
resource "aws_iam_role" "role" {
assume_role_policy = data.aws_iam_getpolicydocument.assumeRole.json
}
resource "aws_iam_rolepolicy" "role_policy" {
name = "role_policy"
role = aws_iam_role.role.id
policy = data.aws_iam_getpolicydocument.rolePolicy.json
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.pinpoint.App;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentStatementArgs;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentStatementPrincipalArgs;
import com.pulumi.aws.iam.Role;
import com.pulumi.aws.iam.RoleArgs;
import com.pulumi.aws.pinpoint.EmailChannel;
import com.pulumi.aws.pinpoint.EmailChannelArgs;
import com.pulumi.aws.ses.DomainIdentity;
import com.pulumi.aws.ses.DomainIdentityArgs;
import com.pulumi.aws.iam.RolePolicy;
import com.pulumi.aws.iam.RolePolicyArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var app = new App("app");
final var assumeRole = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
.statements(GetPolicyDocumentStatementArgs.builder()
.principals(GetPolicyDocumentStatementPrincipalArgs.builder()
.type("Service")
.identifiers("pinpoint.amazonaws.com")
.build())
.effect("Allow")
.actions("sts:AssumeRole")
.build())
.build());
var role = new Role("role", RoleArgs.builder()
.assumeRolePolicy(assumeRole.json())
.build());
var email = new EmailChannel("email", EmailChannelArgs.builder()
.applicationId(app.applicationId())
.fromAddress("user@example.com")
.roleArn(role.arn())
.build());
var identity = new DomainIdentity("identity", DomainIdentityArgs.builder()
.domain("example.com")
.build());
final var rolePolicy = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
.statements(GetPolicyDocumentStatementArgs.builder()
.effect("Allow")
.actions(
"mobileanalytics:PutEvents",
"mobileanalytics:PutItems")
.resources("*")
.build())
.build());
var rolePolicyRolePolicy = new RolePolicy("rolePolicyRolePolicy", RolePolicyArgs.builder()
.name("role_policy")
.role(role.id())
.policy(rolePolicy.json())
.build());
}
}
resources:
email:
type: aws:pinpoint:EmailChannel
properties:
applicationId: ${app.applicationId}
fromAddress: user@example.com
roleArn: ${role.arn}
app:
type: aws:pinpoint:App
identity:
type: aws:ses:DomainIdentity
properties:
domain: example.com
role:
type: aws:iam:Role
properties:
assumeRolePolicy: ${assumeRole.json}
rolePolicyRolePolicy:
type: aws:iam:RolePolicy
name: role_policy
properties:
name: role_policy
role: ${role.id}
policy: ${rolePolicy.json}
variables:
assumeRole:
fn::invoke:
function: aws:iam:getPolicyDocument
arguments:
statements:
- principals:
- type: Service
identifiers:
- pinpoint.amazonaws.com
effect: Allow
actions:
- sts:AssumeRole
rolePolicy:
fn::invoke:
function: aws:iam:getPolicyDocument
arguments:
statements:
- effect: Allow
actions:
- mobileanalytics:PutEvents
- mobileanalytics:PutItems
resources:
- '*'
Import
Using pulumi import, import End User Messaging Email Channel using the application-id. For example:
$ pulumi import aws:pinpoint/emailChannel:EmailChannel email application-id
Constructors
- EmailChannel(String name, {EmailChannelArgs? args, CustomResourceOptions? options})
-
Creates a new EmailChannel.
nameThe Pulumi resource name.argsArguments used to configure this EmailChannel. The set of arguments for EmailChannel.optionsResource options controlling this resource's behavior. - EmailChannel.reference(String urn)
- Creates a typed reference to an existing EmailChannel resource.
Properties
-
applicationId
↔ Output<
String> -
Application ID.
latefinal
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
configurationSet
↔ Output<
String?> -
ARN of the Amazon SES configuration set that you want to apply to messages that you send through the channel.
latefinal
-
enabled
↔ Output<
bool?> -
Whether the channel is enabled or disabled. Defaults to
true.latefinal -
fromAddress
↔ Output<
String> -
Email address used to send emails from. You can use email only (
user@example.com) or friendly address (User <user@example.com>). This field comply with RFC 5322.latefinal - hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
-
identity
↔ Output<
String> -
ARN of an identity verified with SES.
latefinal
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
messagesPerSecond
↔ Output<
int> -
(Deprecated) Messages per second that can be sent.
latefinal
-
orchestrationSendingRoleArn
↔ Output<
String?> -
ARN of an IAM role for AWS End User Messaging to use to send email from your campaigns or journeys through Amazon SES.
latefinal
-
region
↔ Output<
String> -
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
-
roleArn
↔ Output<
String?> -
ARN of an IAM Role used to submit events to Mobile Analytics' event ingestion service.
latefinal
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {EmailChannelState? state, CustomResourceOptions? options}) → EmailChannel -
Gets an existing EmailChannel resource's state with the given
nameandid.