Skip to main content
Version: v0.10

mysql

Schema MySQL

MySQL describes the attributes to locally deploy or create a cloud provider
managed mysql database instance for the workload.

Attributes

Name and DescriptionTypeDefault ValueRequired
type
Type defines whether the mysql database is deployed locally or provided by
cloud vendor.
"local" | "cloud"Undefinedrequired
version
Version defines the mysql version to use.
strUndefinedrequired

Examples

Instantiate a local mysql database with version of 5.7. 

import catalog.models.schema.v1.accessories.mysql

mysql: mysql.MySQL {
type: "local"
version: "5.7"
}

Credentials and Connectivity

For sensitive information such as the host, username and password for the database instance, Kusion will automatically inject them into the application container for users through environment variables. The relevant environment variables are listed in the table below.

NameExplanation
KUSION_DB_HOST_<DATABASE_NAME>Host address for accessing the database instance
KUSION_DB_USERNAME_<DATABASE_NAME>Account username for accessing the database instance
KUSION_DB_PASSWORD_<DATABASE_NAME>Account password for accessing the database instance

The <DATABASE_NAME> is composed of two parts, one of which is the key of database declared in AppConfiguration and the other is the suffix declared in workspace configuration. Kusion will concatenate the database key and suffix, convert them to uppercase, and replace - with _. And the <DATABASE_TYPE> supported now includes mysql and postgres.