小编Poo*_*ath的帖子

Terraform:变量的动态属性(以splat语法显示)

在terraform HCL中,是否可以从变量动态引用对象的属性?

即:

variable "attribute" {
  type = "string"
}

data "terraform_remote_state" "thing" {
  not_really_important
}

output "chosen" {
  value = "${data.terraform_remote_state.thing.$var.attribute}"
}
Run Code Online (Sandbox Code Playgroud)

更具体到我的情况,我希望用splat语法做到这一点:

variable "attribute" {
  type = "string"
}

data "terraform_remote_state" "thing" {
  count = 3 # really this is also a variable
  not_really_important
}

output "chosen" {
  value = "${data.terraform_remote_state.thing.*.$var.attribute}"
}
Run Code Online (Sandbox Code Playgroud)

我已经尝试了类似的东西lookup(data.terraform_remote_state.thing, var.attribute)(对于splat问题),lookup(element(data.terraform_remote_state.*, count.index), var.attribute)但他们都抱怨我的属性引用不完整/错误的形式.

terraform hcl

5
推荐指数
1
解决办法
522
查看次数

可以在 iPadOS 上安装为 iOS 12 开发的应用吗

考虑到 iOS 13 发布 iPadOS,是否可以在 iPadOS 上安装为较低 iOS 版本开发的应用程序?或者它是否需要专门为 iPadOS 开发应用程序,例如 Watch OS 或 Mac OS?

ipad ios

2
推荐指数
1
解决办法
194
查看次数

标签 统计

hcl ×1

ios ×1

ipad ×1

terraform ×1