Mac M1安装的Terraform aws提供商问题



我在Mac M1上使用Terraform v1.0.11。当我尝试运行terraform init时,我遇到了以下错误:

Initializing provider plugins...
- Finding latest version of hashicorp/local...
- Finding latest version of hashicorp/null...
- Reusing previous version of hashicorp/aws from the dependency lock file
- Finding latest version of hashicorp/random...
- Finding latest version of hashicorp/template...
- Finding latest version of hashicorp/external...
- Installing hashicorp/external v2.1.0...
- Installed hashicorp/external v2.1.0 (signed by HashiCorp)
- Installing hashicorp/local v2.1.0...
- Installed hashicorp/local v2.1.0 (signed by HashiCorp)
- Installing hashicorp/null v3.1.0...
- Installed hashicorp/null v3.1.0 (signed by HashiCorp)
- Using previously-installed hashicorp/aws v3.53.0
- Installing hashicorp/random v3.1.0...
- Installed hashicorp/random v3.1.0 (signed by HashiCorp)
╷
│ 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.

我的提供商信息:

terraform {
required_providers {
aws = {
version = "~> 3.53.0"
}
}
}

据我所知,供应商版本不适用于M1。对此有什么变通办法吗?

我试着使用这个:https://github.com/hashicorp/terraform/issues/27257#issuecomment-754777716,但提供程序版本为3.53.0,但遇到问题。

这个问题有什么解决办法吗?

您可以使用他们在这个答案上所说的内容在M1上运行,即为您的体系结构编译资源。

但是template是一种不推荐使用的资源,您可以使用在M1上正常工作的templatefile。