warrensbox/terraform-switcher

Offline/local mode

Closed this issue · 2 comments

Is your feature request related to a problem? Please describe.
Our Terraform apply CICD pipelines have no internet connection. The idea is to run tfswitch before each Terraform run for all our projects. During the creation of the image that will be used to run our other pipelines, we would like to do a "tfswitch --latest-stable 1.0; tfswitch --latest-stable 1.3;" for example to have those 2 versions available. Once we're running the actual pipeline (without internet access), a "tfswitch --local or --offline" would enable use to switch to different versions of terraform without the need of an internet connection.

Describe the solution you'd like
Download the latest stable versions of that moment with a couple of "tfswitch --latest-stable x.x" commands
Afterwards during the offline apply, only switch to already-downloaded terraform binaries, don't try to look it up externally. We always mark our required versions as "~> 1.3.0" for example.

Would mirror option suffice your use case? I'm not aware of how much your pipelines are limited with accessing Internet, though if they have access to intranet, then sharing artifacts via single storage is the way to go IMHO.
https://github.com/warrensbox/terraform-switcher/#use-custom-mirror

Closing as outdated. Please let us know if it's still relevant.