github.com/chalford/terraform@v0.3.7-0.20150113080010-a78c69a8c81f/builtin/providers/null/resource.go (about) 1 package null 2 3 import ( 4 "fmt" 5 "math/rand" 6 "time" 7 8 "github.com/hashicorp/terraform/helper/schema" 9 ) 10 11 func init() { 12 rand.Seed(time.Now().Unix()) 13 } 14 15 func resource() *schema.Resource { 16 return &schema.Resource{ 17 Create: resourceCreate, 18 Read: resourceRead, 19 Update: resourceUpdate, 20 Delete: resourceDelete, 21 22 Schema: map[string]*schema.Schema{}, 23 } 24 } 25 26 func resourceCreate(d *schema.ResourceData, meta interface{}) error { 27 d.SetId(fmt.Sprintf("%d", rand.Int())) 28 return nil 29 } 30 31 func resourceRead(d *schema.ResourceData, meta interface{}) error { 32 return nil 33 } 34 35 func resourceUpdate(d *schema.ResourceData, meta interface{}) error { 36 return nil 37 } 38 39 func resourceDelete(d *schema.ResourceData, meta interface{}) error { 40 d.SetId("") 41 return nil 42 }