--- subcategory: "SESv2 (Simple Email V2)" layout: "aws" page_title: "AWS: aws_sesv2_email_identity" description: |- Terraform resource for managing an AWS SESv2 (Simple Email V2) Email Identity. --- # Resource: aws_sesv2_email_identity Terraform resource for managing an AWS SESv2 (Simple Email V2) Email Identity. ## Example Usage ### Basic Usage #### Email Address Identity ```terraform resource "aws_sesv2_email_identity" "example" { email_identity = "testing@example.com" } ``` #### Domain Identity ```terraform resource "aws_sesv2_email_identity" "example" { email_identity = "example.com" } ``` #### Configuration Set ```terraform resource "aws_sesv2_configuration_set" "example" { configuration_set_name = "example" } resource "aws_sesv2_email_identity" "example" { email_identity = "example.com" configuration_set_name = aws_sesv2_configuration_set.example.configuration_set_name } ``` #### DKIM Signing Attributes (BYODKIM) ```terraform resource "aws_sesv2_email_identity" "example" { email_identity = "example.com" dkim_signing_attributes { domain_signing_private_key = "MIIJKAIBAAKCAgEA2Se7p8zvnI4yh+Gh9j2rG5e2aRXjg03Y8saiupLnadPH9xvM..." #PEM private key without headers or newline characters domain_signing_selector = "example" } } ``` ## Argument Reference The following arguments are required: * `email_identity` - (Required) Email address or domain to verify. The following arguments are optional: * `configuration_set_name` - (Optional) Configuration set to use by default when sending from this identity. Any configuration set defined in the email sending request takes precedence. * `dkim_signing_attributes` - (Optional) Configuration block for the DKIM authentication settings for an email domain identity. See [`dkim_signing_attributes` Block](#dkim_signing_attributes-block) below. * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `tags` - (Optional) Key-value mapping of resource tags. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ### `dkim_signing_attributes` Block The `dkim_signing_attributes` configuration block supports the following arguments: * `domain_signing_private_key` - (Optional, Sensitive) [Bring Your Own DKIM] Private key 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. * `domain_signing_selector` - (Optional) [Bring Your Own DKIM] String used to identify a public key in the DNS configuration for a domain. * `next_signing_key_length` - (Optional) [Easy DKIM] 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`. ## Attribute Reference This resource exports the following attributes in addition to the arguments above: * `arn` - ARN of the Email Identity. * `identity_type` - Email identity type. Valid values: `EMAIL_ADDRESS`, `DOMAIN`. * `tags_all` - Map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). * `verification_status` - Verification status of the identity. One of `PENDING`, `SUCCESS`, `FAILED`, `TEMPORARY_FAILURE`, and `NOT_STARTED`. * `verified_for_sending_status` - Whether the identity is verified. ### `dkim_signing_attributes` Block * `current_signing_key_length` - [Easy DKIM] Key length of the DKIM key pair in use. * `last_key_generation_timestamp` - [Easy DKIM] Last time a key pair was generated for this identity. * `signing_attributes_origin` - 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` - Whether Amazon SES has successfully located the DKIM records in the DNS records for the domain. See the [AWS SES API v2 Reference](https://docs.aws.amazon.com/ses/latest/APIReference-V2/API_DkimAttributes.html#SES-Type-DkimAttributes-Status) 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. ## Import In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import SESv2 (Simple Email V2) Email Identity using the `email_identity`. For example: ```terraform import { to = aws_sesv2_email_identity.example id = "example.com" } ``` Using `terraform import`, import SESv2 (Simple Email V2) Email Identity using the `email_identity`. For example: ```console % terraform import aws_sesv2_email_identity.example example.com ```