From fb8e667ddbb047bed89a61ab398eb04c3b1f53f1 Mon Sep 17 00:00:00 2001 From: George Taylor Date: Tue, 25 Jun 2024 15:44:47 +0100 Subject: [PATCH 1/5] Update ses.tf --- terraform/environments/delius-jitbit/ses.tf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/terraform/environments/delius-jitbit/ses.tf b/terraform/environments/delius-jitbit/ses.tf index 3a059c3e1c9..4f846280dd3 100644 --- a/terraform/environments/delius-jitbit/ses.tf +++ b/terraform/environments/delius-jitbit/ses.tf @@ -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"] @@ -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"] @@ -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;"] @@ -48,7 +48,7 @@ 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;"] From d405e1cc85ec32e8ee11006b4de888ae8135d592 Mon Sep 17 00:00:00 2001 From: George Taylor Date: Tue, 25 Jun 2024 15:56:47 +0100 Subject: [PATCH 2/5] Update ses.tf --- terraform/environments/delius-jitbit/ses.tf | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/terraform/environments/delius-jitbit/ses.tf b/terraform/environments/delius-jitbit/ses.tf index 4f846280dd3..885a2f2fa4f 100644 --- a/terraform/environments/delius-jitbit/ses.tf +++ b/terraform/environments/delius-jitbit/ses.tf @@ -54,6 +54,27 @@ resource "aws_route53_record" "jitbit_amazonses_dmarc_record_prod" { records = ["v=DMARC1; p=none;"] } + +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.mail.${aws_sesv2_email_identity.jitbit.email_identity}" + type = "TXT" + ttl = "600" + records = ["v=DMARC1; p=none;"] +} + +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.mail.${aws_sesv2_email_identity.jitbit.email_identity}" + type = "TXT" + ttl = "600" + records = ["v=DMARC1; p=none;"] +} + resource "aws_route53_record" "jitbit_amazonses_mail_from_txt_record" { count = local.is-production ? 0 : 1 provider = aws.core-vpc From 19ff8219cc0c647c20d0876bf03c0a8db8013ce0 Mon Sep 17 00:00:00 2001 From: George Taylor Date: Tue, 25 Jun 2024 15:57:26 +0100 Subject: [PATCH 3/5] Update ses.tf --- terraform/environments/delius-jitbit/ses.tf | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/terraform/environments/delius-jitbit/ses.tf b/terraform/environments/delius-jitbit/ses.tf index 885a2f2fa4f..30e532ac563 100644 --- a/terraform/environments/delius-jitbit/ses.tf +++ b/terraform/environments/delius-jitbit/ses.tf @@ -85,6 +85,26 @@ resource "aws_route53_record" "jitbit_amazonses_mail_from_txt_record" { records = ["v=spf1 include:amazonses.com ~all"] } +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_mail_from_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_mail_from_txt_record_prod" { count = local.is-production ? 1 : 0 provider = aws.core-network-services From 5efc99ed82a0a665478913e885c227e3ad063fd3 Mon Sep 17 00:00:00 2001 From: George Taylor Date: Tue, 25 Jun 2024 15:58:37 +0100 Subject: [PATCH 4/5] Update ses.tf --- terraform/environments/delius-jitbit/ses.tf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/terraform/environments/delius-jitbit/ses.tf b/terraform/environments/delius-jitbit/ses.tf index 30e532ac563..83bfc632048 100644 --- a/terraform/environments/delius-jitbit/ses.tf +++ b/terraform/environments/delius-jitbit/ses.tf @@ -55,7 +55,7 @@ resource "aws_route53_record" "jitbit_amazonses_dmarc_record_prod" { } -resource "aws_route53_record" "jitbit_amazonses_dmarc_record" { +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 @@ -65,7 +65,7 @@ resource "aws_route53_record" "jitbit_amazonses_dmarc_record" { records = ["v=DMARC1; p=none;"] } -resource "aws_route53_record" "jitbit_amazonses_dmarc_record_prod" { +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 @@ -95,7 +95,7 @@ resource "aws_route53_record" "jitbit_amazonses_mail_from_txt_record_prod" { records = ["v=spf1 include:amazonses.com ~all"] } -resource "aws_route53_record" "jitbit_amazonses_mail_from_txt_record" { +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 @@ -105,7 +105,7 @@ resource "aws_route53_record" "jitbit_amazonses_mail_from_txt_record" { records = ["v=spf1 include:amazonses.com ~all"] } -resource "aws_route53_record" "jitbit_amazonses_mail_from_txt_record_prod" { +resource "aws_route53_record" "jitbit_amazonsestxt_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 From 0c99e5ba19a31fe8b3ecb2383474594e019f6a24 Mon Sep 17 00:00:00 2001 From: George Taylor Date: Tue, 25 Jun 2024 17:37:15 +0100 Subject: [PATCH 5/5] Update terraform/environments/delius-jitbit/ses.tf --- terraform/environments/delius-jitbit/ses.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/environments/delius-jitbit/ses.tf b/terraform/environments/delius-jitbit/ses.tf index 83bfc632048..b90446a4f44 100644 --- a/terraform/environments/delius-jitbit/ses.tf +++ b/terraform/environments/delius-jitbit/ses.tf @@ -105,7 +105,7 @@ resource "aws_route53_record" "jitbit_amazonses_txt_record" { records = ["v=spf1 include:amazonses.com ~all"] } -resource "aws_route53_record" "jitbit_amazonsestxt_record_prod" { +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