Skip to content

Commit

Permalink
fixing up the dns
Browse files Browse the repository at this point in the history
  • Loading branch information
P0NDER0SA committed Sep 6, 2024
1 parent ff16c43 commit 4d2a48a
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions env/terragrunt.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ inputs = merge(
"${local.inputs.region}" = "${local.inputs.elb_account_id}"
}
cbs_satellite_bucket_name = "cbs-satellite-${local.inputs.account_id}"
dns_role = local.inputs.env == "staging" ? "" : (local.inputs.env == "production" ? "\n assume_role {\n role_arn = \"arn:aws:iam::${local.inputs.dns_account_id}:role/notify_prod_dns_manager\"\n }" : "\n assume_role {\n role_arn = \"arn:aws:iam::${local.inputs.dns_account_id}:role/${local.inputs.env}_dns_manager_role\"\n }")
}
)

Expand Down Expand Up @@ -45,7 +44,7 @@ terraform {
}
provider "aws" {
region = var.region
region = "${local.inputs.region}"
allowed_account_ids = [${local.inputs.account_id}]
}
Expand All @@ -61,10 +60,33 @@ provider "aws" {
allowed_account_ids = [${local.inputs.account_id}]
}
%{ if local.inputs.env == "dev" }
provider "aws" {
alias = "dns"
region = "ca-central-1"${local.inputs.dns_role}
region = "ca-central-1"
assume_role {
role_arn = "arn:aws:iam::${local.inputs.dns_account_id}:role/${local.inputs.env}_dns_manager_role"
}
}
%{ endif }
%{ if local.inputs.env == "staging" }
provider "aws" {
alias = "dns"
region = "ca-central-1"
}
}
%{ endif }
%{ if local.inputs.env == "production" }
provider "aws" {
alias = "dns"
region = "ca-central-1"
assume_role {
role_arn = "arn:aws:iam::${local.inputs.dns_account_id}:role/notify_${local.inputs.env}_dns_manager"
}
}
%{ endif }
provider "aws" {
alias = "staging"
Expand Down

0 comments on commit 4d2a48a

Please sign in to comment.