-
Notifications
You must be signed in to change notification settings - Fork 508
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix recursive variable reference resolution
- Loading branch information
1 parent
2033718
commit 3b6a7c9
Showing
5 changed files
with
45 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
9 changes: 9 additions & 0 deletions
9
pkg/iac-providers/terraform/v14/testdata/recursive-loop/bug.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 @@ | ||
variable "filename" { | ||
type = string | ||
} | ||
|
||
module "dummy" { | ||
source = "./dummy" | ||
|
||
filename = "${path.module}/${var.filename}" | ||
} |
12 changes: 12 additions & 0 deletions
12
pkg/iac-providers/terraform/v14/testdata/recursive-loop/dummy/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 @@ | ||
variable "filename" { | ||
type = string | ||
} | ||
|
||
resource "null_resource" "example" { | ||
container_definitions = templatefile( | ||
var.filename, | ||
{ | ||
foo = "bar" | ||
} | ||
) | ||
} |
15 changes: 15 additions & 0 deletions
15
pkg/iac-providers/terraform/v14/testdata/tfjson/recursive-loop.json
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,15 @@ | ||
{ | ||
"null_resource": [ | ||
{ | ||
"id": "null_resource.example", | ||
"name": "example", | ||
"source": "dummy/main.tf", | ||
"line": 5, | ||
"type": "null_resource", | ||
"config": { | ||
"container_definitions": "${templatefile(\n ${path.module}/${var.filename},\n {\n foo = \"bar\"\n }\n )}" | ||
}, | ||
"skip_rules": null | ||
} | ||
] | ||
} |