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

Support/Document Debugger Processes #34

Closed
bflad opened this issue Jan 6, 2022 · 3 comments · Fixed by #46
Closed

Support/Document Debugger Processes #34

bflad opened this issue Jan 6, 2022 · 3 comments · Fixed by #46
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@bflad
Copy link
Contributor

bflad commented Jan 6, 2022

terraform-plugin-mux version

v0.4.0

Use cases

Similar to solely SDKv2 or framework based providers, developers may wish to easily run debugging and testing processes against a muxed provider. Currently, it would require a lot of manual main function setup to essentially reimplement what those two projects implement.

Proposal

Natively support and/or document how to enable debugger functionality, similar to that which is available for SDKv2 and framework based providers. It may make more sense to implement a "DebugServe" method in terraform-plugin-go, rather than necessarily implement anything in this project.

References

@bflad bflad added the enhancement New feature or request label Jan 6, 2022
@bflad bflad added this to the v0.5.0 milestone Jan 6, 2022
@bflad bflad self-assigned this Jan 6, 2022
@bflad
Copy link
Contributor Author

bflad commented Jan 12, 2022

terraform-plugin-go v0.6.0 and a slightly refreshed mux API should make this relatively straightforward with something like:

func main() {
	debugFlag := flag.Bool("debug", false, "Start provider in debug mode.")
	flag.Parse()

	ctx := context.Background()
	opts := []tf6server.ServeOpt{}
	providers := []func() tfprotov6.ProviderServer{
		/* providers */
	}

	if *debugFlag {
		opts = append(opts, tf6server.WithManagedDebug())
	}

	muxedProvider, err := tf6muxserver.NewMuxServer(ctx, providers...)

	if err != nil {
		log.Fatal(err.Error())
	}

	tf6server.Serve("registry.terraform.io/namespace/example", muxedProvider.ProviderServer, opts...)
}

@bflad
Copy link
Contributor Author

bflad commented Jan 24, 2022

This is waiting on #37 / #39

bflad added a commit that referenced this issue Feb 2, 2022
Reference: #30
Reference: #34

Additional documentation for how to setup debugger support with muxed providers, which is based on the underlying terraform-plugin-go `tf5server` and `tf6server` implementations. This documentation is going into the README for now until a new https://terraform.io/plugin section is created for this project.
@bflad bflad closed this as completed in #46 Feb 3, 2022
bflad added a commit that referenced this issue Feb 3, 2022
Reference: #30
Reference: #34

Additional documentation for how to setup debugger support with muxed providers, which is based on the underlying terraform-plugin-go `tf5server` and `tf6server` implementations. This documentation is going into the README for now until a new https://terraform.io/plugin section is created for this project.
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant