diff --git a/config/config_test.go b/config/config_test.go index e90d32b69..e4892a277 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -95,6 +95,13 @@ func TestConfigValidate_countUserVar(t *testing.T) { } } +func TestConfigValidate_countVar(t *testing.T) { + c := testConfig(t, "validate-count-var") + if err := c.Validate(); err != nil { + t.Fatal("err: %s", err) + } +} + func TestConfigValidate_countVarInvalid(t *testing.T) { c := testConfig(t, "validate-count-var-invalid") if err := c.Validate(); err == nil { diff --git a/config/test-fixtures/validate-count-var/main.tf b/config/test-fixtures/validate-count-var/main.tf new file mode 100644 index 000000000..c189c7d1a --- /dev/null +++ b/config/test-fixtures/validate-count-var/main.tf @@ -0,0 +1,3 @@ +resource "aws_instance" "foo" { + foo = "${count.index}" +}