Closed akerl closed 4 years ago
Ping @bflad ; without this meta change, the library remains un-importable with go mod.
Hi, thanks for reaching out. This repository is not intended to be used as a library. The versioning on the provider is about the HCL contract with Terraform users, it is not semantic versioning of the Go contract, so applying Go module versioning rules to it will not work the way the Go modules workflows intend. Over time our intent is to move more of the provider code to an internal
package to explicitly indicate our non-support for external consumers.
That being said, if you want to use this code in your own projects, you can feel free. These changes are not meant to stop anyone from reusing it, merely to indicate that its unsupported and we make no guarantees against drastically changing things without any sort of warning or notification.
I am curious what your use case is, could you expand on it?
I maintain a terraform provider that's build as a lightweight shim around this provider ( https://github.com/armorfret/terraform-provider-awscreds ). The goal is to work around an issue with the stock provider handling of the iam_access_key resource, where the secret key gets stored in the statefile.
My goal was to modify the behavior with the minimum necessary code duplication, and so my provider instantiates a copy official provider under-the-hood and just modifies the resulting objects as necessary to remove secret keys.
Same issue with the same use case here, we have a custom provider extending this one with additional resources and we can't import v2 properly with go mod
.
Hi folks! Since importing the provider as a module is not a supported feature for this project, I'm going to close this issue. If you want to discuss things more, you might find other interested people on the community forums: https://discuss.hashicorp.com/c/terraform-providers
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!
Community Note
Expected Behavior
I'm trying to import this codebase into another project. With the addition of go modules, major versions are expected to be differentiated by import path: https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher
As such, I'd expect to import v2 with the import path
github.com/terraform-providers/terraform-provider-aws/v2/aws
Actual Behavior
Importing
github.com/terraform-providers/terraform-provider-aws/v2/aws
returns the following:Importing without the v2 gets the latest v1 version available.
Steps to Reproduce
mkdir tmprepo
cd tmprepo
go mod init example.com/test
go get github.com/terraform-providers/terraform-provider-aws/v2/aws