-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.go
52 lines (40 loc) · 1.33 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
// Package main is the main package for the CloudAvenue Terraform Provider.
package main
import (
"context"
"flag"
"log"
"github.com/google/uuid"
"github.com/hashicorp/terraform-plugin-framework/providerserver"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/metrics"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/provider"
_ "github.com/rs/zerolog"
_ "gopkg.in/yaml.v3"
)
// Example version string that can be overwritten by a release process.
var version = "dev"
// Provider documentation generation.
//go:generate go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs generate --provider-name cloudavenue
//go:generate go run github.com/orange-cloudavenue/terraform-provider-cloudavenue/cmd/vdc-doc
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()
// Generate a new execution ID for this run.
// Not error checking here because it's not critical.
x, _ := uuid.NewUUID()
metrics.GlobalExecutionID = x.String()
opts := providerserver.ServeOpts{
Address: "registry.terraform.io/orange-cloudavenue/cloudavenue",
Debug: debug,
}
err := providerserver.Serve(context.Background(), provider.New(version), opts)
if err != nil {
log.Fatal(err.Error())
}
}