-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wired up roots with terragrunt hcl's
- Loading branch information
1 parent
507e649
commit a77549c
Showing
5 changed files
with
116 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,7 @@ terragrunt.hcl | |
common_vars.yaml | ||
remote-state.tf | ||
|
||
destroyCleanup.sh | ||
!tf/roots/*/terragrunt.hcl | ||
|
||
graph.svg | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Doc: [Configuration Parsing Order](https://terragrunt.gruntwork.io/docs/getting-started/configuration/#configuration-parsing-order) | ||
|
||
include { | ||
path = find_in_parent_folders() | ||
} | ||
|
||
locals { | ||
common_vars = yamldecode(file("${get_terragrunt_dir()}/${find_in_parent_folders("common_vars.yaml")}")) | ||
// More locals here ... | ||
} | ||
|
||
inputs = { | ||
suts_attributes = local.common_vars.suts_attributes | ||
} | ||
|
||
terraform { | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Doc: [Configuration Parsing Order](https://terragrunt.gruntwork.io/docs/getting-started/configuration/#configuration-parsing-order) | ||
|
||
include { | ||
path = find_in_parent_folders() | ||
} | ||
|
||
locals { | ||
common_vars = yamldecode(file("${get_terragrunt_dir()}/${find_in_parent_folders("common_vars.yaml")}")) | ||
// More locals here ... | ||
} | ||
|
||
inputs = { | ||
suts_attributes = local.common_vars.suts_attributes | ||
|
||
} | ||
|
||
terraform { | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Doc: [Configuration Parsing Order](https://terragrunt.gruntwork.io/docs/getting-started/configuration/#configuration-parsing-order) | ||
|
||
include { | ||
path = find_in_parent_folders() | ||
} | ||
|
||
locals { | ||
common_vars = yamldecode(file("${get_terragrunt_dir()}/${find_in_parent_folders("common_vars.yaml")}")) | ||
// More locals here ... | ||
} | ||
|
||
dependency "static" { | ||
config_path = "../1_static" | ||
} | ||
|
||
dependency "nw" { | ||
config_path = "../2_nw" | ||
} | ||
|
||
inputs = { | ||
// Consume static outputs | ||
ecs_instance_profile = dependency.static.outputs.ecs_instance_profile | ||
ecs_service_role = dependency.static.outputs.ecs_service_role | ||
ecs_task_execution_role = dependency.static.outputs.ecs_task_execution_role | ||
|
||
// Consume nw outputs | ||
sg_sut_id = dependency.nw.outputs.sg_sut_id | ||
sg_ssh_id = dependency.nw.outputs.sg_ssh_id | ||
vpc_id = dependency.nw.outputs.vpc_id | ||
aws_lb_target_groups = dependency.nw.outputs.aws_lb_target_groups | ||
public_subnet_ids = dependency.nw.outputs.public_subnet_ids | ||
// Take public_subnet_ids from the output of the nw root (Ex: ["subnet-053a640b55610b633"]) and merge into each of the SUTs attributes currently null public_subnet_ids. | ||
suts_attributes = { | ||
for sut_key, sut_val in local.common_vars.suts_attributes: | ||
sut_key => merge(sut_val, {public_subnet_ids = dependency.nw.outputs.public_subnet_ids}) | ||
} | ||
} | ||
|
||
terraform { | ||
after_hook "delete_left_over_log_groups" { | ||
commands = ["destroy"] | ||
execute = ["bash", "./deleteLeftOverLogGroups.sh", "${get_terragrunt_dir()}/${find_in_parent_folders(".env")}"] | ||
run_on_error = true | ||
} | ||
} | ||
|
||
# redirects stderr (2) into stdout (1), then pipes stdout into tee, which copies it to the terminal and to the log file. | ||
# terragrunt apply -no-color 2>&1 | tee out | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Doc: [Configuration Parsing Order](https://terragrunt.gruntwork.io/docs/getting-started/configuration/#configuration-parsing-order) | ||
|
||
include { | ||
path = find_in_parent_folders() | ||
} | ||
|
||
locals { | ||
common_vars = yamldecode(file("${get_terragrunt_dir()}/${find_in_parent_folders("common_vars.yaml")}")) | ||
// More locals here ... | ||
} | ||
|
||
|
||
|
||
inputs = { | ||
|
||
} | ||
|
||
|
||
terraform { | ||
// https://github.com/terraform-providers/terraform-provider-aws/issues/3174#issuecomment-383718440 | ||
extra_arguments "concurrency_issues_in_api_gateway" { | ||
commands = ["apply", "destroy"] | ||
arguments = ["-parallelism=5"] | ||
} | ||
} | ||
|