anyenv, tfenv를 사용하여 Terraform 설치

개시하다


새로운 기계로 테라폼을 도입했기 때문에 당시의 절차를 총괄했다.
이번 사용에 관한 환경은 다음과 같다.
  • macOS Monterey 12.1.2
  • Homebrew 3.4.1
  • tfenv 설치


    tfenv라는 버전 관리 도구를 사용하여 Terraform을 설치합니다.
    https://github.com/tfutils/tfenv
    ffenv는 맥OS, 리눅스, 윈도에 대응하고 맥OS라면 홈brew를 통해 설치할 수 있다.하지만 저는 평소에'*env'라고 불리는 다양한 언어 버전 관리 도구인 래퍼 anyenv를 사용하기 때문에anyenv를 통해 설치합니다.
    https://github.com/anyenv/anyenv
    anyenv 설치
    $ brew install anyenv
    
    anyenv를 사용하지 않는 경우brew를 통해 tfenv를 직접 설치할 수 있습니다
    이 경우 전체 영역을 건너뛰십시오.
    $ brew install tfenv
    
    # tfenv をインストール
    $ anyenv install tfenv
    
    # コマンドを実行して usage が表示されたら OK
    $ tfenv
    tfenv 2.2.3
    Usage: tfenv <command> [<options>]
    
    Commands:
       install       Install a specific version of Terraform
       use           Switch a version to use
       uninstall     Uninstall a specific version of Terraform
       list          List all installed versions
       list-remote   List all installable versions
       version-name  Print current version
       init          Update environment to use tfenv correctly.
       pin           Write the current active version to ./.terraform-version
    

    Terraform 설치


    설치 가능한 버전 확인


    이전에 사용했을 때, v0.13 정도라서 1라인이 GA로 깜짝 놀랐어요.
    $ tfenv list-remote
    1.1.7
    1.1.6
    ..
    
    (省略)
    
    ..
    0.2.0
    0.1.1
    0.1.0
    

    모든 버전 선택 및 설치


    현재 최신 v1.1.7 설치.
    $ tfenv install 1.1.7
    Installing Terraform v1.1.7
    ..
    
    ..
    Installation of terraform v1.1.7 successful. To make this your default version, run 'tfenv use 1.1.7'
    
    
    $ tfenv use 1.1.7
    Switching default version to v1.1.7
    Switching completed
    
    $ terraform version
    Terraform v1.1.7
    on darwin_amd64
    
    이상.

    참고 자료


    https://www.terraform.io/
    https://github.com/anyenv/anyenv
    https://github.com/tfutils/tfenv

    좋은 웹페이지 즐겨찾기