【发布时间】:2021-10-13 22:59:38
【问题描述】:
我想在 AWS 上使用来自 terraform 变量的模式创建资源。
例如:
proyects = ["proyect1/X", "proyect1/Y", "proyect2/X", ...]
resource "aws_example" "proyect1" {
count = length(var.proyects) <-- only using the proyect1/... ones
name = var.proyects[count.index] <-- only using the proyect1/... ones
已创建资源 proyect1/X
资源 proyect1/Y 已创建
resource "aws_example" "proyect2" {
count = length(var.proyects) <-- only using the proyect2/... ones
name = var.proyects[count.index] <-- only using the proyect2/... ones
资源 proyect2/X 已创建
资源 proyect2/Y 已创建
我不知道这是否可能...我正在尝试使用https://www.terraform.io/docs/language/functions/index.html
【问题讨论】:
标签: amazon-web-services terraform terraform-provider-aws