【发布时间】:2020-04-30 20:58:18
【问题描述】:
我正在使用 Azure 提供程序并将 terraform 状态存储在 Azure blob 存储中。为此使用下面的代码 sn-p。
data "terraform_remote_state" "xxxxxx" {
backend = "azurerm"
config = {
container_name = "terraform-state"
resource_group_name = "${var.remote_state_resource_group}"
storage_account_name = "${var.remote_state_storage_account}"
access_key = "${var.remote_state_credentials}"
key = "${var.cluster_name}-k8s-worker"
}
defaults = {}
}
如果我使用最新版本的 terraform 版本 0.12.x 运行上述代码,则会失败并出现以下错误。但是使用 0.11.x 运行相同的代码,它按预期工作。
Error message:
Error: Unable to find remote state
on example2.tf line 20, in data "terraform_remote_state" "xxxxxx":
20: data "terraform_remote_state" "xxxxxx" {
No stored state was found for the given workspace in the given backend.
任何人在使用 Azure blob 存储的 terraform 0.12.x 中都面临过类似的问题。
【问题讨论】:
-
您需要提供有关您使用的 terraform 代码的更多信息。
-
您的问题有什么更新吗?我的回答能帮你解决吗?如果是,请采纳。
-
什么原因不回复也不接受?
标签: azure terraform azure-blob-storage terraform-provider-azure