이번 시간에는 terraform 공식문서를 따라서 기본 설정을 진행해 보도록 하겠습니다.
Install Terraform
https://learn.hashicorp.com/tutorials/terraform/install-cli?in=terraform/aws-get-started
Install Terraform | Terraform - HashiCorp Learn
Install Terraform on Mac, Linux, or Windows by downloading the binary or using a package manager (Homebrew or Chocolatey). Then create a Docker container locally by following a quick-start tutorial to check that Terraform installed correctly.
learn.hashicorp.com
우선 terraform을 brew를 통해 설치해 보도록 하겠습니다.
$ brew tap hasicorp/tap
$ brew install hasicorp/tap/terraform
을 통해 terraform을 설치해 줍니다.
이와 같이 간단히 버전확인을 해서 잘 깔렸는지 확인할 수 있습니다.
Enable tab completion
이제 terraform의 tab 자동완성 기능을 활성화 시켜주기 위해서 아래 명령어를 쳐주도록 하겠습니다.
$ terraform -install-autocomplete
이를 하고 ~/.zshrc의 맨 아래를 확인합니다.
이가 있다면 잘 설치 된 것입니다.
그럼 위와 같이 자동완성 기능을 terraform에서 제공해 주게 됩니다.
CLI Configuration File
https://www.terraform.io/cli/config/config-file#plugin_cache_dir
CLI Configuration | Terraform by HashiCorp
Learn to use the CLI configuration file to customize your CLI settings, including credentials, plugin caching, provider installation methods, etc.
www.terraform.io
우선 위 경로로 terraformrc를 만들고 위와같은 내용을 적어줍니다. plugin_cache_dir은 테라폼의 캐시 저장 공간을 중앙집중식으로 효율적으로 관리해 주게 하는 것입니다. 이를 하지 않고 여러 워크 스페이스를 관리하다보면 저장공간이 매우 부족해 질겁니다. 공통된 패키지는 여기에다 설치해서 공통적으으로 ( 중앙 집권적으로 )관리할 수 있게 도와줍니다.
'DevOps > AWS Architecture' 카테고리의 다른 글
[ DevOps ] - 엔서블 설치 (0) | 2022.07.20 |
---|---|
[ DevOps ] - 패커 설치 및 기본 설정 (0) | 2022.07.20 |
[ DevOps ] - (IaC) 형상 관리 (Configuration Management) - 이미지 빌드 (0) | 2022.07.20 |
[ DevOps ] - (부록) AWS SAM 개요 및 실습 (0) | 2022.07.20 |
[ DevOps ] - (DynamoDB) Python으로 DynamoDB 접근 (0) | 2022.07.20 |