M1 맥북에서 테라폼 코드를 작성할 때 'template_cloudinit_confg'를 이용하면 오류가 발생합니다.
- Using previously-installed terraform-provider-openstack/openstack v1.53.0
╷
│ Error: Incompatible provider version
│
│ Provider registry.terraform.io/hashicorp/template v2.2.0 does not have a package available for your current platform, darwin_arm64.
│
│ Provider releases are separate from Terraform CLI releases, so not all providers are available for all platforms. Other versions of this provider may have different platforms supported.
╵
template_cloudinit_confg가 deprecate 되고, cloudinit_config 로 변경되고 난 후 M1 맥북이 출시 되어 정식으로는 지원되지 않기 때문입니다.
해결 방법은 두가지 입니다.
먼저 소스코드를 변경하는 방법입니다. 다음과 같이 cloudinit_config와 templatefile 함수를 함께 사용하여 동일한 결과를 이용할 수 있습니다.
# deprecate 되어 사용 안됨
data "template_cloudinit_config" "config" {
gzip = true
}
# templatefile 함수와 함께 cloudinit_confg 를 사용
data "cloudinit_config" "config" {
gzip = true
content = templatefile("cloud-init.yaml", {
name = "test"
})
}
두 번째는 M1 맥북에서 사용할 수 있도록 빌드 하는 방법입니다. kreuzwerker 사에서 빌드 할 수 있는 파일을 제공하기 때문에 brew 를 이용하여 다음과 같이 설치하여 사용할 수 있습니다.
brew install kreuzwerker/taps/m1-terraform-provider-helper
m1-terraform-provider-helper activate
m1-terraform-provider-helper install hashicorp/template -v v2.2.0
https://discuss.hashicorp.com/t/template-v2-2-0-does-not-have-a-package-available-mac-m1/35099/6
반응형
'프로그래밍 언어 > terraform' 카테고리의 다른 글
[terraform] provider를 로컬 캐쉬를 이용하여 초기화 하는 방법 (0) | 2024.02.07 |
---|---|
[terraform] 테라폼의 특정 모듈만 삭제하는 방법 (0) | 2022.04.18 |
[terraform] 오픈스택 VM 생성시 Invalid key_name provided 오류 (0) | 2022.02.15 |
[terraform] 토큰 인증시 cannot use AllowReauth, when the token ID is defined and auth scope is not set 오류 (0) | 2022.02.14 |
[terraform] 오픈스택 프로바이더 크레덴셜/토큰(credential/token) 예제 (0) | 2022.02.14 |