T
resource "digitalocean_droplet" "droplet" {
count = var.instance_count
image = "ubuntu-18-04-x64"
name = "droplet"
region = "nyc1"
size = "s-1vcpu-1gb"
tags = [ digitalocean_tag.username.id ]
depends_on = [
digitalocean_ssh_key.user_ssh_key,
digitalocean_tag.username ]
ssh_keys = [ digitalocean_ssh_key.user_ssh_key.fingerprint ]
}
output "instance_ip" {
value = zipmap(range(var.instance_count), [for instance in digitalocean_droplet.droplet: instance.ipv4_address])
}