-
Notifications
You must be signed in to change notification settings - Fork 91
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
Expose Provider Version configured in the client's required_providers {} #920
Comments
Rather than collecting the constraint value (which may be configured sloppily or not at all), you could detect the actual version of the provider. This provider does exactly that. It works like this:
|
thank you very much for the guidance. That's exactly what I needed. |
One additional note about the terraform {
required_providers {
example_provider = {
source = "hashicorp/example"
version = ">= 1.0"
}
}
} If it was feasible to get this information to a provider, it wouldn't provide exactly what you're looking for unfortunately |
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. |
Module version
Use-cases
I'd like to use the provider
version
attribute configured under the terraformrequired_providers {}
on the client side to pass it as input attribute to an API that the provider interacts with to do what it needs to do based on the version.The use case is to have provider versions in sync with the API it interacts in the backend, otherwise it can be that the provider schema and the backend API are out of sync in terms of attributes and theirs values and will cause failures. Multiple version of the provider can be used so I can't use only the latest version and always be in sync.
Attempted Solutions
I couldn't find anywhere in the framework the provider version configured in
required_providers {}
. There is a Terraform Version attribute under the provider ConfigureRequestI've worked around this by creating a provider configuration attribute and capturing the same version in the
required_providers {}
in that attribute. With this method, there is a risk of the user setting up different versions betweenrequired_providers {}
and the provider configuration attribute which will cause issues with the backend API.Proposal
I couldn't call myself even a junior go developer so it's hard for me to provide a solution but it seams innocent enough to me if exposed in the same manner as the Terraform Version approach.
The text was updated successfully, but these errors were encountered: