我对地形世界很陌生。我正试图在GCP项目中使用terraformer,但是一直找不到插件:
terraformer import google --resources=gcs,forwardingRules,httpHealthChecks --connect=true --
regions=europe-west1,europe-west4 --projects=myproj
2021/02/12 08:17:03 google importing project myproj region europe-west1
2021/02/12 08:17:04 google importing... gcs
2021/02/12 08:17:05 open \.terraform.d/plugins/windows_amd64: The system cannot find the path specified.在此之前,安装了terraform:choco install terraformer,我下载了Google,terraform-provider-google_v3.56.0_x5.exe,把它放在我的terraform dir中,然后做了terraform init。我检查了%AppData\Roaming\terraform.d\plugins\windows_amd64,plugins\windows_amd64不存在,所以我创建了它,放入Google并重新执行init。
我的main.tf是:
provider "google" {
project = "{myproj"
region = "europe-west2"
zone = "europe-west2-a"
}会不会是巧克力的安装引起了这个问题?我从来没有使用过它,但替代安装看起来令人望而生畏!
发布于 2021-02-12 15:23:56
令人畏惧的指令起作用了!
Run git clone <terraformer repo>
Run go mod download
Run go build -v for all providers OR build with one provider go run build/main.go {google,aws,azure,kubernetes and etc}
Run terraform init against an versions.tf file to install the plugins required for your platform. For example, if you need plugins for the google provider, versions.tf should contain:
terraform {
required_providers {
google = {
source = "hashicorp/google"
}
}
required_version = ">= 0.13"
}一定要运行那个版本而不是巧克力版。
go mod download标志-x将在该命令运行时给出输出,否则您可能会认为什么都没有发生。
发布于 2021-10-07 16:58:17
如果您安装从巧克力,它似乎寻找供应商文件在C:\.terraform.d\plugins\windows_amd64。如果您创建这些目录并将terraform-provider-xxx.exe文件放在其中,它将被选中。
我还建议使用--verbose标志运行它。
发布于 2022-10-02 10:01:09
记住执行"terraform init“
一旦您安装了terraformer,请检查这个
terraform { required_providers ={ source = "hashicorp/aws“} required_version = ">= 0.13”}
地形导入aws -profile my-aws-profile --resources="*“--regions=eu-west-1
terraformer import aws --profile [my-aws-profile] --resources="route53" --regions=eu-west-1https://stackoverflow.com/questions/66168551
复制相似问题