diff --git a/terraform/context_apply_test.go b/terraform/context_apply_test.go index 90f549086..87dd424f3 100644 --- a/terraform/context_apply_test.go +++ b/terraform/context_apply_test.go @@ -238,7 +238,8 @@ func TestContext2Apply_resourceDependsOnModule(t *testing.T) { info *InstanceInfo, is *InstanceState, id *InstanceDiff) (*InstanceState, error) { - if info.HumanId() == "module.child.aws_instance.child" { + + if id.Attributes["ami"].New == "child" { // make the child slower than the parent time.Sleep(50 * time.Millisecond) diff --git a/terraform/test-fixtures/apply-resource-depends-on-module/child/main.tf b/terraform/test-fixtures/apply-resource-depends-on-module/child/main.tf index 33e4ced51..949d8e1b5 100644 --- a/terraform/test-fixtures/apply-resource-depends-on-module/child/main.tf +++ b/terraform/test-fixtures/apply-resource-depends-on-module/child/main.tf @@ -1 +1,3 @@ -resource "aws_instance" "child" {} +resource "aws_instance" "child" { + ami = "child" +} diff --git a/terraform/test-fixtures/apply-resource-depends-on-module/main.tf b/terraform/test-fixtures/apply-resource-depends-on-module/main.tf index a0859c0fd..1a7862b0a 100644 --- a/terraform/test-fixtures/apply-resource-depends-on-module/main.tf +++ b/terraform/test-fixtures/apply-resource-depends-on-module/main.tf @@ -1,7 +1,9 @@ module "child" { - source = "./child" + source = "./child" } resource "aws_instance" "a" { - depends_on = ["module.child"] + ami = "parent" + + depends_on = ["module.child"] }