Aiman Ismail
03/10/2023, 2:43 AMtext file busy
.
Error when running plan:
Initializing the backend...
Initializing provider plugins...
- <http://terraform.io/builtin/terraform|terraform.io/builtin/terraform> is built in to Terraform
- Finding latest version of hashicorp/template...
- Finding hashicorp/aws versions matching "~> 4.0"...
- Installing hashicorp/template v2.2.0...
- Installed hashicorp/template v2.2.0 (signed by HashiCorp)
- Installing hashicorp/aws v4.58.0...
╷
│ Error: Failed to install provider
│
│ Error while installing hashicorp/aws v4.58.0: open
│ /atlantis-data/plugin-cache/registry.terraform.io/hashicorp/aws/4.58.0/linux_amd64/terraform-provider-aws_v4.58.0_x5:
│ text file busy
required_version
config in the folder. I know I can set the terraform_version
in atlantis.yaml
but that is only per project. There are no way AFAIK that we can override TF version centrally.PePe Amengual
03/10/2023, 2:56 AMAiman Ismail
03/10/2023, 3:02 AMTF_PLUGIN_CACHE_MAY_BREAK_DEPENDENCY_LOCK_FILE
and set that in Helm. That fixed the issue but I had to rm -rf /atlantis-data/plugin-cache
first before it works properly again.PePe Amengual
03/10/2023, 3:03 AMAiman Ismail
03/10/2023, 3:07 AMwby
03/10/2023, 3:12 AMTerraform automatically creates or updates the dependency lock file each time you run the terraform init command. You should include this file in your version control repository so that you can discuss potential changes to your external dependencies via code reviewhttps://developer.hashicorp.com/terraform/language/files/dependency-lock We don’t use it, because we pin almost all of our providers / modules to exact versions, and because we use Renovate to update our dependencies (it still doesn’t manage the lockfile as well as you might like). That said, I have never heard of any Atlantis specific reason that you shouldn’t check in the lockfile; you probably should check it in unless you have a good reason not to.
ATLANTIS_DEFAULT_TF_VERSION: "1.3.9"
required_version: 1.4
in the config, that will always be a problem; presumably you could resolve that by reverting the code change that updated the required version, unless I’m misunderstanding your question?Aiman Ismail
03/10/2023, 3:24 AMrequired_version
config before. We have it set in all our repos to >= 1.0
which is the reason why it always updates to the latest one. This also made it hard for us to globally override it. Will be removing required_version
from all our Terraform files in the future unless only when we need to specifically use a Terraform version for that folder.wby
03/10/2023, 3:27 AMtflint
will complain if you don’t have it set.
I would suggest setting it, but just setting it either to an exact version, or to a range that makes sense for you~> 1.3.0
or something.
We use Renovate to manage all the deps, and just pin to exact version for both provider / module versions, and the terraform required versions, but it does create some extra noise / work to do it that way.