ash*_*hpm 7 terraform hashicorp
我正在使用 terraform 版本 0.13.2,提供商http://registry.terraform.io/hashicorp/local v2.1.0 并拥有以下资源:
\nterraform {\n required_providers {\n local = {\n source = "hashicorp/local"\n }\n }\n required_version = ">= 0.13"\n}\n\nresource "local_file" "test_local_file" {\n content = "This is a test file"\n filename = "test.txt"\n}\n
Run Code Online (Sandbox Code Playgroud)\n现在,当我仅获取另一个目录中的 terraform.tfstate 文件并尝试在新目录中使用 terraform 1.1.2 销毁此配置时,我在 terraform destroy 上收到以下错误:
\n\xe2\x94\x82 Error: Missing resource schema from provider\n\xe2\x94\x82 \n\xe2\x94\x82 No resource schema found for local_file.\n
Run Code Online (Sandbox Code Playgroud)\n解决办法是什么?
\n使用 terraform v1.1.2,当您尝试仅使用状态文件删除配置时,terraform 不知何故无法获取本地提供程序。修复方法是将local
提供程序块与状态文件一起包含在新目录中,然后执行terraform init
,terraform apply
terraform {
required_providers {
local = {
source = "hashicorp/local"
}
}
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
15693 次 |
最近记录: |