main.go 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package main
  2. import (
  3. "context"
  4. "flag"
  5. "log"
  6. "github.com/hashicorp/terraform-plugin-framework/tfsdk"
  7. "github.com/hashicorp/terraform-provider-scaffolding-framework/internal/provider"
  8. )
  9. // Run "go generate" to format example terraform files and generate the docs for the registry/website
  10. // If you do not have terraform installed, you can remove the formatting command, but its suggested to
  11. // ensure the documentation is formatted properly.
  12. //go:generate terraform fmt -recursive ./examples/
  13. // Run the docs generation tool, check its repository for more information on how it works and how docs
  14. // can be customized.
  15. //go:generate go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
  16. var (
  17. // these will be set by the goreleaser configuration
  18. // to appropriate values for the compiled binary
  19. version string = "dev"
  20. // goreleaser can also pass the specific commit if you want
  21. // commit string = ""
  22. )
  23. func main() {
  24. var debug bool
  25. flag.BoolVar(&debug, "debug", false, "set to true to run the provider with support for debuggers like delve")
  26. flag.Parse()
  27. opts := tfsdk.ServeOpts{
  28. Debug: debug,
  29. // TODO: Update this string with the published name of your provider.
  30. Name: "registry.terraform.io/hashicorp/scaffolding",
  31. }
  32. err := tfsdk.Serve(context.Background(), provider.New(version), opts)
  33. if err != nil {
  34. log.Fatal(err.Error())
  35. }
  36. }