diff --git a/aws/ses/cloudflare.tf b/aws/ses/cloudflare.tf deleted file mode 100644 index 15755b8..0000000 --- a/aws/ses/cloudflare.tf +++ /dev/null @@ -1,53 +0,0 @@ -resource "cloudflare_record" "domain_amazonses_verification_record" { - count = var.cloudflare_zone != null ? 1 : 0 - - zone_id = var.cloudflare_zone - name = "_amazonses.${var.ses_domain}." - type = "TXT" - value = aws_ses_domain_identity.domain.verification_token - proxied = false - ttl = 60 -} - -resource "cloudflare_record" "domain_amazonses_dkim_record" { - count = var.cloudflare_zone != null ? 3 : 0 - - zone_id = var.cloudflare_zone - name = "${element(aws_ses_domain_dkim.dkim.dkim_tokens, count.index)}._domainkey.${var.ses_domain}." - type = "CNAME" - value = "${element(aws_ses_domain_dkim.dkim.dkim_tokens, count.index)}.dkim.amazonses.com" - proxied = false - ttl = 60 -} - -resource "cloudflare_record" "spf_record" { - count = var.cloudflare_zone != null ? 1 : 0 - - zone_id = var.cloudflare_zone - name = var.domain - type = "TXT" - value = "v=spf1 include:amazonses.com ~all" - proxied = false - ttl = 60 -} - -resource "aws_ses_domain_identity_verification" "main" { - domain = aws_ses_domain_identity.domain.id - - depends_on = [ - aws_route53_record.domain_amazonses_verification_record, - cloudflare_record.domain_amazonses_verification_record, - ] -} - -resource "cloudflare_record" "feedback_mx_record" { - count = (var.cloudflare_zone != null && var.mail_from_domain != null) ? 1 : 0 - - zone_id = var.cloudflare_zone - name = var.mail_from_domain - type = "MX" - value = "feedback-smtp.${var.region}.amazonaws.com" - priority = 10 - proxied = false - ttl = 60 -} diff --git a/aws/ses/providers.tf b/aws/ses/providers.tf index 11c4374..dc58d9a 100644 --- a/aws/ses/providers.tf +++ b/aws/ses/providers.tf @@ -1,11 +1,3 @@ -terraform { - required_providers { - cloudflare = { - source = "cloudflare/cloudflare" - } - } -} - provider "aws" { region = var.region } diff --git a/aws/ses/variables.tf b/aws/ses/variables.tf index 3d08c6b..1d80fbf 100644 --- a/aws/ses/variables.tf +++ b/aws/ses/variables.tf @@ -18,12 +18,6 @@ variable "route53_zone" { default = null } -variable "cloudflare_zone" { - type = string - description = "Cloudflare zone ID for the SES domain verification" - default = null -} - variable "mail_from_domain" { default = null