Featured image of post 在Ubuntu 22.04上安裝Terraform

在Ubuntu 22.04上安裝Terraform

Ubuntu 22.04 Terraform Install

安裝

  1. 輸入以下指令

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    
    sudo apt-get update && sudo apt-get install -y gnupg software-properties-common &&
    wget -O- https://apt.releases.hashicorp.com/gpg | \
    gpg --dearmor | \
    sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg &&
    gpg --no-default-keyring \
    --keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg \
    --fingerprint &&
    echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \
    https://apt.releases.hashicorp.com $(lsb_release -cs) main" | \
    sudo tee /etc/apt/sources.list.d/hashicorp.list &&
    sudo apt update &&
    sudo apt-get install terraform &&
    terraform -help
    
  2. 完成

後記 : terraform自動補字

Bash

1
echo "terraform -install-autocomplete" >> ~/.bashrc

Zsh

1
echo "terraform -install-autocomplete" >> ~/.zshrc

參考

https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli

comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy