mirror of
https://github.com/phfroidmont/self-hosting.git
synced 2025-12-25 05:36:59 +01:00
Provision loadbalancer with terraform and custom scripts
This commit is contained in:
parent
01b7e79e55
commit
77a6ef36f3
8 changed files with 136 additions and 29 deletions
27
terraform/instances.tf
Normal file
27
terraform/instances.tf
Normal 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",
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue