Provision loadbalancer with terraform and custom scripts

This commit is contained in:
Paul-Henri Froidmont 2019-08-17 23:58:36 +02:00
parent 01b7e79e55
commit 77a6ef36f3
8 changed files with 136 additions and 29 deletions

27
terraform/instances.tf Normal file
View file

@ -0,0 +1,27 @@
data "scaleway_image" "ubuntu" {
architecture = var.architecture
name = var.image
}
resource "scaleway_server" "node" {
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"]
}
resource "scaleway_server" "master" {
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 = [
"${local.environment}-master",
"${local.environment}-etcd",
]
}