tflint, cleanup, description of vars

This commit is contained in:
Maximilian_Schlenz 2025-07-17 11:33:42 +02:00
parent b4e80ed22e
commit df457fe625
8 changed files with 276 additions and 264 deletions

View file

@ -1,9 +1,11 @@
variable "project_id" {
type = string
description = "STACKIT project ID"
type = string
}
variable "name" {
type = string
description = "Instance name (DNS-1035 compliant)"
type = string
validation {
condition = length(regexall("^[a-z]([-a-z0-9]*[a-z0-9])?$", var.name)) > 0
@ -16,50 +18,52 @@ variable "name" {
}
}
variable "instance_id" {
type = string
default = ""
}
variable "ver" {
type = number
description = "PostgreSQL version"
type = number
}
variable "flavor" {
description = "Compute flavor (cpu, ram GB)"
type = object({
cpu = number,
cpu = number
ram = number
})
}
variable "storage" {
description = "Storage settings (class, size GB)"
type = object({
class = string,
class = string
size = number
})
}
variable "replicas" {
type = number
description = "Number of instance replicas"
type = number
}
variable "acl" {
type = list(string)
description = "Allowed CIDR list for instance access"
type = list(string)
}
variable "backup_schedule" {
type = string
description = "Backup schedule string"
type = string
}
variable "users" {
description = "Database users (username, roles)"
type = list(object({
username = string
roles = set(string)
}))
default = []
validation {
condition = alltrue([
condition = alltrue([
for user in var.users : user.username != "admin"
])
error_message = "The username 'admin' is reserved and cannot be used."
@ -67,12 +71,14 @@ variable "users" {
}
variable "databases" {
description = "Databases to create (name, owner)"
type = list(object({
name = string
owner = string
}))
default = []
validation {
validation {
condition = alltrue([
for db in var.databases : length(regexall("^[a-z]([-a-z0-9]*[a-z0-9])?$", db.name)) > 0
])