0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

M1 macでterraformコマンドを使う時におきたエラーと対処

Posted at

事象と前提

・terraformのバージョン1.3.9でのコマンドを利用する必要があった
・m1 Macでterraformコマンドを利用すると、以下のエラーになる

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.

エラー内容でググると以下のやりとりが発見
https://discuss.hashicorp.com/t/template-v2-2-0-does-not-have-a-package-available-mac-m1/35099/2

対処内容その1:m1-terraform-provider-helperを利用

m1-terraform-provider-helperについてはこちらにも記載があった。
https://techblog.openwork.co.jp/entry/m1-provider-issue
まずはこれを試す!

brew unistall terraform

してから、入れる

brew install kreuzwerker/taps/m1-terraform-provider-helper
Install Terraform
brew tap hashicorp/tap
brew install hashicorp/tap/terraform
m1-terraform-provider-helper install hashicorp/template -v v2.2.0

解決せずでした。。

続いて、こちら
https://zenn.dev/mihohoi/articles/4e15a098a08c25
を参考に、tfenv(※terraformのバージョン管理ツール)での利用を試した。

対処内容その2:tfenvを使い、amd64版のterraformを利用(これで解決!)

brew unistall terraform

してから、

brew install tfenv
tfenv uninstall 1.3.9
TFENV_ARCH=amd64 tfenv install 1.3.9
tfenv use 1.3.9

を試す。
※前述のページにもtfenv使ってる人がいた( https://discuss.hashicorp.com/t/template-v2-2-0-does-not-have-a-package-available-mac-m1/35099/25 )

これで改善しました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?