Hi Mart,
I am feeling a little friction in my workflow with the addition of the lock file and want to let you know.
My situation is that I develop a provider locally and require it in my modules with:
terraform {
required_providers {
myprovider = {
source = "myprovider.com/myprovider/myprovider"
version = "99.0.0"
}
}
}
Note the version is always 99.0.0 and my provider build script simply builds the binary and places it in the version 99.0.0 location on my local machine. With the addition of the lock file, anytime I rebuild the local provider and run terraform init
will fail with:
Error while installing myprovider.com/myprovider/myprovider v99.0.0: the local
package for myprovider.com/myprovider/myprovider 99.0.0 doesn't match any of the
checksums previously recorded in the dependency lock file (this might be
because the available checksums are for packages targeting different
platforms)
Even with terraform init -upgrade
I see the same error, presumably because the version has not changed so it still expects to see the same checksum. The workaround is simple enough: rm .terraform.lock.hcl
though perhaps an option for init like -ignore-checksum-validation
could also be useful in my case.
Just wanted to share my experience, please let me know if there is a better workflow for local provider development or any other comments!
Best – Cyrus