feat: add module3-6

This commit is contained in:
Jan Schnurpfeil 2025-04-28 13:11:47 +02:00
parent 6d6273a33b
commit a4b002dc61
95 changed files with 1848 additions and 1 deletions

42
module6/tf/postgres.tf Normal file
View file

@ -0,0 +1,42 @@
resource "stackit_postgresflex_instance" "scrumlr" {
project_id = var.project_id
name = "scrumlr"
acl = stackit_ske_cluster.scrumlr.egress_address_ranges
backup_schedule = "00 00 * * *"
flavor = {
cpu = 2
ram = 4
}
replicas = 3
storage = {
class = "premium-perf6-stackit"
size = 5
}
version = 17
}
resource "stackit_postgresflex_user" "scrumlr" {
project_id = var.project_id
instance_id = stackit_postgresflex_instance.scrumlr.instance_id
username = "scrumlr"
roles = ["login", "createdb"]
}
resource "stackit_postgresflex_database" "scrumlr" {
project_id = var.project_id
instance_id = stackit_postgresflex_instance.scrumlr.instance_id
owner = stackit_postgresflex_user.scrumlr.username
name = "scrumlr"
}
output "postgres_dsn" {
value = format(
"postgres://%s:%s@%s:%d/%s",
stackit_postgresflex_user.scrumlr.username,
stackit_postgresflex_user.scrumlr.password,
stackit_postgresflex_user.scrumlr.host,
stackit_postgresflex_user.scrumlr.port,
stackit_postgresflex_database.scrumlr.name
)
sensitive = true
}