Skip to content

Resource: awsSesv2EmailIdentity

Terraform resource for managing an AWS SESv2 (Simple Email V2) Email Identity.

Example Usage

Basic Usage

Email Address Identity

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.sesv2EmailIdentity.Sesv2EmailIdentity(this, "example", {
  emailIdentity: "testing@example.com",
});

Domain Identity

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.sesv2EmailIdentity.Sesv2EmailIdentity(this, "example", {
  emailIdentity: "example.com",
});

Configuration Set

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsSesv2ConfigurationSetExample =
  new aws.sesv2ConfigurationSet.Sesv2ConfigurationSet(this, "example", {
    configurationSetName: "example",
  });
const awsSesv2EmailIdentityExample =
  new aws.sesv2EmailIdentity.Sesv2EmailIdentity(this, "example_1", {
    configurationSetName: awsSesv2ConfigurationSetExample.configurationSetName,
    emailIdentity: "example.com",
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsSesv2EmailIdentityExample.overrideLogicalId("example");

DKIM Signing Attributes (BYODKIM)

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.sesv2EmailIdentity.Sesv2EmailIdentity(this, "example", {
  dkimSigningAttributes: {
    domainSigningPrivateKey:
      "MIIJKAIBAAKCAgEA2Se7p8zvnI4yh+Gh9j2rG5e2aRXjg03Y8saiupLnadPH9xvM...",
    domainSigningSelector: "example",
  },
  emailIdentity: "example.com",
});

Argument Reference

The following arguments are supported:

  • emailIdentity - (Required) The email address or domain to verify.
  • configurationSetName - (Optional) The configuration set to use by default when sending from this identity. Note that any configuration set defined in the email sending request takes precedence.
  • dkimSigningAttributes - (Optional) The configuration of the DKIM authentication settings for an email domain identity.

dkimSigningAttributes

  • domainSigningPrivateKey - (Optional) [Bring Your Own DKIM] A private key that's used to generate a DKIM signature. The private key must use 1024 or 2048-bit RSA encryption, and must be encoded using base64 encoding.

-> NOTE: You have to delete the first and last lines ('-----BEGIN PRIVATE KEY-----' and '-----END PRIVATE KEY-----', respectively) of the generated private key. Additionally, you have to remove the line breaks in the generated private key. The resulting value is a string of characters with no spaces or line breaks.

  • domainSigningSelector - (Optional) [Bring Your Own DKIM] A string that's used to identify a public key in the DNS configuration for a domain.
  • nextSigningKeyLength - (Optional) [Easy DKIM] The key length of the future DKIM key pair to be generated. This can be changed at most once per day. Valid values: RSA_1024_BIT, RSA_2048_BIT.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • arn - ARN of the Email Identity.
  • dkimSigningAttributes - An object that contains information about the private key and selector that you want to use to configure DKIM for the identity for Bring Your Own DKIM (BYODKIM) for the identity, or, configures the key length to be used for Easy DKIM.
  • currentSigningKeyLength - [Easy DKIM] The key length of the DKIM key pair in use.
  • lastKeyGenerationTimestamp - [Easy DKIM] The last time a key pair was generated for this identity.
  • nextSigningKeyLength - [Easy DKIM] The key length of the future DKIM key pair to be generated. This can be changed at most once per day.
  • signingAttributesOrigin - A string that indicates how DKIM was configured for the identity. AWS_SES indicates that DKIM was configured for the identity by using Easy DKIM. external indicates that DKIM was configured for the identity by using Bring Your Own DKIM (BYODKIM).
  • status - Describes whether or not Amazon SES has successfully located the DKIM records in the DNS records for the domain. See the AWS SES API v2 Reference for supported statuses.
  • tokens - If you used Easy DKIM to configure DKIM authentication for the domain, then this object contains a set of unique strings that you use to create a set of CNAME records that you add to the DNS configuration for your domain. When Amazon SES detects these records in the DNS configuration for your domain, the DKIM authentication process is complete. If you configured DKIM authentication for the domain by providing your own public-private key pair, then this object contains the selector for the public key.
  • identityType - The email identity type. Valid values: EMAIL_ADDRESS, domain.
  • tags - (Optional) A map of tags to assign to the service. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
  • verifiedForSendingStatus - Specifies whether or not the identity is verified.

Import

SESv2 (Simple Email V2) Email Identity can be imported using the emailIdentity, e.g.,

$ terraform import aws_sesv2_email_identity.example example.com