the existing infrastructure

This commit is contained in:
Platform team
2026-11-02 09:55:39 +00:00
commit b2c2460a52
21 changed files with 537 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
# Stack for the dev environment. Every file in vms/ becomes one module
# instance, keyed by its file name. Quai only ever edits the YAML.
locals {
vm_files = fileset("${path.module}/vms", "*.yaml")
vms = { for f in local.vm_files : trimsuffix(f, ".yaml") => yamldecode(file("${path.module}/vms/${f}")) }
}
module "vm" {
source = "../../modules/vm"
for_each = local.vms
name = each.key
environment = "dev"
template = each.value.template
cpu = each.value.cpu
memory_gb = each.value.memory_gb
disks = each.value.disks
vlan = each.value.network.vlan
ip = try(each.value.network.ip, null)
backup_policy = try(each.value.backup, false) ? try(each.value.backup_policy, "daily") : null
tags = merge(try(each.value.tags, {}), { owner = try(each.value.owner, "unknown") })
}
+10
View File
@@ -0,0 +1,10 @@
owner: bob
description: CI build agent
template: ubuntu-24.04
cpu: 8
memory_gb: 16
disks:
- size_gb: 100
network:
vlan: 110
backup: false
+22
View File
@@ -0,0 +1,22 @@
# Stack for the prod environment. Every file in vms/ becomes one module
# instance, keyed by its file name. Quai only ever edits the YAML.
locals {
vm_files = fileset("${path.module}/vms", "*.yaml")
vms = { for f in local.vm_files : trimsuffix(f, ".yaml") => yamldecode(file("${path.module}/vms/${f}")) }
}
module "vm" {
source = "../../modules/vm"
for_each = local.vms
name = each.key
environment = "prod"
template = each.value.template
cpu = each.value.cpu
memory_gb = each.value.memory_gb
disks = each.value.disks
vlan = each.value.network.vlan
ip = try(each.value.network.ip, null)
backup_policy = try(each.value.backup, false) ? try(each.value.backup_policy, "daily") : null
tags = merge(try(each.value.tags, {}), { owner = try(each.value.owner, "unknown") })
}
+13
View File
@@ -0,0 +1,13 @@
owner: dana
description: Orders database (PostgreSQL)
template: rhel-9
cpu: 12
memory_gb: 64
disks:
- size_gb: 100
tier: ssd
- size_gb: 1000 # data volume
tier: ssd
network: { vlan: 130, ip: 10.0.13.20 }
backup: true
backup_policy: hourly
+10
View File
@@ -0,0 +1,10 @@
# Created before Quai. No owner on record: only platform admins can change it.
description: Partner file drop (to be retired)
template: rhel-9
cpu: 2
memory_gb: 4
disks:
- size_gb: 200
network:
vlan: 110
backup: false
+17
View File
@@ -0,0 +1,17 @@
# Front-end for the shop. Pinned to VLAN 120 by the firewall team.
owner: bob
description: Shop front-end
template: ubuntu-24.04
cpu: 4 # bumped in INC-4411
memory_gb: 16
disks:
- size_gb: 80
tier: ssd
network:
vlan: 120
ip: 10.0.12.11
backup: true
backup_policy: daily
tags:
cost_center: "4711"
app: shop
+22
View File
@@ -0,0 +1,22 @@
# Stack for the test environment. Every file in vms/ becomes one module
# instance, keyed by its file name. Quai only ever edits the YAML.
locals {
vm_files = fileset("${path.module}/vms", "*.yaml")
vms = { for f in local.vm_files : trimsuffix(f, ".yaml") => yamldecode(file("${path.module}/vms/${f}")) }
}
module "vm" {
source = "../../modules/vm"
for_each = local.vms
name = each.key
environment = "test"
template = each.value.template
cpu = each.value.cpu
memory_gb = each.value.memory_gb
disks = each.value.disks
vlan = each.value.network.vlan
ip = try(each.value.network.ip, null)
backup_policy = try(each.value.backup, false) ? try(each.value.backup_policy, "daily") : null
tags = merge(try(each.value.tags, {}), { owner = try(each.value.owner, "unknown") })
}
View File