我最近将Terraform升级到v0.13.4,现在启动工作区时遇到问题。
- terraform.io/builtin/terraform is built in to Terraform
- Using previously-installed hashicorp/aws v3.9.0
- Using previously-installed hashicorp/archive v1.3.0
Error: Failed to validate installed provider
Validating provider hashicorp/archive v1.3.0 failed: provider binary not
found: could not find executable file starting with terraform-provider-archive
我试着在这里指出所需的提供商:
terraform {
required_providers {
archive = {
source = "hashicorp/archive"
version = "1.3.0"
}
aws = {
region = "us-east-2"
#profile = "arm-sandbox"
}
}
有什么想法吗?
之前安装的archive
提供程序版本(1.3.0(可能在Terraform 0.13+中不受正确支持,或者安装不正确或可能已损坏。
考虑更新到提供商的最新版本,提供商随后也将下载最新版本。与以前的版本相比,0.13+中的提供者处理方式有所不同,因此最好在工作区上运行terraform upgrade0.13
,以确保所有内容都能正确转换和格式化为Terraform 0.13+。
terraform {
required_providers {
archive = {
source = "hashicorp/archive"
version = "2.1.0"
}
}
}
正如@martin-atkins正确指出的,awsregion
不能在required_providers
块内指定,但应该在提供者块中:
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "3.37.0"
}
}
}
provider "aws" {
region = "us-east-2"
}