clo*_*cop 8 terraform azure-devops
terraform init 成功初始化但卡在 terraform 计划上。
该错误与功能块有关。我不确定在哪里添加功能块:
功能块不足(源代码不可用) 至少需要 1 个“功能”块。
我的配置看起来像
terraform {
required_version = ">= 0.11"
backend "azurerm" {
features {}
}
}
Run Code Online (Sandbox Code Playgroud)
我尝试删除和添加功能块作为 github 页面
Pat*_*ick 29
该消息的另一个原因可能是正在使用指定的提供程序:
\nprovider "azurerm" {\n alias = "some_name" # <- here\n features {}\n}\nRun Code Online (Sandbox Code Playgroud)\n但未在资源上指定:
\nresource "azurerm_resource_group" "example" {\n # might this block is missing\n # -> provider = azurerm.some_name\n name = var.rg_name\n location = var.region\n}\nRun Code Online (Sandbox Code Playgroud)\n错误信息:
\nterraform plan\n\xe2\x95\xb7\n\xe2\x94\x82 Error: Insufficient features blocks\n\xe2\x94\x82\n\xe2\x94\x82 on <empty> line 0:\n\xe2\x94\x82 (source code not available)\n\xe2\x94\x82\n\xe2\x94\x82 At least 1 "features" blocks are required.\nRun Code Online (Sandbox Code Playgroud)\n
clo*_*cop 15
当您运行 terraform 的更新版本时,您需要定义下面定义的另一个块
provider "azurerm" {
features {}
}
谢谢@ SomeGuyOnAComputer
在 Terraform >= 0.13 中,示例如下versions.tf(请注意提供程序配置位于单独的块中):
# versions.tf
terraform {
required_providers {
azurerm = {
# ...
}
}
required_version = ">= 0.13"
}
# This block goes outside of the required_providers block!
provider "azurerm" {
features {}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4834 次 |
| 最近记录: |