폐쇄망 테라폼 설치

문학적인유사성·2023년 1월 4일
0

뎁옵깃옵쿠베

목록 보기
19/45

폐쇄망에서 테라폼 설치하기


window에서 작업할때!!!

  1. 인터넷이 되는 다른 컴퓨터에서 작업 디렉토리 생성
  2. Provider 정의 (terraform init)
  3. 테라폼 프로젝트내부에 있는 파일을 옮겨 가기
    .terraform\providers\registry.terraform.io\hasicorp\aws\4.48.0\windows_amd64
    <- 나는 이 버전을 이용함
  • 통채로 복사해서 가져가기
  1. terraform.rc 파일 생성
plugin_cache_dir = "%YOUR_APPDATA%/terraform.d/plugin_cache"
disable_checkpoint=true

provider_installation {
 filesystem_mirror {
   path= "%YOUR_APPDATA%/terraform.d/plugin_cache"
   include = ["registry.terraform.io/hashicorp/*"]
   }
   direct {
    exclude = ["registry.terraform.io/hashicorp/*"]
   }
}
  1. "%APPDATA% 있는 곳에 rc파일을 가져다 둘것
    공식문서_해당 파일 속성 및 확인

On Windows, the file must be named terraform.rc and placed in the relevant user's %APPDATA% directory. The physical location of this directory depends on your Windows version and system configuration; use $env:APPDATA in PowerShell to find its location on your system.
On all other systems, the file must be named .terraformrc (note the leading period) and placed directly in the home directory of the relevant user.

  1. 위치가 중요함!!!

리눅스에서 작업할때.. 알고싶지 않았는데.. 리눅스 서버위에 올리는 것으로 바꿈.

  1. 인터넷이 되는 컴퓨터에서 테라폼, 테라포머을 설치하기
wget https://releases.hashicorp.com/terraform/1.2.0/terraform_1.2.0_linux_amd64.zip
unzip terraform_1.2.0_linux_amd64.zip
sudo cp terraform /usr/bin/
./terraform -version
  • 폐쇄망에서 terraformer는 작동하지 않음...ㅠㅠ
  • terraforming도 안됨... aws sts get-caller-identity를 못받아오는 느낌인데... 아.. 일단 하드코딩...
export PROVIDER=aws
wget https://github.com/GoogleCloudPlatform/terraformer/releases/download/0.8.20/terraformer-aws-linux-amd64
chmod +x terraformer-aws-linux-amd64
sudo mv terraformer-aws-linux-amd64 /usr/local/bin/terraformer

.terraformrc 파일 설정

plugin_cache_dir = "$HOME/.terraform.d/plugin-cache"
disable_checkpoint = true
provider_installation {
        filesystem_mirror {
                path = "/usr/share/terraform/providers/"
                include = ["*/*"]
        }
        direct {
                exclude = ["*/*"]
        }
}
  1. 테라폼 파일 가져가기
    두가지 위치에 있는 구성을 동일하게 설정할 것
    프로바이더 링크

~/.terraform.d/plugin-cache/registry.terraform.io/hashicorp/aws/4.48.0/linux_amd64여기다가 옮겨두기
/usr/share/terraform/providers/registry.terraform.io/hashicorp/aws/4.48.0/linux_amd64여기다가 옮겨두기

칸띄우는거 매우 중요한듯

참고블로그1

참고블로그2

profile
유사 IT 항해

0개의 댓글