You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

28 lines
586 B

resource "digitalocean_tag" "cluster" {
name = "${var.name}"
}
resource "digitalocean_ssh_key" "cluster" {
name = "${var.name}"
public_key = "${file(var.ssh_key)}"
}
resource "digitalocean_droplet" "cluster" {
name = "${var.name}-node${count.index}"
image = "centos-7-x64"
size = "${var.instance_size}"
region = "${element(var.regions, count.index)}"
ssh_keys = ["${digitalocean_ssh_key.cluster.id}"]
count = "${var.servers}"
tags = ["${digitalocean_tag.cluster.id}"]
lifecycle = {
prevent_destroy = false
}
connection {
timeout = "30s"
}
}