-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Terraform lock files #7895
Comments
Yep, that looks too complicated for us to try to replicate/reverse engineer - let's run Can we install |
I think we can download it from https://releases.hashicorp.com/terraform/0.14.0/. It's provied as zip file (~30MB), so we would need to extract. Creating the required docker images is easy for me. So not sure which solution is best |
versions.hcl terraform {
required_providers {
docker = {
source = "kreuzwerker/docker"
version = "2.8.0"
}
helm = {
source = "hashicorp/helm"
version = "1.3.2"
}
kubernetes = {
source = "hashicorp/kubernetes"
version = "1.13.3"
}
}
required_version = ">= 0.13"
} This is the corresponding config file. Best practise is to use So with the example above we would need to extract the |
In that case:
|
I can't find any references that https://learn.hashicorp.com/tutorials/terraform/provider-versioning#explore-terraform-lock-hcl
What this last step is also introducing is that all the of the backend configuration has to be present inside the execution context of renovate. This includes e.g. an access key for a blob storage. I have opened a issue, which should solve this, at the Terraform repo. hashicorp/terraform#27161 |
Ah, sorry. yes it's
Oh, yes. So i will git ignore the lockfile until there is a proper solution. |
Yesterday I implemented "ugly" workaround for this. {
"postUpgradeTasks": {
"commands": ["terraform get -no-color -update", "rm .terraform.lock.hcl", "terraform providers lock -no-color -platform=linux_amd64 -platform=darwin_amd64"],
"fileFilters": [".terraform.lock.hcl"]
}
} The |
Renovate should also be able to make updates to just the lockfile when providers are updated. For example I have: versions.tf
.terraform.lock.hcl
Running
|
We have the same issue. Personally, since we’re already pinning to specific versions exactly and using renovate to update versions (we had scripts to update before renovate supported it; love that Renovate supports this now, btw!), I prefer the old behavior, and we (currently) if there were an easy way to skip requiring |
@wyardley we've done the same here - and completely agree with you - I also don't believe it's possible to support the Lock File feature properly with Renovate. And, we've also already very pleased with Renovate's support for Terraform (as you as well). But, will follow-up this issue of course... |
If it's of any help, here's how a |
Can somebody add a little more information on how to opt in to this feature? I am a GitHub marketplace user. Thanks for implementing It. |
@mercuriete initially this will only be possible for self-hosted users as it's enabled using an environment variable:
Hopefully others who were waiting for this feature are on self-hosted and can report back on whether it's working as intended after they add that flag. If so then we can make it a user-configurable flag so that it works via the hosted app you're using. |
FYI we needed to revert this due to windows problems. @secustor could you re-raise the PR and we'll add Windows tests to the branch to verify it before merging the second time? |
I have re raised the PR #10469 |
🎉 This issue has been resolved in version 25.46.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
It seems this experimental feature currently doesn't work with community providers. I'm currently running a upgrade for |
@hojerst can you create this as a bug report with reproduction repo? |
Sure: #10550 |
Any idea when this will make it in as a user config option instead of env var only? |
The experimental feature RENOVATE_X_TERRAFORM_LOCK_FILE seems to need more recent node.js version. fs.rm was introduced with v14.14.0 With node.js v12, I get:
|
Are you able to use node 14? I think we'd probably prefer to deprecate node 12 in our next major release (v26) seeing as this is experimental. |
Renovate official supports only node v14. V12 is only accepted. So to support legacy V12 we need community support. Line 122 in cb752db
Line 122 in cb752db
|
What would you like Renovate to be able to do?
Since terraform will write a lockfile (
.terraform.lock.hcl
) since v0.14. so if dependencies are updated by renovate, we need to update the lockfile too.Did you already have any implementation ideas?
One idea it to simply run
terraform init
after update, so the lockfile will begenerated / updated..terraform.lock.hcl sample
https://github.com/hashicorp/terraform/releases/tag/v0.14.0
The text was updated successfully, but these errors were encountered: