From 21888b12273c2484d94973c7b891458ef3caa666 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 15 Sep 2016 18:31:13 -0700 Subject: [PATCH] terraform: test for referencetransform for modules --- terraform/graph_builder_apply_test.go | 14 +++++++++++++- .../graph-builder-apply-basic/child/main.tf | 4 ++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/terraform/graph_builder_apply_test.go b/terraform/graph_builder_apply_test.go index 6c384a9f4..ff6d71e28 100644 --- a/terraform/graph_builder_apply_test.go +++ b/terraform/graph_builder_apply_test.go @@ -50,6 +50,15 @@ func TestApplyGraphBuilder(t *testing.T) { }, }, }, + + "aws_instance.other": &InstanceDiff{ + Attributes: map[string]*ResourceAttrDiff{ + "name": &ResourceAttrDiff{ + Old: "", + New: "foo", + }, + }, + }, }, }, }, @@ -87,11 +96,14 @@ aws_instance.other module.child.aws_instance.create module.child.provider.aws provisioner.exec +module.child.aws_instance.other + module.child.aws_instance.create + module.child.provider.aws module.child.provider.aws provider.aws provider.aws provisioner.exec root aws_instance.other - module.child.aws_instance.create + module.child.aws_instance.other ` diff --git a/terraform/test-fixtures/graph-builder-apply-basic/child/main.tf b/terraform/test-fixtures/graph-builder-apply-basic/child/main.tf index e486aaa2c..b802817b8 100644 --- a/terraform/test-fixtures/graph-builder-apply-basic/child/main.tf +++ b/terraform/test-fixtures/graph-builder-apply-basic/child/main.tf @@ -1,3 +1,7 @@ resource "aws_instance" "create" { provisioner "exec" {} } + +resource "aws_instance" "other" { + value = "${aws_instance.create.id}" +}