Not long ago I started using Pulumi for deploying the infrastructure for my projects. I’m always trying to automate things as much as possible, and having everything coded in my repo for my projects. I had used the serverless framework in the past, but it’s true that for a project that involves different providers and configurations, that framework cannot do the job.
I couldn’t find a complete example to configure AWS Simple Email Service (SES) with Pulumi, so I’ve created a gist with all the configuration. In my case, I’m using CloudFlare as my DNS server, so I use it to create the different DNS records. But if you’re using Route 53 or other, just change the line swhere the CF records are created.
This code will:
- Create a domain in AWS SES
- Create DKIM validation and add the needed records in CloudFlare
- Create the record in CloudFlare to validate domain ownership for SES
- Request to validate the domain
From my experience, it took some time for the domain to be validated. So if you use this together with other resources (like Cognito for example), you may need to run run the deployment twice.
For more information on Pulumi and AWS SES, refer to its docs here