terraform-aws-ses
terraform-aws-ses copied to clipboard
Terraform module to create an SES Identity with SES IAM user on AWS.

Terraform AWS SES
Terraform module to create an SES Identity with SES IAM user on AWS.
We eat, drink, sleep and most importantly love DevOps. We are working towards strategies for standardizing architecture while ensuring security for the infrastructure. We are strong believer of the philosophy Bigger problems are always solved by breaking them into smaller manageable problems. Resonating with microservices architecture, it is considered best-practice to run database, cluster, storage in smaller connected yet manageable pieces within the infrastructure.
This module is basically combination of Terraform open source and includes automatation tests and examples. It also helps to create and improve your infrastructure with minimalistic code instead of maintaining the whole infrastructure code yourself.
We have fifty plus terraform modules. A few of them are comepleted and are available for open source usage while a few others are in progress.
Prerequisites
This module has a few dependencies:
Examples
IMPORTANT: Since the master branch used in source varies based on new modifications, we suggest that you use the release versions here.
Simple Example
Here is an example of how you can use this module in your inventory structure:
module "ses" {
source = "clouddrove/ses/aws"
version = "1.3.1"
domain = "clouddrove.com"
enable_email = true
emails = ["[email protected]"]
iam_name = "ses-user1"
zone_id = "DSSCTGRTHD"
enable_verification = false
enable_mx = false
enable_spf_domain = false
}
Inputs
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| cname_type | CNAME type for Record Set. | string |
"CNAME" |
no |
| domain | Domain to use for SES. | string |
"" |
no |
| emails | Emails list to use for SES. | list(string) |
[] |
no |
| enable_domain | Control whether or not to enable domain identity for AWS SES. | bool |
true |
no |
| enable_email | Control whether or not to enable email identity for AWS SES. | bool |
false |
no |
| enable_filter | Control whether or not to enable receipt filter. | bool |
false |
no |
| enable_mail_from | Control whether or not to enable mail from domain. | bool |
false |
no |
| enable_mx | Control whether or not to enable mx DNS recodrds. | bool |
false |
no |
| enable_policy | Control whether identity policy create for SES. | bool |
false |
no |
| enable_spf_domain | Control whether or not to enable enable spf domain. | bool |
false |
no |
| enable_template | Control whether create a template for emails. | bool |
false |
no |
| enable_verification | Control whether or not to verify SES DNS records. | bool |
false |
no |
| enabled | Boolean indicating whether or not to create sns module. | bool |
true |
no |
| environment | Environment (e.g. prod, dev, staging). |
string |
"" |
no |
| filter_cidr | The IP address or address range to filter, in CIDR notation. | string |
"" |
no |
| filter_policy | Block or Allow filter. | string |
"" |
no |
| iam_name | IAM username. | string |
"" |
no |
| label_order | Label order, e.g. name,application. |
list(any) |
[] |
no |
| mail_from_domain | Subdomain (of the route53 zone) which is to be used as MAIL FROM address. | string |
"" |
no |
| managedby | ManagedBy, eg 'CloudDrove' | string |
"[email protected]" |
no |
| mx_type | MX type for Record Set. | string |
"MX" |
no |
| name | Name (e.g. app or cluster). |
string |
"" |
no |
| repository | Terraform current module repo | string |
"https://github.com/clouddrove/terraform-aws-ses" |
no |
| template_html | The HTML body of the email. Must be less than 500KB in size, including both the text and HTML parts. | string |
"" |
no |
| template_subject | The subject line of the email. | string |
"" |
no |
| text | The email body that will be visible to recipients whose email clients do not display HTML. | string |
"" |
no |
| txt_type | Txt type for Record Set. | string |
"TXT" |
no |
| zone_id | Route53 host zone ID to enable SES. | string |
"" |
no |
Outputs
| Name | Description |
|---|---|
| domain_identity_arn | ARN of the SES domain identity. |
| id | The domain name of the domain identity. |
Testing
In this module testing is performed with terratest and it creates a small piece of infrastructure, matches the output like ARN, ID and Tags name etc and destroy infrastructure in your AWS account. This testing is written in GO, so you need a GO environment in your system.
You need to run the following command in the testing folder:
go test -run Test
Feedback
If you come accross a bug or have any feedback, please log it in our issue tracker, or feel free to drop us an email at [email protected].
If you have found it worth your time, go ahead and give us a ★ on our GitHub!
About us
At CloudDrove, we offer expert guidance, implementation support and services to help organisations accelerate their journey to the cloud. Our services include docker and container orchestration, cloud migration and adoption, infrastructure automation, application modernisation and remediation, and performance engineering.
We are The Cloud Experts!
We ❤️ Open Source and you can check out our other modules to get help with your new Cloud ideas.