Skip to content

Commit

Permalink
Refactor terragrunt (#119)
Browse files Browse the repository at this point in the history
Push more stuff into root config file
  • Loading branch information
mhutchinson authored Feb 28, 2024
1 parent 00a1855 commit 5e3cba3
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 60 deletions.
16 changes: 4 additions & 12 deletions deployment/live/cloudbuild/dev/terragrunt.hcl
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
include {
path = find_in_parent_folders()
}

terraform {
source = "${get_path_to_repo_root()}/deployment/modules/cloudbuild"
}

locals {
common_vars = read_terragrunt_config(find_in_parent_folders())
include "root" {
path = find_in_parent_folders()
expose = true
}

inputs = merge(
local.common_vars.locals,
include.root.locals,
{
env = "dev"
cloud_run_service = "distributor-service-dev"
slack_template_json = file("slack.json")
}
Expand Down
16 changes: 4 additions & 12 deletions deployment/live/cloudbuild/prod/terragrunt.hcl
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
include {
path = find_in_parent_folders()
}

terraform {
source = "${get_path_to_repo_root()}/deployment/modules/cloudbuild"
}

locals {
common_vars = read_terragrunt_config(find_in_parent_folders())
include "root" {
path = find_in_parent_folders()
expose = true
}

inputs = merge(
local.common_vars.locals,
include.root.locals,
{
env = "prod"
cloud_run_service = "distributor-service-ci"
slack_template_json = file("slack.json")
}
Expand Down
4 changes: 4 additions & 0 deletions deployment/live/cloudbuild/terragrunt.hcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
terraform {
source = "${get_repo_root()}/deployment/modules/cloudbuild"
}

locals {
project_id = "checkpoint-distributor"
region = "us-central1"
Expand Down
16 changes: 4 additions & 12 deletions deployment/live/monitoring/ci/terragrunt.hcl
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
include {
path = find_in_parent_folders()
}

terraform {
source = "${get_path_to_repo_root()}/deployment/modules/monitoring"
}

locals {
common_vars = read_terragrunt_config(find_in_parent_folders())
include "root" {
path = find_in_parent_folders()
expose = true
}

inputs = merge(
local.common_vars.locals,
include.root.locals,
{
env = "ci"
}
)

16 changes: 4 additions & 12 deletions deployment/live/monitoring/dev/terragrunt.hcl
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
include {
path = find_in_parent_folders()
}

terraform {
source = "${get_path_to_repo_root()}/deployment/modules/monitoring"
}

locals {
common_vars = read_terragrunt_config(find_in_parent_folders())
include "root" {
path = find_in_parent_folders()
expose = true
}

inputs = merge(
local.common_vars.locals,
include.root.locals,
{
env = "dev"
}
)

16 changes: 4 additions & 12 deletions deployment/live/monitoring/prod/terragrunt.hcl
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
include {
path = find_in_parent_folders()
}

terraform {
source = "${get_path_to_repo_root()}/deployment/modules/monitoring"
}

locals {
common_vars = read_terragrunt_config(find_in_parent_folders())
include "root" {
path = find_in_parent_folders()
expose = true
}

inputs = merge(
local.common_vars.locals,
include.root.locals,
{
env = "prod"
}
)

4 changes: 4 additions & 0 deletions deployment/live/monitoring/terragrunt.hcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
terraform {
source = "${get_repo_root()}/deployment/modules/monitoring"
}

locals {
project_id = "checkpoint-distributor"
region = "us-central1"
Expand Down

0 comments on commit 5e3cba3

Please sign in to comment.