| page_title | cozystack_mariadb Resource - cozystack |
|---|---|
| subcategory | |
| description | A Cozystack managed MariaDB instance, deployed inside a tenant namespace. The deprecated inline backup block is not managed; use the BackupClass / Plan flow instead. |
A Cozystack managed MariaDB instance, deployed inside a tenant namespace. The deprecated inline backup block is not managed; use the BackupClass / Plan flow instead.
resource "cozystack_mariadb" "app" {
name = "app"
namespace = "tenant-root"
replicas = 2
version = "v11.8"
size = "20Gi"
# Passwords are generated by the platform and kept in the
# mariadb-app-credentials Secret.
users = {
app = { max_user_connections = 100 }
}
databases = {
appdb = { roles = { admin = ["app"] } }
}
}name(String) MariaDB instance name (metadata.name). Immutable.namespace(String) Tenant namespace the application is created in. Immutable.
databases(Attributes Map) Databases keyed by name, each with admin/readonly user roles. (see below for nested schema)external(Boolean) Enable external access from outside the cluster.replicas(Number) Number of MariaDB replicas.resources(Attributes) Explicit CPU and memory per replica; overridesresources_presetfor any field set. (see below for nested schema)resources_preset(String) Sizing preset applied whenresourcesis omitted.size(String) Persistent volume size (quantity, e.g.10Gi).storage_class(String) StorageClass used to store the data. Changing a value set here replaces the object, because an existing volume is never migrated to another class. Removing the attribute from the configuration does not: the object keeps its volumes and the recorded class reverts to the default.users(Attributes Map) MariaDB users keyed by user name. The platform generates every user's password and keeps it in themariadb-<name>-credentialsSecret; it cannot be set here. (see below for nested schema)version(String) MariaDB version (v11.8,v11.4,v10.11,v10.6).wait_for_ready(Boolean) Block on create/update until theReadycondition is true and any server-generated outputs the resource exposes are readable.wait_timeout(String) Maximum time to wait whenwait_for_readyis set (Go duration, e.g.10m). Readiness and outputs share this budget; outputs that never appear leave a warning and their attributes stay null until the next refresh.
chart_version(String) Deployed chart version (status.version).id(String) Synthetic identifier in the formnamespace/name.ready(Boolean) Whether the application'sReadycondition is true.uid(String) Server-assigned object UID (metadata.uid). Stable across updates; changes on recreate.
Optional:
roles(Attributes) User roles for this entry. (see below for nested schema)
Optional:
admin(List of String) Users with admin privileges.readonly(List of String) Users with read-only privileges.
Optional:
cpu(String) CPU available to each replica (quantity, e.g.500m).memory(String) Memory available to each replica (quantity, e.g.512Mi).
Optional:
max_user_connections(Number) Maximum number of connections for the user.
Import is supported using the following syntax:
The terraform import command can be used, for example:
# MariaDB instances are imported as "<namespace>/<name>".
terraform import cozystack_mariadb.app tenant-root/app