diff --git a/terraform/resource.go b/terraform/resource.go index 7923409ae..573851026 100644 --- a/terraform/resource.go +++ b/terraform/resource.go @@ -48,21 +48,6 @@ const ( FlagHasTainted ) -// Vars returns the mapping of variables that should be replaced in -// configuration based on the attributes of this resource. -func (r *Resource) Vars() map[string]string { - if r.State == nil { - return nil - } - - vars := make(map[string]string) - for ak, av := range r.State.Attributes { - vars[fmt.Sprintf("%s.%s", r.Id, ak)] = av - } - - return vars -} - // ResourceConfig holds the configuration given for a resource. This is // done instead of a raw `map[string]interface{}` type so that rich // methods can be added to it to make dealing with it easier. diff --git a/terraform/resource_test.go b/terraform/resource_test.go index 19ed56355..17d4b5469 100644 --- a/terraform/resource_test.go +++ b/terraform/resource_test.go @@ -7,31 +7,6 @@ import ( "github.com/hashicorp/terraform/config" ) -func TestResource_Vars(t *testing.T) { - r := new(Resource) - - if len(r.Vars()) > 0 { - t.Fatalf("bad: %#v", r.Vars()) - } - - r = &Resource{ - Id: "key", - State: &InstanceState{ - Attributes: map[string]string{ - "foo": "bar", - }, - }, - } - - expected := map[string]string{ - "key.foo": "bar", - } - actual := r.Vars() - if !reflect.DeepEqual(actual, expected) { - t.Fatalf("bad: %#v", actual) - } -} - func TestResourceConfigGet(t *testing.T) { cases := []struct { Config map[string]interface{}