A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.terraform.io/docs/extend/debugging.html below:

Plugin Development - Debugging SDKv2 Providers | Terraform

Debugging SDKv2 Providers

This page contains implementation details for inspecting runtime information of a Terraform provider developed with SDKv2 via a debugger tool. Review the top level Debugging page for information pertaining to the overall Terraform provider debugging process and other inspection options, such as log-based debugging.

Update the main function for the project to conditionally enable the plugin/ServeOpts.Debug field. Conventionally, a -debug flag is used to control the Debug value.

This example uses a -debug flag to enable debugging, otherwise starting the provider normally:

func main() {
    var debug bool

    flag.BoolVar(&debug, "debug", false, "set to true to run the provider with support for debuggers like delve")
    flag.Parse()

    opts := &plugin.ServeOpts{
        Debug:        debug,
        ProviderAddr: "registry.terraform.io/example-namespace/example",
        ProviderFunc: provider.New(),
    }

    plugin.Serve(opts)
}

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4