Good Morning,
does anyone have experience with provider.tf and terraform plugins ? We have in our environment multiple providers in use.
It is automatic downloading all provider binaries, which takes very long in the deployment.
- keycloak provider
- aws provider
- nomad provider
as small example
in terraspace-cache for every stack i have .terraform/providers with binaries.
the config reference config.terraform.plugin_cache.enabled with standard give me
error like this
Batch Run 3:
╷
│ Error: Required plugins are not installed
│
│ The installed provider plugins are not consistent with the packages selected in the dependency lock file:
│ - Terraform Registry the cached package for Terraform Registry 5.94.1 (in .terraform/providers) does not match any of the checksums recorded in the dependency lock file
│
│ Terraform uses external plugins to integrate with a variety of different infrastructure services. To download the plugins required for this configuration, run:
│ terraform init
Terraspace all init to the stack already done.
Thanks and best regards
Oliver
Have you tried with 1 provider only?
Have you delete the cache folder, maybe is corrupted
Hi @HoLengZai ,
thanks for your feedback, after a deeper analyse it seems, doesnt set the TF_PLUGIN_CACHE_DIR after definition in bashrc and zshrc it was working.
Have now different problems with
“the installed provider plugins are not consistent with the packages selected”
Do you have this sometimes, too ?
Sorry but I have no issue like this…
Unfortunately, it seems that the support of Terraspace is very low now, not to say dead.
I can try to help you because I really think Terraspace is very good for organizing Terraform projects files.
I use Windows 10 + WSL2 and I build a Makefile to handle all Een Var needed on my TF/TS project.
So far so good, I have just recently had a small issue with armrest ruby gem used by the terraspace_azurerm_plugin, but I built a fix and I wait @tung to approve the merge request.
What is your configuration? so we can have a better clue of your issue.
Btw, have you tried to do something from scratch? like a simple dummy TS project on a new folder with these 3 providers that you mentioned? you still have the issue?
Hi @HoLengZai ,
thanks for you time. My provider configuration.
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.0"
}
newrelic = {
source = "newrelic/newrelic"
}
keycloak = {
source = "mrparkers/keycloak"
version = "~> 4.0"
}
}
# Docs: https://terraspace.cloud/docs/config/reference/
Terraspace.configure do |config|
# config.logger.level = :info
# copy_modules setting introduced 2.2.5 to speed up terraspace build
# See: https://terraspace.cloud/docs/config/reference
config.build.copy_modules = true
#########################################################################################
config.terraform.plugin_cache.enabled = true
config.terraform.plugin_cache.dir = "/tmp/terraspace/plugin_cache"
# Automatically purge the plugin cache and retry when there are Terraform plugin cache errors
config.terraform.plugin_cache.purge_on_error = true
end
I export the variabel TF_PLUGIN_CACHE_DIR to the expected folder.
how i initialize a project:
- terraspace clean cache
- terraspace bundle update
- terraspace all init
- terraspace up stack1
│ Error: Required plugins are not installed
│
│ The installed provider plugins are not consistent with the packages selected in the dependency lock file:
│ - registry.terraform.io/hashicorp/aws: the cached package for registry.terraform.io/hashicorp/aws 5.96.0 (in .terraform/providers) does not match any of the checksums recorded in the dependency lock file
│
│ Terraform uses external plugins to integrate with a variety of different infrastructure services. To download the plugins required for this configuration,
│ run:
│ terraform init
╵
Greats Oliver
@HoLengZai
Is it possible that i have the problem because we are using terraform 1.11.4 ?
after some research i found out, that the biggest problem is terraspace all init with concurrency of ( default) 5, where parallel process are not possible. with concurrency of 1 it was possible to use the cache. After that it was possible to change to more parallel processes.
@HoLengZai which implementation do you have ?
Hi @ORuessel , can you be more specific as I don’t have any issue with concurrency