diff --git a/terraform/context_test.go b/terraform/context_test.go index 0fb90ed1a..58c5d050c 100644 --- a/terraform/context_test.go +++ b/terraform/context_test.go @@ -2137,7 +2137,7 @@ func TestContext2Validate_provisionerConfig_good(t *testing.T) { if c == nil { t.Fatalf("missing resource config for provisioner") } - return nil, nil + return nil, c.CheckSet([]string{"command"}) } c := testContext2(t, &ContextOpts{ Module: m, diff --git a/terraform/test-fixtures/validate-bad-prov-conf/main.tf b/terraform/test-fixtures/validate-bad-prov-conf/main.tf index abca992de..347cfc02a 100644 --- a/terraform/test-fixtures/validate-bad-prov-conf/main.tf +++ b/terraform/test-fixtures/validate-bad-prov-conf/main.tf @@ -3,5 +3,7 @@ provider "aws" { } resource "aws_instance" "test" { - provisioner "shell" {} + provisioner "shell" { + command = "foo" + } } diff --git a/terraform/transform_resource.go b/terraform/transform_resource.go index 14ea0a0e8..06ef0027c 100644 --- a/terraform/transform_resource.go +++ b/terraform/transform_resource.go @@ -137,6 +137,10 @@ func (n *graphNodeExpandedResource) EvalTree() EvalNode { vseq.Nodes = append(vseq.Nodes, &EvalGetProvisioner{ Name: p.Type, Output: &provisioner, + }, &EvalInterpolate{ + Config: p.RawConfig, + Resource: resource, + Output: &resourceConfig, }, &EvalValidateProvisioner{ Provisioner: &provisioner, Config: &resourceConfig,