diff --git a/terraform/context_plan_test.go b/terraform/context_plan_test.go index 3eb213028..8240e435f 100644 --- a/terraform/context_plan_test.go +++ b/terraform/context_plan_test.go @@ -3527,28 +3527,34 @@ STATE: aws_instance.bar.0: ID = bar0 + provider = provider.aws Dependencies: aws_instance.foo.* aws_instance.bar.1: ID = bar1 + provider = provider.aws Dependencies: aws_instance.foo.* aws_instance.baz.0: ID = baz0 + provider = provider.aws Dependencies: aws_instance.bar.* aws_instance.baz.1: ID = baz1 + provider = provider.aws Dependencies: aws_instance.bar.* aws_instance.foo.0: ID = foo0 + provider = provider.aws aws_instance.foo.1: ID = foo1 + provider = provider.aws `) if actual != expected { t.Fatalf("bad:\n%s\n\nexpected\n\n%s", actual, expected) diff --git a/terraform/context_test.go b/terraform/context_test.go index f528f2602..7ef9245d7 100644 --- a/terraform/context_test.go +++ b/terraform/context_test.go @@ -416,15 +416,18 @@ root const testContextRefreshModuleStr = ` aws_instance.web: (tainted) ID = bar + provider = provider.aws module.child: aws_instance.web: ID = new + provider = provider.aws ` const testContextRefreshOutputStr = ` aws_instance.web: ID = foo + provider = provider.aws foo = bar Outputs: @@ -439,4 +442,5 @@ const testContextRefreshOutputPartialStr = ` const testContextRefreshTaintedStr = ` aws_instance.web: (tainted) ID = foo + provider = provider.aws ` diff --git a/terraform/node_resource_destroy.go b/terraform/node_resource_destroy.go index 74a1e5494..657bbee7f 100644 --- a/terraform/node_resource_destroy.go +++ b/terraform/node_resource_destroy.go @@ -275,7 +275,7 @@ func (n *NodeDestroyResource) EvalTree() EvalNode { &EvalWriteState{ Name: stateId, ResourceType: n.Addr.Type, - Provider: rs.Provider, + Provider: n.ResolvedProvider, Dependencies: rs.Dependencies, State: &state, }, diff --git a/terraform/node_resource_refresh.go b/terraform/node_resource_refresh.go index c18c95f96..dbb64edae 100644 --- a/terraform/node_resource_refresh.go +++ b/terraform/node_resource_refresh.go @@ -166,7 +166,7 @@ func (n *NodeRefreshableManagedResourceInstance) evalTreeManagedResource() EvalN &EvalWriteState{ Name: stateId, ResourceType: n.ResourceState.Type, - Provider: n.ResourceState.Provider, + Provider: n.ResolvedProvider, Dependencies: n.ResourceState.Dependencies, State: &state, },