main.go 1.2 KB

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