terraform icon indicating copy to clipboard operation
terraform copied to clipboard

"terraform providers mirror" skip downloading packages that are already present in the mirror directory

Open maonat opened this issue 1 year ago • 9 comments

Terraform Version

v1.4.6

Use Cases

I would like to handle all the providers in a cached path on my or the remote machine which would allow me to:

  • Save space on the disk as I would have all the providers cached in a specific path
  • Not break multiple terraform commands execution at the same time when a provider is being downloaded
  • Keep updated the cached providers once every a while without the need to worry about it when running the CI

Attempted Solutions

I was not able to achieve this. For now the only solution would be to enter the modules I have in my repository and run terraform init for each terraform block found with a different required_providers block,

Proposal

I think that there are two possibilities: *Add a simple option named -download-providers-only which would simply download the providers if not already present in the providers directory without installing them in the .tf files directory *Create new command plugin-download to simply do the above

References

No response

maonat avatar Jun 07 '23 09:06 maonat