open-nomad/demo/digitalocean/terraform/main.tf

66 lines
1.4 KiB
Terraform
Raw Normal View History

variable "ssh_keys" {}
2015-09-23 21:18:42 +00:00
resource "atlas_artifact" "nomad-digitalocean" {
name = "hashicorp/nomad-demo"
type = "digitalocean.image"
version = "latest"
}
module "statsite" {
source = "./statsite"
region = "nyc3"
ssh_keys = "${var.ssh_keys}"
}
2015-09-23 21:16:36 +00:00
module "servers" {
source = "./server"
region = "nyc3"
image = "${atlas_artifact.nomad-digitalocean.id}"
ssh_keys = "${var.ssh_keys}"
statsite = "${module.statsite.addr}"
2015-09-23 21:16:36 +00:00
}
module "clients-nyc3" {
source = "./client"
region = "nyc3"
count = 500
image = "${atlas_artifact.nomad-digitalocean.id}"
servers = "${module.servers.addrs}"
ssh_keys = "${var.ssh_keys}"
2015-09-23 21:16:36 +00:00
}
module "clients-ams2" {
source = "./client"
region = "ams2"
count = 500
image = "${atlas_artifact.nomad-digitalocean.id}"
servers = "${module.servers.addrs}"
ssh_keys = "${var.ssh_keys}"
2015-09-23 21:16:36 +00:00
}
module "clients-ams3" {
source = "./client"
region = "ams3"
count = 500
image = "${atlas_artifact.nomad-digitalocean.id}"
servers = "${module.servers.addrs}"
ssh_keys = "${var.ssh_keys}"
2015-09-23 21:16:36 +00:00
}
module "clients-sfo1" {
source = "./client"
region = "sfo1"
count = 500
image = "${atlas_artifact.nomad-digitalocean.id}"
servers = "${module.servers.addrs}"
ssh_keys = "${var.ssh_keys}"
2015-09-23 21:16:36 +00:00
}
output "Nomad Servers" {
value = "${join(" ", split(",", module.servers.addrs))}"
}
output "Statsite Server" {
value = "${module.statsite.addr}"
}