Skip to content

Commit

Permalink
feat: add variable condition in main.tf
Browse files Browse the repository at this point in the history
  • Loading branch information
anmolnagpal committed Jul 27, 2023
1 parent d2730ab commit 8876167
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ module "labels" {
#Module : DOMAIN IDENTITY
#Description : Terraform module to create domain identity using domain
resource "aws_ses_domain_identity" "default" {
count = var.enable_domain ? 1 : 0
count = var.enabled && var.enable_domain ? 1 : 0
domain = var.domain
}

#Module : EMAIL IDENTITY
#Description : Terraform module to create Emails identity using domain
resource "aws_ses_email_identity" "default" {
count = var.enable_email ? length(var.emails) : 0
count = var.enabled && var.enable_email ? length(var.emails) : 0
email = var.emails[count.index]
}

Expand Down Expand Up @@ -62,7 +62,7 @@ resource "aws_route53_record" "ses_verification" {
# Module : DOMAIN DKIM
# Description : Terraform module which creates Domain DKIM resource on AWS
resource "aws_ses_domain_dkim" "default" {
count = var.enable_domain ? 1 : 0
count = var.enabled && var.enable_domain ? 1 : 0
domain = aws_ses_domain_identity.default[0].domain
}

Expand Down

0 comments on commit 8876167

Please sign in to comment.