Skip to main content
Version: v0.11 🚧

postgres

Schema PostgreSQL

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

Attributes

Name and DescriptionTypeDefault ValueRequired
type
Type defines whether the postgresql 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 postgresql database with image version of 14.0. 

import catalog.models.schema.v1.accessories.postgres

postgres: postgres.PostgreSQL {
type: "local"
version: "14.0"
}

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.