본문 바로가기

Work/Terraform for Azure

윈도우 환경에서 Terraform 환경 설정 for Azure ( Windows, Visual Studio Code, Azure )

:: Window PC 에 Terraform 을 설치하고 Visual Sutio Code 를 통해서 Azure 에 리소스 배포 하기 위한 환경 구성

  1. Windows PC 에 Terraform 환경 구성
    ( https://learn.microsoft.com/ko-kr/azure/developer/terraform/get-started-windows-powershell?tabs=bash#4-install-terraform-for-windows )

a. 압축을 풀어준 후 C 드라이브에 임의의 폴더(C:\terraform) 생성한 후 넣어준다. 

 

b. 환경 변수 등록을 해준다.

:: 내 컴퓨터 > 속성 > 고급 시스템 설정 > 고급 탭 > 환경 변수

 

 

:: 시스템 변수 > Path 선택 후 > 편집 > 환경 변수 편집 

 

:: 새로 만들기 > C 드라이브에 임의의 폴더(C:\terraform) 의 terraform.exe 경로 입력

 

2. Visual Studio Code 설치

a. Visual Studio Code 다운로드 & 설치

( https://code.visualstudio.com/Download )

 

b. Extension 도구 추가 설치 

:: Extension > terraform 검색 > HashiCorp Terraform 설치

 

< 그 외 CLI 도구 설치 >

 

  1. Azure에 Terraform 인증 :: Terraform 을 통해 배포될 Azure 구독 인증
    1. 계정으로 인증시 Azure CLI 인증만 지원
      ( https://learn.microsoft.com/ko-kr/azure/developer/terraform/get-started-windows-powershell?tabs=bash#authenticate-to-azure-via-a-microsoft-account)
    2. Service Principal
      ( https://learn.microsoft.com/ko-kr/azure/developer/terraform/get-started-windows-powershell?tabs=bash#create-a-service-principal )
      1. 환경 변수에 Service Principal 값 입력 ( https://learn.microsoft.com/ko-kr/azure/developer/terraform/get-started-windows-powershell?tabs=bash#specify-service-principal-credentials-in-environment-variables )

 

'Work > Terraform for Azure' 카테고리의 다른 글

Terraform Public_ip.tf  (0) 2024.01.04
Terraform vnet.tf  (0) 2024.01.03
Terraform resourcegroup.tf  (0) 2024.01.03
Terraform main.tf  (1) 2024.01.03
Linux 환경(CentOS)에서 Terraform 환경 설정 for Azure  (0) 2024.01.02