main.go 1.5 KB

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