Terraform M1 Error: Incompatible provider version 해결완료

snooby·2023년 5월 17일
0

☁ Cloud

목록 보기
22/24


Terraform init을 하는데 darwin 버전에 맞는 공급자가 없다는 에러가 나는 경우가 있습니다.
이는 terraform initTerraform을 m1 MacBook으로 사용할 때 arm64 Darwin 커널에 대한 바이너리가 없기 때문에 때때로 실패합니다.

따라서 저는 실제 공급되는 template 공식을 클론하여 패키지로 build 후 저의 terraform 패키지에 추가하여 사용하였습니다.

아래의 코드를 그대로 사용하시면 해결하실 수 있을 것입니다.

git clone https://github.com/hashicorp/terraform-provider-template
cd terraform-provider-template

# go 없을 경우 설치
brew install go

go build
mkdir -p  ~/.terraform.d/plugins/registry.terraform.io/hashicorp/template/2.2.0/darwin_arm64
mv terraform-provider-template ~/.terraform.d/plugins/registry.terraform.io/hashicorp/template/2.2.0/darwin_arm64/terraform-provider-template_v2.2.0_x5

chmod +x ~/.terraform.d/plugins/registry.terraform.io/hashicorp/template/2.2.0/darwin_arm64/terraform-provider-template_v2.2.0_x5
profile
데이터를 가치있게 다루고 싶은 개발자 🐥

0개의 댓글