Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do AWS support SES in CloudFormation?

I'm trying to figure out how to automate the creation of several cloud resources in AWS, using CloudFormation.

Now I need to include the creation of SES (Simple Email Service) domain, but couldn't find the documentation, but I've already checked:

  • Simple Email Service Documentation
  • CloudFormation Resource Types Documentation

Do AWS support SES in CloudFormation?

like image 212
Alessandro Oliveira Avatar asked Oct 31 '17 01:10

Alessandro Oliveira


People also ask

Which AWS services rely on CloudFormation?

Yes. CloudFormation supports creating VPCs, subnets, gateways, route tables and network ACLs as well as creating resources such as elastic IPs, Amazon EC2 Instances, EC2 security groups, auto scaling groups, elastic load balancers, Amazon RDS database instances and Amazon RDS security groups in a VPC.

Does AWS amplify use CloudFormation?

You can now use AWS CloudFormation templates to provision Amplify Console resources, enabling repeatable and reliable web app deployments.

What formats does CloudFormation support?

You can author AWS CloudFormation templates in JSON or YAML formats. We support all AWS CloudFormation features and functions for both formats, including in AWS CloudFormation Designer.

What is AWS SES used for?

Amazon Simple Email Service (SES) is a cost-effective, flexible, and scalable email service that enables developers to send mail from within any application. You can configure Amazon SES quickly to support several email use cases, including transactional, marketing, or mass email communications.


Video Answer


1 Answers

CloudFormation provides several built-in Amazon SES resource types, but as of 2018 2020 2022 is still missing the ones many people need: domain and email verification.

Fortunately, CloudFormation has the ability to define your own custom resource types. I've built Custom::SES_Domain and Custom::SES_EmailIdentity resources that are designed to play well with other CloudFormation resources. Get them here: https://github.com/medmunds/aws-cfn-ses-domain.

Once you've pulled the custom CfnSESResources into your template, you can verify an SES domain like this:

Resources:
  # Provision a domain with Amazon SES:
  MySESDomain:
    Type: Custom::SES_Domain
    Properties:
      ServiceToken: !GetAtt CfnSESResources.Outputs.CustomDomainIdentityArn
      Domain: "example.com"
      EnableSend: true
      EnableReceive: false

  # Then add all required DNS records for SES verification and usage:
  MyRoute53RecordsForSES:
    Type: AWS::Route53::RecordSetGroup
    Properties:
      HostedZoneName: "example.com."
      RecordSets: !GetAtt MySESDomain.Route53RecordSets

Full instructions are in the repository. Custom::SES_Domain has properties for controlling several common SES domain options, and exposes attributes that feed into your CloudFormation DNS resources: either a standard AWS::Route53::RecordSetGroup resource as shown above, or other (external) DNS providers via zone file entries.

like image 184
medmunds Avatar answered Nov 02 '22 20:11

medmunds