-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
59 lines (45 loc) · 1.25 KB
/
main.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package main
import (
// Used for debugging
"flag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/plugin"
"github.com/NorskHelsenett/terraform-provider-tss/tss"
)
func main() {
var debug bool
flag.BoolVar(&debug, "debug", false, "set to true to run the provider with support for debuggers like delve")
flag.Parse()
opts := &plugin.ServeOpts{
Debug: debug,
ProviderAddr: "registry.terraform.io/example-namespace/example",
ProviderFunc: func() *schema.Provider {
return tss.Provider()
},
}
plugin.Serve(opts)
// var debugMode bool
// flag.BoolVar(&debugMode, "debug", false, "set to true to run the provider with support for debuggers like delve")
// flag.Parse()
// if debugMode {
// // err := plugin.Debug(context.Background(), "terraform.local/nhn/tss", opts)
// // if err != nil {
// // log.Fatal(err.Error())
// // }
// // return
// opts := &plugin.ServeOpts{
// ProviderFunc: func() *schema.Provider {
// return tss.Provider()
// },
// Debug: true,
// }
// plugin.Serve(opts)
// } else {
// opts := &plugin.ServeOpts{
// ProviderFunc: func() *schema.Provider {
// return tss.Provider()
// },
// }
// plugin.Serve(opts)
// }
}