Skip to content

Commit

Permalink
AWS SES DKIM (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcarranza authored Jan 16, 2024
1 parent fbbac86 commit 1367b46
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 0 deletions.
45 changes: 45 additions & 0 deletions terraform-modules/aws/ses/dkim/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# What is DKIM
Docs: https://docs.aws.amazon.com/ses/latest/dg/send-email-authentication-dkim.html
DomainKeys Identified Mail (DKIM) is an email security standard designed to make sure that an email that claims to have come from a specific domain was indeed authorized by the owner of that domain. It uses public-key cryptography to sign an email with a private key. Recipient servers can then use a public key published to a domain's DNS to verify that parts of the email have not been modified during the transit.


This terraform is configuring an Easy DKIM: SES generates a public-private key pair and automatically adds a DKIM signature to every message that you send from that identity, see Easy DKIM in Amazon SES.

The CNAMEs records outcomes of this terraform can be set up in DNS Managment like cloudflare, namecheap, so on.

references:
- https://www.youtube.com/watch?v=C7rRSaP6fdA&t=216s


## Requirements

No requirements.

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [aws_ses_domain_dkim.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ses_domain_dkim) | resource |
| [aws_ses_domain_identity.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ses_domain_identity) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_domain"></a> [domain](#input\_domain) | Verified domain name to generate DKIM tokens for | `any` | n/a | yes |

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_dkim_tokens"></a> [dkim\_tokens](#output\_dkim\_tokens) | DKIM tokens generated by SES. |
6 changes: 6 additions & 0 deletions terraform-modules/aws/ses/dkim/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "aws_ses_domain_identity" "this" {
domain = var.domain
}
resource "aws_ses_domain_dkim" "this" {
domain = aws_ses_domain_identity.this.domain
}
4 changes: 4 additions & 0 deletions terraform-modules/aws/ses/dkim/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
output "dkim_tokens" {
description = "DKIM tokens generated by SES."
value = aws_ses_domain_dkim.this.dkim_tokens
}
4 changes: 4 additions & 0 deletions terraform-modules/aws/ses/dkim/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
variable "domain" {
description = "Verified domain name to generate DKIM tokens for"
}

0 comments on commit 1367b46

Please sign in to comment.