class EmailIdentity (construct)
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.SES.EmailIdentity |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsses#EmailIdentity |
![]() | software.amazon.awscdk.services.ses.EmailIdentity |
![]() | aws_cdk.aws_ses.EmailIdentity |
![]() | aws-cdk-lib » aws_ses » EmailIdentity |
Implements
IConstruct
, IDependable
, IResource
, IEmail
An email identity.
Example
import * as iam from 'aws-cdk-lib/aws-iam';
declare const user: iam.User;
const identity = new ses.EmailIdentity(this, 'Identity', {
identity: ses.Identity.domain('cdk.dev'),
});
identity.grantSendEmail(user);
Initializer
new EmailIdentity(scope: Construct, id: string, props: EmailIdentityProps)
Parameters
- scope
Construct
- id
string
- props
Email
Identity Props
Construct Props
Name | Type | Description |
---|---|---|
identity | Identity | The email address or domain to verify. |
configuration | IConfiguration | The configuration set to associate with the email identity. |
dkim | Dkim | The type of DKIM identity to use. |
dkim | boolean | Whether the messages that are sent from the identity are signed using DKIM. |
feedback | boolean | Whether to receive email notifications when bounce or complaint events occur. |
mail | Mail | The action to take if the required MX record for the MAIL FROM domain isn't found when you send an email. |
mail | string | The custom MAIL FROM domain that you want the verified identity to use. |
identity
Type:
Identity
The email address or domain to verify.
configurationSet?
Type:
IConfiguration
(optional, default: do not use a specific configuration set)
The configuration set to associate with the email identity.
dkimIdentity?
Type:
Dkim
(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:
Mail
(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
Name | Type | Description |
---|---|---|
dkim | string | The host name for the first token that you have to add to the DNS configurationfor your domain. |
dkim | string | The host name for the second token that you have to add to the DNS configuration for your domain. |
dkim | string | The host name for the third token that you have to add to the DNS configuration for your domain. |
dkim | string | The record value for the first token that you have to add to the DNS configuration for your domain. |
dkim | string | The record value for the second token that you have to add to the DNS configuration for your domain. |
dkim | string | The record value for the third token that you have to add to the DNS configuration for your domain. |
dkim | Dkim [] | DKIM records for this identity. |
email | string | The ARN of the email identity. |
email | string | The name of the email identity. |
env | Resource | The environment this resource belongs to. |
node | Node | The tree node. |
stack | Stack | The 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:
Dkim
[]
DKIM records for this identity.
emailIdentityArn
Type:
string
The ARN of the email identity.
emailIdentityName
Type:
string
The name of the email identity.
env
Type:
Resource
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
Name | Description |
---|---|
apply | Apply the given removal policy to this resource. |
grant(grantee, ...actions) | Adds an IAM policy statement associated with this email identity to an IAM principal's policy. |
grant | Permits an IAM principal the send email action. |
to | Returns a string representation of this construct. |
static from | Use an existing email identity. |
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
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
).
grant(grantee, ...actions)
public grant(grantee: IGrantable, ...actions: string[]): Grant
Parameters
- grantee
IGrantable
— the principal (no-op if undefined). - actions
string
— the set of actions to allow.
Returns
Adds an IAM policy statement associated with this email identity to an IAM principal's policy.
grantSendEmail(grantee)
public grantSendEmail(grantee: IGrantable): Grant
Parameters
- grantee
IGrantable
— the principal to grant access to.
Returns
Permits an IAM principal the send email action.
Actions: SendEmail, SendRawEmail.
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
Use an existing email identity.