-
Notifications
You must be signed in to change notification settings - Fork 118
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
Making it a Go package #427
Comments
Hi @zliang-akamai 👋 Thank you for raising this. HashiCorp intentionally does not release provider code in an externally usable Go module for a few reasons, including but not limited to:
Some of this is mentioned in the Terraform plugin development website documentation. In the case of this provider's functionality and given that its code is source available, you could theoretically reverse engineer the HTTP client and transport implementation into a proper Go module, if that was desirable. This provider's code is configuring and using the Go module: https://pkg.go.dev/github.com/hashicorp/go-retryablehttp. Since you do mention provider acceptance testing though, you can configure the terraform-plugin-testing logic to use the resource.Test(t, resource.TestCase{
ExternalProviders: map[string]resource.ExternalProvider{
"http": {
Source: "hashicorp/http",
Version: "3.4.2",
},
},
// ... ProviderFactories, ProtoV5ProviderFactories, ProtoV6ProviderFactories, etc.
Steps: []resource.TestStep{
{
Config: `
data "http" "test" {
url = "..."
}
# ...
`,
// ... other fields ...
},
},
}) Website documentation about this testing functionality does not appear to be too findable (if at all) though. I would suggest raising a documentation issue in the terraform-plugin-testing repository for that in particular, so those maintainers can be aware of the missing or hard to find content. I will however close this issue in this particular provider issue tracker though, since the stance of exporting the Go code for providers is not going to change. If you have further questions about how to acceptance test using the |
Terraform CLI and Provider Versions
N/A
Use Cases or Problem Statement
Some other tools, especially providers or acceptance tests of a provider may utilize this provider as a Go package for various reasons.
Currently,
terraform-provider-http
doesn't work when importing it from another Golang project.Proposal
Making it compatible with Go package system
How much impact is this issue causing?
High
Additional Information
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: