Skip to content
GitHubXDiscord

Identity

The Identity resource allows you to manage AWS PinpointEmail Identitys for sending email messages. This resource helps in configuring email identity settings, including feedback forwarding and DKIM signing.

Create a basic email identity with essential properties such as name and DKIM signing enabled.

import AWS from "alchemy/aws/control";
const emailIdentity = await AWS.PinpointEmail.Identity("myEmailIdentity", {
Name: "contact@example.com",
DkimSigningEnabled: true,
FeedbackForwardingEnabled: false
});

Configure an email identity with additional properties like MailFromAttributes and Tags.

const advancedEmailIdentity = await AWS.PinpointEmail.Identity("advancedEmailIdentity", {
Name: "support@example.com",
DkimSigningEnabled: true,
FeedbackForwardingEnabled: true,
MailFromAttributes: {
MailFromDomain: "mail.example.com",
BehaviorOnMxFailure: "UseDefaultValue"
},
Tags: [
{ Key: "Team", Value: "Support" },
{ Key: "Project", Value: "EmailMarketing" }
]
});

Create an email identity while adopting an existing resource instead of failing if it already exists.

const adoptedEmailIdentity = await AWS.PinpointEmail.Identity("adoptedEmailIdentity", {
Name: "info@example.com",
DkimSigningEnabled: false,
FeedbackForwardingEnabled: true,
adopt: true
});

Add tags to an email identity for better organization and tracking.

const taggedEmailIdentity = await AWS.PinpointEmail.Identity("taggedEmailIdentity", {
Name: "newsletter@example.com",
DkimSigningEnabled: true,
Tags: [
{ Key: "Purpose", Value: "Newsletter" },
{ Key: "Environment", Value: "Production" }
]
});