Skip to content

Commit

Permalink
feat: fixed output commente issue (#33)
Browse files Browse the repository at this point in the history
* feat: fixed output commente issue

* feat: fixed redundant verification resources issue

* feat: fixed redundant verification resources issue

* feat: fixed redundant verification resources issue

---------

Co-authored-by: anmolnagpal <anmol@clouddrove.com>
  • Loading branch information
theprashantyadav and anmolnagpal committed Dec 26, 2023
1 parent ea68390 commit 803d37c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 43 deletions.
5 changes: 2 additions & 3 deletions _example/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ module "ses" {
emails = []
zone_id = "XXXXXXXX69XB8J3IEP"

enable_verification = true
enable_mx = true
enable_spf_domain = true
enable_mx = true
enable_spf_domain = true
}
6 changes: 3 additions & 3 deletions _example/versions.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Terraform version
terraform {
required_version = ">= 1.6.1"
required_version = ">= 1.6.5"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.21.0"
version = ">= 5.30.0"
}
}
}
}
23 changes: 0 additions & 23 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,6 @@ resource "aws_ses_email_identity" "default" {
email = var.emails[count.index]
}

###DNS VERIFICATION#######

#Module : DOMAIN IDENTITY VERIFICATION
#Description : Terraform module to verify domain identity using domain
resource "aws_ses_domain_identity_verification" "default" {
count = var.enabled && var.enable_domain && var.enable_verification ? 1 : 0

domain = aws_ses_domain_identity.default[count.index].id
depends_on = [aws_route53_record.ses_verification]
}

#Module : DOMAIN IDENTITY VERIFICATION ROUTE53
#Description : Terraform module to record of Route53 for verify domain identity using domain
resource "aws_route53_record" "ses_verification" {
count = var.enabled && var.zone_id != "" ? 1 : 0

zone_id = var.zone_id
name = var.ses_verification_name
type = var.txt_type
ttl = "600"
records = [aws_ses_domain_identity.default[count.index].verification_token]
}

# Module : DOMAIN DKIM
# Description : Terraform module which creates Domain DKIM resource on AWS
resource "aws_ses_domain_dkim" "default" {
Expand Down
2 changes: 1 addition & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ output "domain_identity_arn" {
}

output "id" {
value = try(aws_ses_domain_identity_verification.default[0].id, "")
value = try(aws_ses_domain_identity.default[0].id, "")
description = "The domain name of the domain identity."
}

Expand Down
10 changes: 0 additions & 10 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ variable "iam_name" {
description = "IAM username."
}

variable "enable_verification" {
type = bool
default = false
description = "Control whether or not to verify SES DNS records."
}

variable "enable_mail_from" {
type = bool
default = false
Expand Down Expand Up @@ -175,8 +169,4 @@ variable "cname_type" {
variable "spf_domain_name" {
type = string
default = "spf_domain"
}
variable "ses_verification_name" {
type = string
default = "ses_verification"
}
6 changes: 3 additions & 3 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Terraform version
terraform {
required_version = ">= 1.6.1"
required_version = ">= 1.6.5"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.21.0"
version = ">= 5.30.0"
}
}
}
}

0 comments on commit 803d37c

Please sign in to comment.