diff --git a/terraform/context_apply_test.go b/terraform/context_apply_test.go index 334c285b0..47b298769 100644 --- a/terraform/context_apply_test.go +++ b/terraform/context_apply_test.go @@ -5396,7 +5396,7 @@ func TestContext2Apply_provisionerDestroyRef(t *testing.T) { // Test that a destroy provisioner referencing an invalid key errors. func TestContext2Apply_provisionerDestroyRefInvalid(t *testing.T) { - m := testModule(t, "apply-provisioner-destroy-ref") + m := testModule(t, "apply-provisioner-destroy-ref-invalid") p := testProvider("aws") pr := testProvisioner() p.ApplyFn = testApplyFn diff --git a/terraform/test-fixtures/apply-provisioner-destroy-ref-invalid/main.tf b/terraform/test-fixtures/apply-provisioner-destroy-ref-invalid/main.tf new file mode 100644 index 000000000..fb4a96b10 --- /dev/null +++ b/terraform/test-fixtures/apply-provisioner-destroy-ref-invalid/main.tf @@ -0,0 +1,12 @@ +resource "aws_instance" "bar" { + value = "hello" +} + +resource "aws_instance" "foo" { + foo = "bar" + + provisioner "shell" { + command = aws_instance.bar.does_not_exist + when = "destroy" + } +}