forked from Azure/terraform-provider-azapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
31 lines (23 loc) · 764 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
package main
import (
"context"
"flag"
"log"
"github.com/Azure/terraform-provider-azapi/internal/provider"
"github.com/hashicorp/terraform-plugin-framework/providerserver"
)
func main() {
// remove date and time stamp from log output as the plugin SDK already adds its own
log.SetFlags(log.Flags() &^ (log.Ldate | log.Ltime))
var debugMode bool
flag.BoolVar(&debugMode, "debuggable", false, "set to true to run the provider with support for debuggers like delve")
flag.Parse()
serveOpts := providerserver.ServeOpts{
Debug: debugMode,
Address: "registry.terraform.io/Azure/azapi",
}
err := providerserver.Serve(context.Background(), provider.AzureProvider, serveOpts)
if err != nil {
log.Fatalf("Error serving provider: %s", err)
}
}