github.com/mohanarpit/terraform@v0.6.16-0.20160909104007-291f29853544/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  		Delete: resourceDelete,
    20  
    21  		Schema: map[string]*schema.Schema{
    22  			"triggers": &schema.Schema{
    23  				Type:     schema.TypeMap,
    24  				Optional: true,
    25  				ForceNew: true,
    26  			},
    27  		},
    28  	}
    29  }
    30  
    31  func resourceCreate(d *schema.ResourceData, meta interface{}) error {
    32  	d.SetId(fmt.Sprintf("%d", rand.Int()))
    33  	return nil
    34  }
    35  
    36  func resourceRead(d *schema.ResourceData, meta interface{}) error {
    37  	return nil
    38  }
    39  
    40  func resourceDelete(d *schema.ResourceData, meta interface{}) error {
    41  	d.SetId("")
    42  	return nil
    43  }