From b7d4767dd679ff81cfdf53c2cc5d8eeabab9112c Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 11 May 2016 13:10:30 -0700 Subject: [PATCH] helper/schema: pass through import state func --- helper/schema/resource_importer.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/helper/schema/resource_importer.go b/helper/schema/resource_importer.go index 69d66afd95..5dada3caf3 100644 --- a/helper/schema/resource_importer.go +++ b/helper/schema/resource_importer.go @@ -43,3 +43,10 @@ type StateFunc func(*ResourceData, interface{}) ([]*ResourceData, error) func (r *ResourceImporter) InternalValidate() error { return nil } + +// ImportStatePassthrough is an implementation of StateFunc that can be +// used to simply pass the ID directly through. This should be used only +// in the case that an ID-only refresh is possible. +func ImportStatePassthrough(d *ResourceData, m interface{}) ([]*ResourceData, error) { + return []*ResourceData{d}, nil +}