Skip to content

Commit a677f34

Browse files
committed
feat: Add SES configuration.
1 parent 1b503d1 commit a677f34

File tree

5 files changed

+45
-4
lines changed

5 files changed

+45
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Code for America OpenTofu Module Template
1+
# AWS Simple Email Service (SES) Modules
22

33
[![GitHub Release][badge-release]][latest-release]
44

@@ -24,7 +24,7 @@ to match your desired configuration. For example:
2424

2525
```hcl
2626
module "module_name" {
27-
source = "github.com/codeforamerica/tofu-modules-template?ref=1.0.0"
27+
source = "github.com/codeforamerica/tofu-modules-aws-ses?ref=1.0.0"
2828
2929
project = "my-project"
3030
environment = "development"
@@ -68,7 +68,7 @@ tofu init -upgrade
6868
Follow the [contributing guidelines][contributing] to contribute to this
6969
repository.
7070

71-
[badge-release]: https://img.shields.io/github/v/release/codeforamerica/tofu-modules-template?logo=github&label=Latest%20Release
71+
[badge-release]: https://img.shields.io/github/v/release/codeforamerica/tofu-modules-aws-ses?logo=github&label=Latest%20Release
7272
[contributing]: CONTRIBUTING.md
73-
[latest-release]: https://github.com/codeforamerica/tofu-modules-template/releases/latest
73+
[latest-release]: https://github.com/codeforamerica/tofu-modules-aws-ses/releases/latest
7474
[tofu-modules]: https://github.com/codeforamerica/tofu-modules

data.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
data "aws_route53_zone" "domain" {
2+
name = var.hosted_zone_id != null ? null : var.domain
3+
zone_id = var.hosted_zone_id
4+
}

main.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module "this" {
2+
source = "cloudposse/ses/aws"
3+
version = ">= 0.25.1"
4+
5+
domain = var.domain
6+
ses_user_enabled = false
7+
ses_group_enabled = false
8+
verify_domain = true
9+
verify_dkim = true
10+
zone_id = data.aws_route53_zone.domain.id
11+
12+
tags = var.tags
13+
}

outputs.tf

Whitespace-only changes.

variables.tf

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
variable "domain" {
2+
type = string
3+
description = "The domain to use for the SES email address."
4+
5+
validation {
6+
condition = can(regex("^[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]\\.[a-zA-Z]{2,}$", var.domain))
7+
error_message = "The domain must be a valid domain name."
8+
}
9+
}
10+
11+
variable "hosted_zone_id" {
12+
type = string
13+
description = <<-EOT
14+
The ID of the hosted zone to use for the SES email address. If not provided,
15+
the domain will be used to find the hosted zone.
16+
EOT
17+
default = null
18+
}
19+
20+
variable "tags" {
21+
type = map(string)
22+
description = "Optional tags to be applied to all resources."
23+
default = {}
24+
}

0 commit comments

Comments
 (0)