-
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): check if the dynamic name is one of the resources blo…
…ck (#5607) * check if the dynamic name is one of the resources block * . * Update tests/terraform/graph/variable_rendering/test_renderer.py Co-authored-by: Barak Fatal <[email protected]> --------- Co-authored-by: Barak Fatal <[email protected]>
- Loading branch information
1 parent
1b66c38
commit 1927999
Showing
7 changed files
with
94 additions
and
10 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
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
31 changes: 31 additions & 0 deletions
31
tests/terraform/graph/variable_rendering/test_resources/multiple_dynamic_blocks/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,31 @@ | ||
resource "google_sql_database_instance" "instance4-should-fail" { | ||
name = "instance" | ||
database_version = "POSTGRES_11" | ||
|
||
settings { | ||
tier = "db-f1-micro" | ||
|
||
ip_configuration { | ||
|
||
dynamic "authorized_networks" { | ||
for_each = google_compute_instance.apps | ||
iterator = apps | ||
|
||
content { | ||
name = apps.value.name | ||
value = apps.value.network_interface.0.access_config.0.nat_ip | ||
} | ||
} | ||
|
||
dynamic "authorized_networks" { | ||
for_each = local.onprem | ||
iterator = onprem | ||
|
||
content { | ||
name = "onprem-${onprem.key}" | ||
value = "0.0.0.0/0" | ||
} | ||
} | ||
} | ||
} | ||
} |