EmailIdentity

class aws_cdk.aws_ses.EmailIdentity(scope, id, *, identity, configuration_set=None, dkim_identity=None, dkim_signing=None, feedback_forwarding=None, mail_from_behavior_on_mx_failure=None, mail_from_domain=None)

Bases: Resource

An email identity.

ExampleMetadata:

infused

Example:

import aws_cdk.aws_iam as iam
# user: iam.User


identity = ses.EmailIdentity(self, "Identity",
    identity=ses.Identity.domain("cdk.dev")
)

identity.grant_send_email(user)
Parameters:
  • scope (Construct) –

  • id (str) –

  • identity (Identity) – The email address or domain to verify.

  • configuration_set (Optional[IConfigurationSet]) – The configuration set to associate with the email identity. Default: - do not use a specific configuration set

  • dkim_identity (Optional[DkimIdentity]) – The type of DKIM identity to use. Default: - Easy DKIM with a key length of 2048-bit

  • dkim_signing (Optional[bool]) – Whether the messages that are sent from the identity are signed using DKIM. Default: true

  • feedback_forwarding (Optional[bool]) – 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). Default: true

  • mail_from_behavior_on_mx_failure (Optional[MailFromBehaviorOnMxFailure]) – The action to take if the required MX record for the MAIL FROM domain isn’t found when you send an email. Default: MailFromBehaviorOnMxFailure.USE_DEFAULT_VALUE

  • mail_from_domain (Optional[str]) – 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 Default: - use amazonses.com

Methods

apply_removal_policy(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).

Parameters:

policy (RemovalPolicy) –

Return type:

None

grant(grantee, *actions)

Adds an IAM policy statement associated with this email identity to an IAM principal’s policy.

Parameters:
  • grantee (IGrantable) – the principal (no-op if undefined).

  • actions (str) – the set of actions to allow.

Return type:

Grant

grant_send_email(grantee)

Permits an IAM principal the send email action.

Actions: SendEmail, SendRawEmail.

Parameters:

grantee (IGrantable) – the principal to grant access to.

Return type:

Grant

to_string()

Returns a string representation of this construct.

Return type:

str

Attributes

dkim_dns_token_name1

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

Attribute:

true

dkim_dns_token_name2

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

Attribute:

true

dkim_dns_token_name3

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

Attribute:

true

dkim_dns_token_value1

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

Attribute:

true

dkim_dns_token_value2

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

Attribute:

true

dkim_dns_token_value3

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

Attribute:

true

dkim_records

DKIM records for this identity.

email_identity_arn

The ARN of the email identity.

email_identity_name

The name of the email identity.

env

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

The tree node.

stack

The stack in which this resource is defined.

Static Methods

classmethod from_email_identity_name(scope, id, email_identity_name)

Use an existing email identity.

Parameters:
  • scope (Construct) –

  • id (str) –

  • email_identity_name (str) –

Return type:

IEmailIdentity

classmethod is_construct(x)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Construct.

classmethod is_owned_resource(construct)

Returns true if the construct was created by CDK, and false otherwise.

Parameters:

construct (IConstruct) –

Return type:

bool

classmethod is_resource(construct)

Check whether the given construct is a Resource.

Parameters:

construct (IConstruct) –

Return type:

bool