forked from hashicorp/terraform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
resource.go
43 lines (35 loc) · 748 Bytes
/
resource.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package null
import (
"fmt"
"math/rand"
"time"
"github.com/hashicorp/terraform/helper/schema"
)
func init() {
rand.Seed(time.Now().Unix())
}
func resource() *schema.Resource {
return &schema.Resource{
Create: resourceCreate,
Read: resourceRead,
Delete: resourceDelete,
Schema: map[string]*schema.Schema{
"triggers": &schema.Schema{
Type: schema.TypeMap,
Optional: true,
ForceNew: true,
},
},
}
}
func resourceCreate(d *schema.ResourceData, meta interface{}) error {
d.SetId(fmt.Sprintf("%d", rand.Int()))
return nil
}
func resourceRead(d *schema.ResourceData, meta interface{}) error {
return nil
}
func resourceDelete(d *schema.ResourceData, meta interface{}) error {
d.SetId("")
return nil
}