Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jitbit SES always use identity domain #6730

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 45 additions & 4 deletions terraform/environments/delius-jitbit/ses.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ resource "aws_route53_record" "jitbit_amazonses_dkim_record" {
provider = aws.core-vpc
count = local.is-production ? 0 : 3
zone_id = data.aws_route53_zone.external.zone_id
name = "${aws_sesv2_email_identity.jitbit.dkim_signing_attributes[0].tokens[count.index]}._domainkey.${local.app_url}"
name = "${aws_sesv2_email_identity.jitbit.dkim_signing_attributes[0].tokens[count.index]}._domainkey.${aws_sesv2_email_identity.jitbit.email_identity}"
type = "CNAME"
ttl = "600"
records = ["${aws_sesv2_email_identity.jitbit.dkim_signing_attributes[0].tokens[count.index]}.dkim.amazonses.com"]
Expand All @@ -28,7 +28,7 @@ resource "aws_route53_record" "jitbit_amazonses_dkim_record_prod" {
provider = aws.core-network-services
count = local.is-production ? 3 : 0
zone_id = data.aws_route53_zone.network-services-production[0].zone_id
name = "${aws_sesv2_email_identity.jitbit.dkim_signing_attributes[0].tokens[count.index]}._domainkey.${local.app_url}"
name = "${aws_sesv2_email_identity.jitbit.dkim_signing_attributes[0].tokens[count.index]}._domainkey.${aws_sesv2_email_identity.jitbit.email_identity}"
type = "CNAME"
ttl = "600"
records = ["${aws_sesv2_email_identity.jitbit.dkim_signing_attributes[0].tokens[count.index]}.dkim.amazonses.com"]
Expand All @@ -38,7 +38,7 @@ resource "aws_route53_record" "jitbit_amazonses_dmarc_record" {
count = local.is-production ? 0 : 1
provider = aws.core-vpc
zone_id = data.aws_route53_zone.external.zone_id
name = "_dmarc.${local.app_url}"
name = "_dmarc.${aws_sesv2_email_identity.jitbit.email_identity}"
type = "TXT"
ttl = "600"
records = ["v=DMARC1; p=none;"]
Expand All @@ -48,7 +48,28 @@ resource "aws_route53_record" "jitbit_amazonses_dmarc_record_prod" {
count = local.is-production ? 1 : 0
provider = aws.core-network-services
zone_id = data.aws_route53_zone.network-services-production[0].zone_id
name = "_dmarc.${local.app_url}"
name = "_dmarc.${aws_sesv2_email_identity.jitbit.email_identity}"
type = "TXT"
ttl = "600"
records = ["v=DMARC1; p=none;"]
}


resource "aws_route53_record" "jitbit_amazonses_dmarc_mail_from_record" {
count = local.is-production ? 0 : 1
provider = aws.core-vpc
zone_id = data.aws_route53_zone.external.zone_id
name = "_dmarc.mail.${aws_sesv2_email_identity.jitbit.email_identity}"
type = "TXT"
ttl = "600"
records = ["v=DMARC1; p=none;"]
}

resource "aws_route53_record" "jitbit_amazonses_dmarc_mail_from_record_prod" {
count = local.is-production ? 1 : 0
provider = aws.core-network-services
zone_id = data.aws_route53_zone.network-services-production[0].zone_id
name = "_dmarc.mail.${aws_sesv2_email_identity.jitbit.email_identity}"
type = "TXT"
ttl = "600"
records = ["v=DMARC1; p=none;"]
Expand All @@ -65,6 +86,26 @@ resource "aws_route53_record" "jitbit_amazonses_mail_from_txt_record" {
}

resource "aws_route53_record" "jitbit_amazonses_mail_from_txt_record_prod" {
count = local.is-production ? 1 : 0
provider = aws.core-network-services
zone_id = data.aws_route53_zone.network-services-production[0].zone_id
name = aws_sesv2_email_identity.jitbit.email_identity
type = "TXT"
ttl = "600"
records = ["v=spf1 include:amazonses.com ~all"]
}

resource "aws_route53_record" "jitbit_amazonses_txt_record" {
count = local.is-production ? 0 : 1
provider = aws.core-vpc
zone_id = data.aws_route53_zone.external.zone_id
name = aws_sesv2_email_identity.jitbit.email_identity
type = "TXT"
ttl = "600"
records = ["v=spf1 include:amazonses.com ~all"]
}

resource "aws_route53_record" "jitbit_amazonses_txt_record_prod" {
count = local.is-production ? 1 : 0
provider = aws.core-network-services
zone_id = data.aws_route53_zone.network-services-production[0].zone_id
Expand Down