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; 추가
- 설치가 성공적으로 완료되면 가상 머신이 하나 생성되고 가상 머신에 베이그런트 우분투 이미지와 테라폼이 설치됨
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:~$