main.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. "terraform-provider-hashicups/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. // NOTE: This is not a typical Terraform Registry provider address,
  24. // such as registry.terraform.io/hashicorp/hashicups. This specific
  25. // provider address is used in these tutorials in conjunction with a
  26. // specific Terraform CLI configuration for manual development testing
  27. // of this provider.
  28. Address: "hashicorp.com/edu/hashicups",
  29. // TODO: Update this string with the published name of your provider.
  30. // Also update the tfplugindocs generate command to either remove the
  31. // -provider-name flag or set its value to the updated provider name.
  32. // Address: "registry.terraform.io/hashicorp/scaffolding",
  33. Debug: debug,
  34. }
  35. err := providerserver.Serve(context.Background(), provider.New(version), opts)
  36. if err != nil {
  37. log.Fatal(err.Error())
  38. }
  39. }