This PR adds support for debugging tools like Delve and Goland, which should improve the debugging experience for developers contributing to the provider.
Type of change
Enhancement
Related Issue(s)
Resolves: #102
How To Test
Pull the branch locally: git pull && git checkout wpark/102-debugging-support
provider_installation {
dev_overrides {
"1Password/onepassword" = "<path to terraform-provider-onepassword repo root directory>"
}
# For all other providers, install them directly from their origin provider
# registries as normal. If you omit this, Terraform will _only_ use
# the dev_overrides block, and so no other providers will be available.
direct {}
}
With either Delve or another debugging tool (e.g Goland), run a debugging session. Follow the instructions here, referring to the Compiling in debug mode section onward
Navigate to the examples directory in your terminal. Set the TF_REATTACH_PROVIDERS variable: export TF_REATTACH_PROVIDERS=<outputted value from debugging session>
Set breakpoints in your code
Test creating and destroying item resources. Follow the instructions here
[ ] The breakpoints should be hit during the debugging session as expected
Overview
This PR adds support for debugging tools like Delve and Goland, which should improve the debugging experience for developers contributing to the provider.
Type of change
Enhancement
Related Issue(s)
How To Test
git pull && git checkout wpark/102-debugging-support
~/.terraformrc file
, so that you use a local build of the provider rather than the published version. Refer to the documentation here for more details: https://developer.hashicorp.com/terraform/cli/config/config-file#development-overrides-for-provider-developers. Your.terraformrc
file should look like this:Compiling in debug mode
section onwardexamples
directory in your terminal. Set theTF_REATTACH_PROVIDERS
variable:export TF_REATTACH_PROVIDERS=<outputted value from debugging session>