main.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. var (
  12. // these will be set by the goreleaser configuration
  13. // to appropriate values for the compiled binary.
  14. version string = "dev"
  15. // goreleaser can pass other information to the main package, such as the specific commit
  16. // https://goreleaser.com/cookbooks/using-main.version/
  17. )
  18. func main() {
  19. var debug bool
  20. flag.BoolVar(&debug, "debug", false, "set to true to run the provider with support for debuggers like delve")
  21. flag.Parse()
  22. opts := providerserver.ServeOpts{
  23. // TODO: Update this string with the published name of your provider.
  24. // Also update the tfplugindocs generate command to either remove the
  25. // -provider-name flag or set its value to the updated provider name.
  26. Address: "registry.terraform.io/hashicorp/scaffolding",
  27. Debug: debug,
  28. }
  29. err := providerserver.Serve(context.Background(), provider.New(version), opts)
  30. if err != nil {
  31. log.Fatal(err.Error())
  32. }
  33. }