Skip to content

Commit

Permalink
add smtp flags
Browse files Browse the repository at this point in the history
  • Loading branch information
dfry committed Mar 11, 2022
1 parent d293e23 commit f192fd5
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
27 changes: 25 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module "private_subnets" {
}

module "gitlab" {
source = "git::https://github.com/mojaloop/iac-shared-modules.git//aws/gitlab?ref=v2.1.1"
source = "git::https://github.com/mojaloop/iac-shared-modules.git//aws/gitlab?ref=v2.1.2"
ami = var.use_latest_ami ? module.ubuntu-focal-ami.id : var.gitlab_ami_list[var.region]
instance_type = "t2.large"
gitlab_runner_size = "c5.2xlarge"
Expand All @@ -70,6 +70,12 @@ module "gitlab" {
enable_github_oauth = var.enable_github_oauth
github_oauth_id = var.github_oauth_id
github_oauth_secret = var.github_oauth_secret
smtp_server_enable = var.smtp_server_enable
smtp_server_address = "email-smtp.${var.region}.amazonaws.com"
smtp_server_port = 587
smtp_server_user = var.smtp_server_enable ? module.ses[0].access_key_id : ""
smtp_server_pw = var.smtp_server_enable ? module.ses[0].secret_access_key : ""
smtp_server_mail_domain = "${lower(var.tenant)}.${var.domain}"
}

module "nexus" {
Expand All @@ -89,11 +95,28 @@ module "nexus" {
}

module "init-gitlab" {
source = "git::https://github.com/mojaloop/iac-shared-modules.git//gitlab/init-config?ref=v2.1.1"
source = "git::https://github.com/mojaloop/iac-shared-modules.git//gitlab/init-config?ref=v2.1.2"
iac_user_key_secret = aws_iam_access_key.gitlab_ci_iam_user_key.secret
iac_user_key_id = aws_iam_access_key.gitlab_ci_iam_user_key.id
group_list = var.gitlab_rbac_groups
env_list = var.environments
root_token = module.gitlab.gitlab_root_token
gitlab_url = "https://${module.gitlab.server_hostname}"
}

module "ses" {
count = var.smtp_server_enable ? 1 : 0
source = "cloudposse/ses/aws"
version = "~> 0.22.0"

domain = "${lower(var.tenant)}.${var.domain}"
iam_access_key_max_age = 0
name = "tenant-${var.tenant}-ses"
ses_group_enabled = false
ses_user_enabled = true
verify_dkim = true
verify_domain = true
zone_id = aws_route53_zone.tenant_public.id

tags = merge({}, var.tags)
}
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,10 @@ variable "gitlab_rbac_groups" {
type = list(string)
description = "groups to seed in gitlab for rbac"
default = ["tenant-admins", "tenant-viewers"]
}

variable "smtp_server_enable" {
type = bool
description = "enable smtp server (ses)"
default = false
}

0 comments on commit f192fd5

Please sign in to comment.