-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug with parsing extra arguments (#67)
Co-authored-by: dmattia <david@transcend.io>
- Loading branch information
Showing
5 changed files
with
105 additions
and
4 deletions.
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
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
20 changes: 20 additions & 0 deletions
20
test_examples/extra_arguments/no_files_at_all/terragrunt.hcl
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 @@ | ||
include { | ||
path = find_in_parent_folders() | ||
} | ||
|
||
terraform { | ||
source = "git::git@github.com:transcend-io/terraform-aws-fargate-container?ref=v0.0.4" | ||
extra_arguments "conditional_vars" { | ||
commands = [ | ||
"apply", | ||
"plan", | ||
"import", | ||
"push", | ||
"refresh" | ||
] | ||
} | ||
} | ||
|
||
inputs = { | ||
foo = "bar" | ||
} |
30 changes: 30 additions & 0 deletions
30
test_examples/extra_arguments/only_optional_files/terragrunt.hcl
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,30 @@ | ||
include { | ||
path = find_in_parent_folders() | ||
} | ||
|
||
terraform { | ||
source = "git::git@github.com:transcend-io/terraform-aws-fargate-container?ref=v0.0.4" | ||
extra_arguments "conditional_vars" { | ||
commands = [ | ||
"apply", | ||
"plan", | ||
"import", | ||
"push", | ||
"refresh" | ||
] | ||
|
||
# Small note: get_env can't really be supported very well here. | ||
# In a case like this, I'd use a for loop to construct | ||
# `extra_atlantis_dependencies` in locals for all possible regions | ||
optional_var_files = [ | ||
"${get_parent_terragrunt_dir()}/${get_env("TF_VAR_env", "dev")}.tfvars", | ||
"${get_parent_terragrunt_dir()}/${get_env("TF_VAR_region", "us-east-1")}.tfvars", | ||
"${get_terragrunt_dir()}/${get_env("TF_VAR_env", "dev")}.tfvars", | ||
"${get_terragrunt_dir()}/${get_env("TF_VAR_region", "us-east-1")}.tfvars" | ||
] | ||
} | ||
} | ||
|
||
inputs = { | ||
foo = "bar" | ||
} |
24 changes: 24 additions & 0 deletions
24
test_examples/extra_arguments/only_required_files/terragrunt.hcl
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,24 @@ | ||
include { | ||
path = find_in_parent_folders() | ||
} | ||
|
||
terraform { | ||
source = "git::git@github.com:transcend-io/terraform-aws-fargate-container?ref=v0.0.4" | ||
extra_arguments "conditional_vars" { | ||
commands = [ | ||
"apply", | ||
"plan", | ||
"import", | ||
"push", | ||
"refresh" | ||
] | ||
|
||
required_var_files = [ | ||
"${get_parent_terragrunt_dir()}/terraform.tfvars" | ||
] | ||
} | ||
} | ||
|
||
inputs = { | ||
foo = "bar" | ||
} |