Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
amancevice committed Apr 6, 2024
1 parent bc6a040 commit 2101324
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions global/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ terraform {
###########

provider "aws" {
region = "us-west-2"
region = local.region
default_tags { tags = local.tags }
}

Expand All @@ -45,10 +45,8 @@ variable "MAIL_TO" { type = string }
##############

locals {
account_id = data.aws_caller_identity.current.account_id
region = data.aws_region.current.name

env = "blue"
region = "us-west-2"
env = "blue"

domain_validation_options = {
for x in aws_acm_certificate.us-east-1.domain_validation_options :
Expand All @@ -66,9 +64,6 @@ locals {
# DATA #
############

data "aws_caller_identity" "current" {}
data "aws_region" "current" {}

data "aws_s3_bucket" "website" {
bucket = "${local.region}-brutalismbot-${local.env}-website"
}
Expand Down Expand Up @@ -226,8 +221,8 @@ resource "aws_route53_record" "dkims" {

# resource "aws_route53_record" "mx" {
# for_each = {
# aws_ses_domain_mail_from.domain.mail_from_domain = ["10 feedback-smtp.${data.aws_region.current.name}.amazonses.com"]
# aws_route53_zone.zone.name = ["10 inbound-smtp.${data.aws_region.current.name}.amazonaws.com"]
# aws_ses_domain_mail_from.domain.mail_from_domain = ["10 feedback-smtp.${local.region}.amazonses.com"]
# aws_route53_zone.zone.name = ["10 inbound-smtp.${local.region}.amazonaws.com"]
# }
# name = each.key
# records = each.value
Expand All @@ -238,15 +233,15 @@ resource "aws_route53_record" "dkims" {

resource "aws_route53_record" "mail_from_mx" {
name = aws_ses_domain_mail_from.domain.mail_from_domain
records = ["10 feedback-smtp.${data.aws_region.current.name}.amazonses.com"]
records = ["10 feedback-smtp.${local.region}.amazonses.com"]
ttl = "600"
type = "MX"
zone_id = aws_route53_zone.zone.id
}

resource "aws_route53_record" "mail_to_mx" {
name = aws_route53_zone.zone.name
records = ["10 inbound-smtp.${data.aws_region.current.name}.amazonaws.com"]
records = ["10 inbound-smtp.${local.region}.amazonaws.com"]
ttl = "300"
type = "MX"
zone_id = aws_route53_zone.zone.id
Expand Down

0 comments on commit 2101324

Please sign in to comment.