Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Check planfile and put it in the end of an arguments list (#1740)
* check planfile and put it in the end of an args list * fix naming * replace IsFile check * rename planfile function * add planfile fixture * remove remote state; fix test and clarify args * add fixture gitignore * add special check for tfplan extension * optimize planfile check Co-authored-by: Roman Pertsev <roman.pertsev@nordigy.ru>
- Loading branch information
1 parent
9ddac0b
commit c145252
Showing
8 changed files
with
93 additions
and
2 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
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 @@ | ||
test-provider.tf |
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,3 @@ | ||
variable "resource_count" { | ||
type = number | ||
} |
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,3 @@ | ||
resource "null_resource" "test-resources" { | ||
count = var.resource_count | ||
} |
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,36 @@ | ||
# Configure Terragrunt to automatically store tfstate files in an S3 bucket | ||
generate "test-null-provider" { | ||
path = "test-provider.tf" | ||
if_exists = "overwrite_terragrunt" | ||
|
||
contents = <<EOF | ||
provider "null" { | ||
} | ||
EOF | ||
} | ||
|
||
terraform { | ||
extra_arguments "plan_vars" { | ||
commands = [ | ||
"plan", | ||
] | ||
|
||
arguments = [ | ||
"-out=${get_terragrunt_dir()}/default.tfplan", | ||
"-var-file", | ||
"${get_terragrunt_dir()}/vars/variables.tfvars", | ||
"-no-color", | ||
] | ||
} | ||
|
||
extra_arguments "apply_vars" { | ||
commands = [ | ||
"apply", | ||
] | ||
|
||
arguments = [ | ||
"${get_terragrunt_dir()}/default.tfplan", | ||
"-no-color", | ||
] | ||
} | ||
} |
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 @@ | ||
resource_count = 3 |
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