-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(terraform): Dont duplicate more vertices than needed for nested m…
…odules with large count/for each values + used cache to avoid extensive usage of os.path.realpath to drastically improve performance (#6072) * Used cache to avoid extensive usage of os.path.realpath to drastically improve performance * Mypy and comment fix * Solved duplicate vertices case when using nested modules and count>2
- Loading branch information
Showing
6 changed files
with
58 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
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
11 changes: 11 additions & 0 deletions
11
...raph/variable_rendering/resources/os_example_large_count_with_nested_module/child/main.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,11 @@ | ||
## child/main.tf | ||
variable "child-name" { | ||
type = string | ||
} | ||
resource "terraform_data" "child-example" { | ||
input = "1" | ||
} | ||
output "child-result" { | ||
value = terraform_data.child-example.output | ||
} | ||
|
9 changes: 9 additions & 0 deletions
9
...m/graph/variable_rendering/resources/os_example_large_count_with_nested_module/modules.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,9 @@ | ||
# modules.tf | ||
module "modules" { | ||
count = 12 | ||
source = "./parent" | ||
parent = count.index | ||
} | ||
output "modules-result" { | ||
value = { for k, v in module.modules-parent : k => v } | ||
} |
12 changes: 12 additions & 0 deletions
12
...aph/variable_rendering/resources/os_example_large_count_with_nested_module/parent/main.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,12 @@ | ||
# parent/main.tf | ||
variable "parent" { | ||
type = string | ||
} | ||
module "parent" { | ||
source = "../child" | ||
child-name = "1" | ||
} | ||
|
||
output "parent-result" { | ||
value = module.parent.child-result | ||
} |
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