Open snuggie12 opened 1 year ago
Thanks for this feature request! If you are viewing this issue and would like to indicate your interest, please use the 👍 reaction on the issue description to upvote this issue. We also welcome additional use case descriptions. Thanks again!
Had a similar thought occur to me after searching my shell history for the correct terraform providers lock
incantation I used last time I added a provider to the current terraform repo I'm working in.
my initial idea would probably a file in your home dir
I think a per-workspace setting would be more appropriate, I might have to collaborate on different repos which run on different architectures/OS's separately and would need different lockfiles generating.
I wonder if this could be added to the terraform {}
configuration block like we have required_version
for terraform. Would keep it scoped to the workspace, and keeps it in source control too.
Possibly allowing for falling back to TERRAFORM_PROVIDER_LOCK_PLATFORMS
for the generic "configure my machine for all repos" use case?
terraform {
provider_lock_platforms = [
"darwin_arm64",
"linux_amd64",
]
}
Terraform Version
Use Cases
When you have multiple platforms which are not your own in a shared environment it is quite annoying to constantly remember after doing work that your provider lock file has been altered and you need to also remember the correct incantation to add other processors and other OS's back to your lock file.
Attempted Solutions
There are lots of work arounds like making your own pre-commit hook, making a meanly named shell alias, a CI based solution, etc. However, rather than a bunch of people re-inventing the wheel something like a config/preferences file in your home directory or something similar seems a lot easier.
Proposal
As mentioned above, my initial idea would probably a file in your home dir, but anything similar where you set it once and forget about it would be just fine.
References
I couldn't find any, though lots of people mention a plugins directory. I don't think that's related, but I don't know how the provider lock system works.