2019-04-04 02:25:38 +02:00
|
|
|
data "scaleway_image" "ubuntu" {
|
2019-08-15 17:51:57 +02:00
|
|
|
architecture = var.architecture
|
|
|
|
|
name = var.image
|
2019-04-04 02:25:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
resource "scaleway_server" "node" {
|
2019-08-15 17:51:57 +02:00
|
|
|
count = var.node_instance_count
|
|
|
|
|
name = "node${count.index + 1}"
|
|
|
|
|
image = data.scaleway_image.ubuntu.id
|
|
|
|
|
type = var.node_instance_type
|
|
|
|
|
state = "running"
|
|
|
|
|
dynamic_ip_required = true
|
|
|
|
|
tags = ["${local.environment}-node"]
|
2019-04-04 02:25:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
resource "scaleway_server" "master" {
|
2019-08-15 17:51:57 +02:00
|
|
|
count = var.master_instance_count
|
|
|
|
|
name = "master${count.index + 1}"
|
|
|
|
|
image = data.scaleway_image.ubuntu.id
|
|
|
|
|
type = var.master_instance_type
|
|
|
|
|
state = "running"
|
|
|
|
|
dynamic_ip_required = true
|
|
|
|
|
tags = [
|
2019-04-09 00:37:28 +02:00
|
|
|
"${local.environment}-master",
|
2019-08-15 17:51:57 +02:00
|
|
|
"${local.environment}-etcd",
|
|
|
|
|
]
|
2019-04-04 02:25:38 +02:00
|
|
|
}
|