728x90

Ubuntu에서 테라폼 최신 버전 설치


테라폼 최신 버전 설치

테라폼 버전 확인

vagrant@devops-box:~$ terraform version

 

아래 링크로 접속

https://www.terraform.io/downloads

 

Downloads | Terraform by HashiCorp

Terraform is an open-source infrastructure as code software tool that enables you to safely and predictably create, change, and improve infrastructure.

www.terraform.io

 

 

바이너리 파일 다운로드 후 /usr/local/bin 디렉토리로 옮겨 terraform 최신 버전 적용

curl -sO https://releases.hashicorp.com/terraform/1.2.2/terraform_1.2.2_linux_amd64.zip
unzip terraform_1.2.2_linux_amd64.zip
sudo mv terraform /usr/local/bin

 

최신 버전 적용 확인

 

728x90

'Terraform' 카테고리의 다른 글

220603_1_테라폼 설치-Windows OS, Vagrant  (0) 2022.06.03
728x90

Windows 10 환경에서 테라폼 설치


 

1. 테라폼 설치 파일 다운로드

2. 테라폼을 설치할 terraform 폴더 생성

3. 환경 변수 설정

4. cmd 또는 powershell에서 작업

 


테라폼 설치


Windows


테라폼 설치 파일 다운로드

아래 링크로 접속

https://www.terraform.io/downloads

 

Downloads | Terraform by HashiCorp

Terraform is an open-source infrastructure as code software tool that enables you to safely and predictably create, change, and improve infrastructure.

www.terraform.io

 

OS 환경에 맞는 버전을 선택하여 다운로드

 

Windows

 

cmd 또는 powershell 둘 중에 한 곳에서만 설정해도 무방

 1) cmd 터미널에서 작업

 

C:\Users\khj78>mkdir terraform

C:\Users\khj78>cd terraform

# 환경 변수 설정: terraform 명령을 실행할 수 있도록 경로 설정
C:\Users\khj78\terraform>set PATH=/Users/khj78/terraform/:$PATH

# 테라폼에 대한 도움말 확인 > 테라폼 설치 완료
C:\Users\khj78\terraform>terraform
Usage: terraform [global options] <subcommand> [args]

The available commands for execution are listed below.
The primary workflow commands are given first, followed by
less common or more advanced commands.

 

 

 2) powershell에서 작업

 

C:\ 경로에 terraform 폴더 생성 후 다운로드한 실행 파일 옮기기

 

 

 

환경 변수가 설정되지 않아 아래와 같은 에러를 확인할 수 있음

 

 

 

어디에서나 사용할 수 있도록 경로 설정 필요

내 PC > 속성 > 고급 시스템 설정 > 환경 변수 > Path > 편집 > C:\terraform; 추가

 

 

 

powershell 재실행하여 환경 변수가 제대로 적용되었는지 확인

 

 


추가: Vagrant를 이용한 terraform 설치


사전 작업: virtualbox와 vagrant 설치

베이그런트 코드 다운로드

https://github.com/wardviaene/devops-box

 

GitHub - wardviaene/devops-box: A vagrant project with an ubuntu box with the tools needed to do DevOps

A vagrant project with an ubuntu box with the tools needed to do DevOps - GitHub - wardviaene/devops-box: A vagrant project with an ubuntu box with the tools needed to do DevOps

github.com

 

 

C:\HashiCorp 경로에 다운로드한 파일 압축 풀기

 

 

vagrant up 실행

- 다운로드한 코드를 실행하여 소프트웨어 설치 (시간이 좀 걸림)

- 설치가 성공적으로 완료되면 가상 머신이 하나 생성되고 가상 머신에 베이그런트 우분투 이미지와 테라폼이 설치됨

C:\HashiCorp\devops-box-master>vagrant up

#  Successfully installed ...와 같은 문구가 보이면 설치가 성공적으로 된 것

 

윈도우 환경에서 virtualbox에 연결: vagrant ssh-config 또는 putty 사용

C:\HashiCorp\devops-box-master>vagrant ssh-config
Host devops-box
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile C:/HashiCorp/devops-box-master/.vagrant/machines/devops-box/virtualbox/private_key
  IdentitiesOnly yes
  LogLevel FATAL
  
  C:\HashiCorp\devops-box-master>vagrant ssh
Welcome to Ubuntu 20.04.4 LTS (GNU/Linux 5.4.0-113-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

 System information disabled due to load higher than 2.0


1 update can be applied immediately.
To see these additional updates run: apt list --upgradable


vagrant@ubuntu-focal:~$

 

728x90

'Terraform' 카테고리의 다른 글

220613_1_테라폼_최신 버전 설치  (0) 2022.06.14

+ Recent posts