adjustments
This commit is contained in:
parent
78961a6349
commit
688d552a5d
1 changed files with 24 additions and 9 deletions
|
|
@ -14,19 +14,34 @@ resource "stackit_network_interface" "example_nic" {
|
|||
security = false
|
||||
}
|
||||
|
||||
locals {
|
||||
servers = flatten([
|
||||
for zone, count in {
|
||||
eu01-3 = 2,
|
||||
eu01-1 = 1,
|
||||
eu01-2 = 1
|
||||
} : [
|
||||
for index in range(count) : {
|
||||
name = "example-server-${zone}-${index}"
|
||||
availability_zone = zone
|
||||
}
|
||||
]
|
||||
])
|
||||
}
|
||||
|
||||
resource "stackit_server" "example_server" {
|
||||
project_id = var.stackit_project_id
|
||||
name = "example-server"
|
||||
for_each = { for server in local.servers : server.name => server }
|
||||
|
||||
project_id = var.stackit_project_id
|
||||
name = each.value.name
|
||||
boot_volume = {
|
||||
size = 64
|
||||
source_type = "image"
|
||||
source_id = "a2c127b2-b1b5-4aee-986f-41cd11b41279" // ubuntu 24.04
|
||||
size = 64
|
||||
source_type = "image"
|
||||
source_id = "a2c127b2-b1b5-4aee-986f-41cd11b41279" // Ubuntu 24.04
|
||||
performance_class = "storage_premium_perf12"
|
||||
}
|
||||
availability_zone = "eu01-2"
|
||||
// change on the machine type does not affect the underlying volume
|
||||
machine_type = "n3.56d.g4"
|
||||
keypair_name = stackit_key_pair.example_keypair.name
|
||||
availability_zone = each.value.availability_zone
|
||||
machine_type = "n3.14d.g1"
|
||||
network_interfaces = [
|
||||
stackit_network_interface.example_nic.network_interface_id
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in a new issue