Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add additional tf version to tfswitch #101

Closed
BernhardLenz opened this issue Sep 15, 2020 · 1 comment
Closed

How to add additional tf version to tfswitch #101

BernhardLenz opened this issue Sep 15, 2020 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@BernhardLenz
Copy link

On my MacOs I have tf 13 installed (using brew) and then installed tfswitch (using brew).
Now i'd like to install tf 12 and have it switched with tfswitch but can't find any documentation on how to add tf12 to tfswitch.

The output of the tfswitch command is

$tfswitch
Reading required version from terraform file, constraint: >= 0.12
Matched version: 0.13.2
Switched terraform to version "0.13.2" 

$tfswitch -v      
Version: 0.8.832

@warrensbox warrensbox self-assigned this Sep 17, 2020
@warrensbox warrensbox added the question Further information is requested label Sep 17, 2020
@warrensbox
Copy link
Owner

@BernhardLenz in your directory, in your terraform file, you probably have this line:

terraform {
  required_version = ">= 0.12.9"

}

With tfswitch, it automatically gets any version that is higher than or equals (>=) to 0.12.9. In your case, it got the latest version which is 0.13.2
I suggest you refactor that line to the version~> 0.12.0(pessimistic lock) . This will only get you the latest 0.12 version. Your terraform file should look something like this:

terraform {
  required_version = "~> 0.12.0"

}

Otherwise, you can manually provide the version like this:
tfswitch 0.12.9
With whatever version you desire.
drawing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants