Skip to content

Migrating to SESv2 API

0

Hi! I'm using Pulumi to configure my infrastructure as code. We have some DomainIdentity resources created using the SESv1 API. I'd like to create new ConfigurationSets and assign them to the existing Domain Identities, which seems to require SESv2. Ostensibly this seems to mean that I need to upgrade to the SESv2 API, but it's unclear to me what this means for the existing resources. I think I can probably "import" the state of the existing domains into a "new" SESv2 resource in Pulumi, but I noticed a few differences in the API.

It seems like for SESv1 domain identities, we had to create the domain identity and then create a TXT record to verify the identity (see https://docs.aws.amazon.com/ses/latest/APIReference/API_VerifyDomainIdentity.html). We also had to set up 3 CNAME records for DKIM.

In SESv2, we have more options for DKIM, but it seems like if we want to use the "Easy DKIM" option we still can just set up 3 CNAME records. But there's no mention of TXT records, so I wonder if it's no longer needed to verify the domain separately if you can verify the DKIM records? https://docs.aws.amazon.com/ses/latest/APIReference-V2/API_CreateEmailIdentity.html. I also noticed that the documentation points to AWS Pinpoint's documentation about domain verification but that also just mentions 3 CNAME records, and it's not clear to me if that is for the DKIM records or if it's a replacement for the old TXT record verification.

I did also find this random GitHub comment on a Terraform PR where they said not to mix v1 and v2 DKIM settings: "We have an AWS support case, where AWS team recommends not to mix identities created via SESv1 and DKIM settings set via SESv2." Though in this case I don't need to change the DKIM settings, I just want to set the default ConfigurationSet which is not possible with the v1 Pulumi/Terraform resources.

https://github.com/hashicorp/terraform-provider-aws/pull/24436#issuecomment-1191132035

Ultimately, I'd like to just keep using my existing verified domains and add the ConfigurationSet options to it, but due to the differences in the APIs/documentation I don't know if that's actually possible. Thank you for your help!

1 Answer
0

Migrating from SESv1 to SESv2 API for your existing domain identities is possible, and you can indeed add ConfigurationSets to your existing verified domains. Here's what you need to know:

  1. Existing Resources: Your existing domain identities created with SESv1 API will continue to work. You don't need to re-verify or recreate these identities when migrating to SESv2.

  2. API Differences: While there are some differences between SESv1 and SESv2 APIs, the core functionality for domain verification remains similar.

  3. Domain Verification: In SESv2, the process has been simplified. You no longer need to create a separate TXT record for domain verification. The DKIM records (3 CNAME records) you've already set up for your domains are sufficient for both verification and DKIM signing.

  4. DKIM Options: SESv2 offers more DKIM options, including Easy DKIM (which uses the 3 CNAME records you already have) and Bring Your Own DKIM (BYODKIM). If you're happy with your current Easy DKIM setup, you don't need to change anything.

  5. Adding ConfigurationSets: You can add ConfigurationSets to your existing verified domains using the SESv2 API without needing to re-verify the domains. Use the PutEmailIdentityConfigurationSetAttributes operation to associate a ConfigurationSet with an existing email identity.

  6. Pulumi State Import: You're correct that you can "import" the state of your existing domains into new SESv2 resources in Pulumi. This will allow you to manage these resources using the SESv2 API going forward.

  7. API Coexistence: It's worth noting that you can use both SESv1 and SESv2 APIs in the same application if needed. This can be helpful during a gradual migration process.

To add a ConfigurationSet to an existing domain identity using the AWS CLI (which you can adapt to your Pulumi code), you would use a command like this:

aws sesv2 put-email-identity-configuration-set-attributes --email-identity your-domain.com --configuration-set-name your-config-set-name

In summary, you can keep using your existing verified domains and add ConfigurationSet options to them using the SESv2 API. The migration process should be relatively straightforward, as the fundamental domain verification and DKIM setup you've already done remains valid in SESv2.
Sources
Upgrade Your Email Tech Stack with Amazon SESv2 API | AWS Messaging & Targeting Blog
Edit an identity to use a default configuration set using the SES API - Amazon Simple Email Service
Creating and verifying identities in Amazon SES - Amazon Simple Email Service
Managing configuration sets in Amazon SES - Amazon Simple Email Service

answered 2 years ago

EXPERT

reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.