aws-cdk-lib.aws_ses.EmailIdentity

class EmailIdentity (construct)

LanguageType name
.NETAmazon.CDK.AWS.SES.EmailIdentity
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsses#EmailIdentity
Javasoftware.amazon.awscdk.services.ses.EmailIdentity
Pythonaws_cdk.aws_ses.EmailIdentity
TypeScript (source)aws-cdk-lib » aws_ses » EmailIdentity

Implements IConstruct, IDependable, IResource, IEmailIdentity

An email identity.

Example

declare const myHostedZone: route53.IPublicHostedZone;

const identity = new ses.EmailIdentity(this, 'Identity', {
  identity: ses.Identity.publicHostedZone(myHostedZone),
  mailFromDomain: 'mail.cdk.dev',
});

Initializer

new EmailIdentity(scope: Construct, id: string, props: EmailIdentityProps)

Parameters

  • scope Construct
  • id string
  • props EmailIdentityProps

Construct Props

NameTypeDescription
identityIdentityThe email address or domain to verify.
configurationSet?IConfigurationSetThe configuration set to associate with the email identity.
dkimIdentity?DkimIdentityThe type of DKIM identity to use.
dkimSigning?booleanWhether the messages that are sent from the identity are signed using DKIM.
feedbackForwarding?booleanWhether to receive email notifications when bounce or complaint events occur.
mailFromBehaviorOnMxFailure?MailFromBehaviorOnMxFailureThe action to take if the required MX record for the MAIL FROM domain isn't found when you send an email.
mailFromDomain?stringThe custom MAIL FROM domain that you want the verified identity to use.

identity

Type: Identity

The email address or domain to verify.


configurationSet?

Type: IConfigurationSet (optional, default: do not use a specific configuration set)

The configuration set to associate with the email identity.


dkimIdentity?

Type: DkimIdentity (optional, default: Easy DKIM with a key length of 2048-bit)

The type of DKIM identity to use.


dkimSigning?

Type: boolean (optional, default: true)

Whether the messages that are sent from the identity are signed using DKIM.


feedbackForwarding?

Type: boolean (optional, default: true)

Whether to receive email notifications when bounce or complaint events occur.

These notifications are sent to the address that you specified in the Return-Path header of the original email.

You're required to have a method of tracking bounces and complaints. If you haven't set up another mechanism for receiving bounce or complaint notifications (for example, by setting up an event destination), you receive an email notification when these events occur (even if this setting is disabled).


mailFromBehaviorOnMxFailure?

Type: MailFromBehaviorOnMxFailure (optional, default: MailFromBehaviorOnMxFailure.USE_DEFAULT_VALUE)

The action to take if the required MX record for the MAIL FROM domain isn't found when you send an email.


mailFromDomain?

Type: string (optional, default: use amazonses.com)

The custom MAIL FROM domain that you want the verified identity to use.

The MAIL FROM domain must meet the following criteria:

  • It has to be a subdomain of the verified identity
  • It can't be used to receive email
  • It can't be used in a "From" address if the MAIL FROM domain is a destination for feedback forwarding emails

Properties

NameTypeDescription
dkimDnsTokenName1stringThe host name for the first token that you have to add to the DNS configurationfor your domain.
dkimDnsTokenName2stringThe host name for the second token that you have to add to the DNS configuration for your domain.
dkimDnsTokenName3stringThe host name for the third token that you have to add to the DNS configuration for your domain.
dkimDnsTokenValue1stringThe record value for the first token that you have to add to the DNS configuration for your domain.
dkimDnsTokenValue2stringThe record value for the second token that you have to add to the DNS configuration for your domain.
dkimDnsTokenValue3stringThe record value for the third token that you have to add to the DNS configuration for your domain.
dkimRecordsDkimRecord[]DKIM records for this identity.
emailIdentityNamestringThe name of the email identity.
envResourceEnvironmentThe environment this resource belongs to.
nodeNodeThe tree node.
stackStackThe stack in which this resource is defined.

dkimDnsTokenName1

Type: string

The host name for the first token that you have to add to the DNS configurationfor your domain.


dkimDnsTokenName2

Type: string

The host name for the second token that you have to add to the DNS configuration for your domain.


dkimDnsTokenName3

Type: string

The host name for the third token that you have to add to the DNS configuration for your domain.


dkimDnsTokenValue1

Type: string

The record value for the first token that you have to add to the DNS configuration for your domain.


dkimDnsTokenValue2

Type: string

The record value for the second token that you have to add to the DNS configuration for your domain.


dkimDnsTokenValue3

Type: string

The record value for the third token that you have to add to the DNS configuration for your domain.


dkimRecords

Type: DkimRecord[]

DKIM records for this identity.


emailIdentityName

Type: string

The name of the email identity.


env

Type: ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


node

Type: Node

The tree node.


stack

Type: Stack

The stack in which this resource is defined.

Methods

NameDescription
applyRemovalPolicy(policy)Apply the given removal policy to this resource.
toString()Returns a string representation of this construct.
static fromEmailIdentityName(scope, id, emailIdentityName)Use an existing email identity.

applyRemovalPolicy(policy)

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).


toString()

public toString(): string

Returns

  • string

Returns a string representation of this construct.


static fromEmailIdentityName(scope, id, emailIdentityName)

public static fromEmailIdentityName(scope: Construct, id: string, emailIdentityName: string): IEmailIdentity

Parameters

  • scope Construct
  • id string
  • emailIdentityName string

Returns

  • IEmailIdentity

Use an existing email identity.