boltops-tools / terraspace

Terraspace: The Terraform Framework
https://terraspace.cloud
Apache License 2.0
678 stars 46 forks source link

Use tfenv's .terraform-version file #107

Closed rjcoelho closed 3 years ago

rjcoelho commented 3 years ago

I would like to have a per project .terraform-version file So when I do terraspace new project infra it should create a new .terraform-version file an the root That will be used for all stacks. Then later I just need to update one file when I bump terraform version.

Great project!

tongueroo commented 3 years ago

Thanks for the kind words 😄

Could add an cli option to the terraspace new command, but thinking right now that it's simpler to just create the .terraform-version after generating a new project. 🤔 Closing for now.

pako-grape commented 3 years ago

@rjcoelho you can also use tfswitch, then there is no need to have .terraform-version file at all (it will read version from tf files). You can execute tfswitch with a hook (config/hooks/terraform.rb):

before("init",
  execute: "tfswitch"
)
kvendingoldo commented 6 months ago

btw. you can also use tenv that support Terraform as well as OpenTofu (and Terragrunt :) ) in one tool. It allow you to simplify version management and can do much more, than tfswitch.