我正在尝试循环来自 DigitalOcean Droplet 的所有实例,其中有未知数量的实例要添加到 DigitalOcean 项目中。
类似下面的东西,但不知道如何
resource "digitalocean_droplet" "web" {
count = var.droplet_count
name = "web-${var.name}-${var.region}-${count.index +1}"
size = "512mb"
image = "centos-7-x64"
region = "nyc3"
}
resource "digitalocean_project_resources" "barfoo" {
project = data.digitalocean_project.foo.id
resources = [
digitalocean_droplet.web.*.urn, # this part having issues with
digitalocean_droplet.bastion.urn,
]
}