File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
pkg/iac/scanners/terraform/parser Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -1800,6 +1800,32 @@ output "set_count" {
1800
1800
assert .Len (t , datas , 2 )
1801
1801
}
1802
1802
1803
+ func TestBlockCountModules (t * testing.T ) {
1804
+ t .Skip ("This test is currently failing, the 'count = 0' module 'bar' is still loaded" )
1805
+ // `count` meta attributes are incorrectly handled when referencing
1806
+ // a module output.
1807
+ files := map [string ]string {
1808
+ "main.tf" : `
1809
+ module "foo" {
1810
+ source = "./modules/foo"
1811
+ }
1812
+
1813
+ module "bar" {
1814
+ source = "./modules/foo"
1815
+ count = module.foo.staticZero
1816
+ }
1817
+ ` ,
1818
+ "modules/foo/main.tf" : `
1819
+ output "staticZero" {
1820
+ value = 0
1821
+ }
1822
+ ` ,
1823
+ }
1824
+
1825
+ modules := parse (t , files )
1826
+ require .Len (t , modules , 2 )
1827
+ }
1828
+
1803
1829
// TestNestedModulesOptions ensures parser options are carried to the nested
1804
1830
// submodule evaluators.
1805
1831
// The test will include an invalid module that will fail to download
You can’t perform that action at this time.
0 commit comments