https://developer.hashicorp.com/terraform/install




VSCode에 작업영역에 폴더 추가
D:\sources\terraform_code
(아래 경로 폴더가 없다면 폴더 만들기)
확장 - 헤시코프 테라폼 설치

Gemini Code Assist 설치하고 로그인
ch03 폴더 만들기
그 안에 main.tf 파일 만들기
resource "local_file" "abc" {
content = "abc!!!"
filename = "${path.module}/abc.txt"
}
PS C:\source> cd D:\sources\terraform_code\ch03
PS D:\sources\terraform_code\ch03> terraform init

※ 이건 VSCode 터미널이나 PowerShell에서 하면됨
리소스 만들때 공급자(프로바이더)를 로컬로 줘서 로컬파일을 다운로드 받아서 오류 체크

json 형태로 결과를 출력 하고싶을 때
terraform plan -json




Git 홈페이지 접속 - 윈도우용 깃 다운로드
https://git-scm.com/downloads/win

다운로드된 Git-2.51.0-64-bit.exe 실행
쭉 Next 하다가 아래 설정만 이미지 참고하고 Install

Github 접속해서 새로운 Repository 만들기


윈도우 D:\sources\terraform_code에서 우클릭 - Open Git Bash here
Git 로컬 저장소 만들기
git init

※ 로컬 저장소 위치 잘못 만들었으면 ,git 삭제하고 다시 로컬 저장소 만들 위치에서 git init
.terraform/
*.tfstate
*.tfstate.backup
.terraform.lock.hcl
이 안에 적어놓은 파일은 github에 안올린다.



2) git remote -v

3) ssh-keygen -t ed25519 -C "이메일주소"-엔터-엔터-엔터

4) C:\Users\user.ssh 위치에 config 파일 메모장으로 만들기(확장자 없어야함)
Host github.com
IdentityFile ~/.ssh/id_ed25519
User git
5) Github 내계정 - Settings - SSH and GPG keys - New SSH key

Key에는 id_ed25519.pub 파일 내용 복붙
6) Github 접속 테스트
ssh -T git@github.com

7) VSCode 확장에서 Git History 설치

8) .gitignore파일 추가하고 커밋하기
git add .gitignore
git commit -m "inital commit"
9) main 브랜치 충돌 오류 발생시
git push origin +main

10) 확인

resource "local_file" "example" {
content = "Hello World!!!"
filename = "${path.module}/example.txt"
}

