-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.go
41 lines (30 loc) · 883 Bytes
/
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
package main
import (
"context"
"flag"
"log"
"github.com/okta/terraform-provider-oktapam/oktapam"
"github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server"
)
// Run the docs generation tool, check its repository for more information on how it works and how docs
// can be customized.
//go:generate go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
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()
ctx := context.Background()
muxServer, err := oktapam.ProviderServerFactory(ctx, nil)
if err != nil {
log.Fatal(err)
}
var serveOpts []tf6server.ServeOpt
if debug {
serveOpts = append(serveOpts, tf6server.WithManagedDebug())
}
_ = tf6server.Serve(
"registry.terraform.io/okta.com/pam/oktapam",
muxServer,
serveOpts...,
)
}