diff --git a/terraform/resource.go b/terraform/resource.go index df327eef2..961289c6f 100644 --- a/terraform/resource.go +++ b/terraform/resource.go @@ -153,15 +153,6 @@ func NewInstanceInfo(addr addrs.AbsResourceInstance) *InstanceInfo { } } -// HumanId is a unique Id that is human-friendly and useful for UI elements. -func (i *InstanceInfo) HumanId() string { - p := normalizeModulePath(i.ModulePath) - if p.IsRoot() { - return i.Id - } - return fmt.Sprintf("%s.%s", p.String(), i.Id) -} - // ResourceAddress returns the address of the resource that the receiver is describing. func (i *InstanceInfo) ResourceAddress() *ResourceAddress { // GROSS: for tainted and deposed instances, their status gets appended @@ -202,15 +193,6 @@ func (i *InstanceInfo) ResourceAddress() *ResourceAddress { return addr } -func (i *InstanceInfo) uniqueId() string { - prefix := i.HumanId() - if v := i.uniqueExtra; v != "" { - prefix += " " + v - } - - return prefix -} - // ResourceConfig is a legacy type that was formerly used to represent // interpolatable configuration blocks. It is now only used to shim to old // APIs that still use this type, via NewResourceConfigShimmed. diff --git a/terraform/resource_test.go b/terraform/resource_test.go index 4566492dc..35ac6e489 100644 --- a/terraform/resource_test.go +++ b/terraform/resource_test.go @@ -12,41 +12,6 @@ import ( "github.com/mitchellh/reflectwalk" ) -func TestInstanceInfo(t *testing.T) { - cases := []struct { - Info *InstanceInfo - Result string - }{ - { - &InstanceInfo{ - Id: "foo", - }, - "foo", - }, - { - &InstanceInfo{ - Id: "foo", - ModulePath: rootModulePath, - }, - "foo", - }, - { - &InstanceInfo{ - Id: "foo", - ModulePath: []string{"root", "consul"}, - }, - "module.consul.foo", - }, - } - - for i, tc := range cases { - actual := tc.Info.HumanId() - if actual != tc.Result { - t.Fatalf("%d: %s", i, actual) - } - } -} - func TestInstanceInfoResourceAddress(t *testing.T) { tests := []struct { Input *InstanceInfo