Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
provider: Add -debug flag to main binary (hashicorp#16565)
Reference: https://github.com/hashicorp/terraform-provider-scaffolding/blob/3c87a86ff2eeb6b0835e26b16f2bf8bc293622fd/main.go#L22-L38 To match recent updates to the scaffold provider, this allows easier usage of Go debugging tooling, such as delve, via a provider reattachment mode. This is primarily for provider developers and does not affect practitioner usage. Example usage: ```console $ go run . -debug {"@Level":"debug","@message":"plugin address","@timestamp":"2020-12-02T21:23:22.095285-05:00","address":"/var/folders/w8/05f3x02n27x72g0mc2jy6_180000gp/T/plugin326120673","network":"unix"} Provider started, to attach Terraform set the TF_REATTACH_PROVIDERS env var: TF_REATTACH_PROVIDERS='{"registry.terraform.io/hashicorp/aws":{"Protocol":"grpc","Pid":45042,"Test":true,"Addr":{"Network":"unix","String":"/var/folders/w8/05f3x02n27x72g0mc2jy6_180000gp/T/plugin326120673"}}}' ```
- Loading branch information