-
Notifications
You must be signed in to change notification settings - Fork 10
/
main.go
37 lines (29 loc) · 1.04 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
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package main
import (
"context"
"flag"
"log"
"github.com/hashicorp/terraform-plugin-framework/providerserver"
"github.com/microsoft/terraform-provider-power-platform/common"
"github.com/microsoft/terraform-provider-power-platform/internal/provider"
)
// Generate the provider document.
//
//go:generate tfplugindocs generate --provider-name powerplatform --rendered-provider-name "Power Platform"
func main() {
log.Printf("[INFO] Starting the Power Platform Terraform Provider %s %s", common.ProviderVersion, common.Branch)
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()
serveOpts := providerserver.ServeOpts{
Debug: debug,
Address: "registry.terraform.io/microsoft/power-platform",
}
err := providerserver.Serve(ctx, provider.NewPowerPlatformProvider(ctx), serveOpts)
if err != nil {
log.Fatalf("Error serving provider: %s", err)
}
}