helper/schema: pass through import state func

This commit is contained in:
Mitchell Hashimoto 2016-05-11 13:10:30 -07:00
parent b9d0e14d2a
commit b7d4767dd6
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A

View File

@ -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
}