diff --git a/helper/schema/resource.go b/helper/schema/resource.go index 28f620881..dad58eabc 100644 --- a/helper/schema/resource.go +++ b/helper/schema/resource.go @@ -384,3 +384,17 @@ func (r *Resource) recordCurrentSchemaVersion( } return state } + +// Noop is a convenience implementation of resource function which takes +// no action and returns no error. +func Noop(*ResourceData, interface{}) error { + return nil +} + +// RemoveFromState is a convenience implementation of a resource function +// which sets the resource ID to empty string (to remove it from state) +// and returns no error. +func RemoveFromState(d *ResourceData, _ interface{}) error { + d.SetId("") + return nil +}