Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider: Add -debug flag to main binary #16565

Merged
merged 1 commit into from
Dec 3, 2020
Merged

provider: Add -debug flag to main binary #16565

merged 1 commit into from
Dec 3, 2020

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Dec 3, 2020

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Reference: https://github.com/hashicorp/terraform-provider-scaffolding/blob/3c87a86ff2eeb6b0835e26b16f2bf8bc293622fd/main.go#L22-L38

Release note for CHANGELOG:

NONE

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:

$ 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"}}}'

Output from acceptance testing: N/A (plugin binary update)

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"}}}'
```
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. provider Pertains to the provider itself, rather than any interaction with AWS. labels Dec 3, 2020
@bflad bflad requested a review from a team as a code owner December 3, 2020 14:54
@ghost ghost added the size/XS Managed by automation to categorize the size of a PR. label Dec 3, 2020
Copy link
Contributor

@bill-rich bill-rich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bflad bflad added this to the v3.20.0 milestone Dec 3, 2020
@bflad bflad merged commit 1e755a5 into master Dec 3, 2020
@bflad bflad deleted the f-debug-mode branch December 3, 2020 20:06
@ghost
Copy link

ghost commented Dec 3, 2020

This has been released in version 3.20.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Jan 3, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Jan 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. provider Pertains to the provider itself, rather than any interaction with AWS. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants