1.0.0" required_-6ren">
gpt4 book ai didi

azure - 错误: Unsupported Terraform Core version

转载 作者:行者123 更新时间:2023-12-02 06:14:20 27 4
gpt4 key购买 nike

我有一个简单的地形配置,如下所示。

# Terraform settings Block
terraform {
required_version = "~> 1.0.0"
required_providers {
azurerm = {
source = "hashicorp/azurerm" # https://registry.terraform.io/providers/hashicorp/azurerm/latest
version = "~> 3.0"
}
}
}

provider "azurerm" {
features { }
}

resource "azurerm_resource_group" "rg" {
name = var.resource_group_name
location = var.resource_group_location
}

当我运行时

terraform init

我收到以下错误。


│ Error: Unsupported Terraform Core version

│ on main.tf line 3, in terraform:
│ 3: required_version = "~> 1.0.0"

│ This configuration does not support Terraform version 1.2.2. To proceed, either choose another supported Terraform version or update this version
│ constraint. Version constraints are normally set for good reason, so updating the constraint may lead to other errors or unexpected behavior.

如果所需版本按以下方式设置,则可以正常工作(将 ~> 更改为 >=)。

required_version = ">= 1.0.0"

查看了this doc ,但不清楚该做什么。我应该恢复到 required_version = ">= 1.0.0"

只是想确保最新的未成年人已就位。另请参阅某处,对于生产,建议使用带有波形符(~)的版本。现在有点困惑。

最佳答案

您已经安装了 TF 版本 1.2.2,它显然比 1.0.0 要新得多。如果你想用这么旧版本的TF,你有download older version terraform,并使用它来运行您的脚本。

关于azure - 错误: Unsupported Terraform Core version,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72975317/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com