File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ This module creates following resources.
37
37
| [ aws_sesv2_email_identity_feedback_attributes.this] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sesv2_email_identity_feedback_attributes ) | resource |
38
38
| [ aws_sesv2_email_identity_mail_from_attributes.this] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sesv2_email_identity_mail_from_attributes ) | resource |
39
39
| [ aws_sesv2_email_identity_policy.this] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sesv2_email_identity_policy ) | resource |
40
+ | [ aws_region.current] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region ) | data source |
40
41
41
42
## Inputs
42
43
Original file line number Diff line number Diff line change @@ -4,8 +4,22 @@ locals {
4
4
? aws_sesv2_email_identity. this . dkim_signing_attributes [0 ]. tokens
5
5
: []
6
6
)
7
+ # INFO: https://docs.aws.amazon.com/general/latest/gr/ses.html#ses_dkim_domains
8
+ # - Not all AWS Regions use the default SES DKIM domain, `dkim.amazonses.com`
9
+ dkim_domains = {
10
+ " default" = " dkim.amazonses.com"
11
+ " af-south-1" = " dkim.af-south-1.amazonses.com"
12
+ " ap-southeast-3" = " dkim.ap-southeast-3.amazonses.com"
13
+ " ap-northeast-3" = " dkim.ap-northeast-3.amazonses.com"
14
+ " eu-south-1" = " dkim.eu-south-1.amazonses.com"
15
+ " il-central-1" = " dkim.il-central-1.amazonses.com"
16
+ " us-gov-east-1" = " dkim.us-gov-east-1.amazonses.com"
17
+ }
18
+ dkim_domain = lookup (local. dkim_domains , data. aws_region . current . name , local. dkim_domains [" default" ])
7
19
}
8
20
21
+ data "aws_region" "current" {}
22
+
9
23
10
24
# ##################################################
11
25
# DKIM Verification
@@ -17,7 +31,7 @@ resource "aws_route53_record" "dkim" {
17
31
zone_id = var. dkim . verification . zone_id
18
32
name = " ${ local . tokens [count . index ]} ._domainkey.${ aws_sesv2_email_identity . this . email_identity } "
19
33
type = " CNAME"
20
- records = [" ${ local . tokens [count . index ]} .dkim.amazonses.com " ]
34
+ records = [" ${ local . tokens [count . index ]} .${ local . dkim_domain } " ]
21
35
22
36
ttl = " 600"
23
37
allow_overwrite = true
You can’t perform that action at this time.
0 commit comments