作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在 mac 操作系统上运行 Terraform v0.12.16。我有一个引用 azure 数据查找的 terraform 文件:
provider "azurerm" {
version = "=1.37.0"
}
terraform {
backend "azurerm" {
storage_account_name = "tfstate"
container_name = "tfstate"
key = "terraform.tfstate"
}
}
/* Pull in shared resources */
data "azurerm_resource_group" "dev" {
name = "Development"
}
data "azurerm_resource_group" "uat" {
name = "UAT"
}
data "azurerm_resource_group" "staging" {
name = "Staging"
}
data "azurerm_resource_group" "prod" {
name = "Production"
}
data "azurerm_container_registry" "acr" {
name = "containerRegistryAU"
resource_group_name = data.azurerm_resource_group.dev.name
}
当我运行 terraform 计划时,我得到:
terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
random_integer.ri: Refreshing state... [id=44293]
data.azurerm_dns_zone.staging_ynomia_com: Refreshing state...
data.azurerm_resource_group.dev: Refreshing state...
data.azurerm_resource_group.staging: Refreshing state...
data.azurerm_dns_zone.uat_ynomia_com: Refreshing state...
data.azurerm_resource_group.prod: Refreshing state...
data.azurerm_resource_group.uat: Refreshing state...
data.azurerm_dns_zone.dev_ynomia_com: Refreshing state...
data.azurerm_dns_zone.ynomia_com: Refreshing state...
Error: Error: Resource Group "Development" was not found
on _main.tf line 27, in data "azurerm_resource_group" "dev":
27: data "azurerm_resource_group" "dev" {
Error: Error: Resource Group "UAT" was not found
on _main.tf line 31, in data "azurerm_resource_group" "uat":
31: data "azurerm_resource_group" "uat" {
Error: Error: Resource Group "Staging" was not found
on _main.tf line 35, in data "azurerm_resource_group" "staging":
35: data "azurerm_resource_group" "staging" {
Error: Error: Resource Group "Production" was not found
on _main.tf line 39, in data "azurerm_resource_group" "prod":
39: data "azurerm_resource_group" "prod" {
Error: Error: DNS Zone "ynomia.com" was not found
on _main.tf line 138, in data "azurerm_dns_zone" "ynomia_com":
138: data "azurerm_dns_zone" "ynomia_com" {
Error: Error: DNS Zone "dev.ynomia.com" was not found
on _main.tf line 142, in data "azurerm_dns_zone" "dev_ynomia_com":
142: data "azurerm_dns_zone" "dev_ynomia_com" {
Error: Error: DNS Zone "uat.ynomia.com" was not found
on _main.tf line 146, in data "azurerm_dns_zone" "uat_ynomia_com":
146: data "azurerm_dns_zone" "uat_ynomia_com" {
Error: Error: DNS Zone "staging.ynomia.com" was not found
on _main.tf line 150, in data "azurerm_dns_zone" "staging_ynomia_com":
150: data "azurerm_dns_zone" "staging_ynomia_com" {
这已经工作了几个月,所以我很困惑为什么它突然失败了。我该如何调试这里发生的事情?
最佳答案
据我所知,可能的原因是您使用了本地 Azure CLI 当前使用的订阅,但这不是您想要使用的正确订阅。
因此,您需要找到您的资源分组所在的正确订阅。然后像这样更改 Terraform 提供程序:
provider "azurerm" {
version = "=1.37.0"
subscription_id = "your_subscription_id"
tenant_id = "your_tenant_id"
}
它将从您需要使用的订阅和租户中获取资源组。
关于azure - Terraform 计划因数据元素错误地声称它们不存在而失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59146799/
我制作了一个函数,可以一次绘制来自多个因子分析的载荷,也可以绘制变量不完全重叠(或根本不重叠)的载荷。它可以正常工作,但有时在各个分析中因子加载是相同的,这意味着这些点会相互重叠绘制。 library
我是一名优秀的程序员,十分优秀!