From cc5b1d452fabbab58eda637df56d65b764df4594 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Tue, 22 May 2018 18:49:22 -0700 Subject: [PATCH] core: NewInstanceInfo now produces correct "id" for data resources We need to mimic the old API here, and we weren't doing that quite right since the "data" prefix was missing from data resources. --- terraform/resource.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/terraform/resource.go b/terraform/resource.go index e524c7968..0aeaa58dc 100644 --- a/terraform/resource.go +++ b/terraform/resource.go @@ -132,6 +132,9 @@ func NewInstanceInfo(addr addrs.AbsResource) *InstanceInfo { // determine from an InstanceInfo alone whether it is a managed or data // resource that is being referred to. id := fmt.Sprintf("%s.%s", addr.Resource.Type, addr.Resource.Name) + if addr.Resource.Mode == addrs.DataResourceMode { + id = "data." + id + } return &InstanceInfo{ Id: id,