我正在使用 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解决办法是什么?
\nterraform 的官方文档提到:
但在我的 mac 中找不到它。
Macbook 版本:macOS Big Sur 版本 11.6.2
Terraform 文档: https: //www.terraform.io/cli/config/config-file