diff --git a/terraform/graph_builder_test.go b/terraform/graph_builder_test.go index a049853301..ee1dbc1f54 100644 --- a/terraform/graph_builder_test.go +++ b/terraform/graph_builder_test.go @@ -73,6 +73,19 @@ func TestBuiltinGraphBuilder(t *testing.T) { } } +// This tests a cycle we got when a CBD resource depends on a non-CBD +// resource. This cycle shouldn't happen in the general case anymore. +func TestBuiltinGraphBuilder_cbdDepNonCbd(t *testing.T) { + b := &BuiltinGraphBuilder{ + Root: testModule(t, "graph-builder-cbd-non-cbd"), + } + + _, err := b.Build(RootModulePath) + if err != nil { + t.Fatalf("err: %s", err) + } +} + /* TODO: This exposes a really bad bug we need to fix after we merge the f-ast-branch. This bug still exists in master. diff --git a/terraform/test-fixtures/graph-builder-cbd-non-cbd/main.tf b/terraform/test-fixtures/graph-builder-cbd-non-cbd/main.tf new file mode 100644 index 0000000000..f478d4f33a --- /dev/null +++ b/terraform/test-fixtures/graph-builder-cbd-non-cbd/main.tf @@ -0,0 +1,9 @@ +provider "aws" {} + +resource "aws_lc" "foo" {} + +resource "aws_asg" "foo" { + lc = "${aws_lc.foo.id}" + + lifecycle { create_before_destroy = true } +}