Database management configuration options
Continuous Delivery (CD) can manage a database for you or can be connected to a PostgreSQL instance you operate yourself. This external database can be an Amazon RDS for PostgreSQL, Amazon Aurora (PostgreSQL-compatible), or a self-managed PostgreSQL server. This gives you control over durability, backups, and high availability.
Select how CD gets its PostgreSQL database and holds the mode-specific settings.
cd4peadm::config:
database:
mode: managed # 'managed' (default) or 'external'
managed: # used when mode is 'managed'
...
external: # used when mode is 'external'
...
You can set the database to one of the following modes:
-
managed: CD runs and manages a PostgreSQL container. This is the default. -
external: CD connects to a PostgreSQL instance you provide.
Managed mode
The default. CD runs a PostgreSQL container on the database target and manages it for you.
| Setting | Description |
|---|---|
admin_db_password
|
Password for the database superuser. Used only during setup. |
cd4pe_db_username
|
Backend database user. Defaults to cd4pe. |
cd4pe_db_password
|
Backend database password. |
query_db_username
|
Query-service database user. Defaults to query. |
query_db_password
|
Query-service database password. |
repack_schedule
|
Cron schedule for routine pg_repack maintenance. |
In managed mode, targets includes a database entry naming the host that runs the container.
External mode
CD connects to a database you provide and operate. There is no database target, no admin_db_password (CD holds no administrative credential on your instance), and CD does not schedule maintenance.
cd4peadm::config:
database:
mode: external
external:
host: my-db.example.rds.amazonaws.com
port: 5432 # optional, defaults to 5432
ca_cert: |
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
cd4pe_db_username: cd4pe # optional, defaults to cd4pe
cd4pe_db_password: <password>
query_db_username: query # optional, defaults to query
query_db_password: <password>
| Setting | Description |
|---|---|
host
|
Hostname of your PostgreSQL instance. This should not include your port or scheme. Required. |
port
|
TCP port. Optional; defaults to 5432. |
ca_cert
|
PEM CA bundle used to verify the server certificate. CD always connects with sslmode=verify-full. Required. (generate_config writes this for you from ca_cert_file.) |
cd4pe_db_username
|
Backend database user. Optional; defaults to cd4pe. |
cd4pe_db_password
|
Backend database password. Must match the role you provisioned. Required. |
query_db_username
|
Query-service database user. Defaults to query. |
query_db_password
|
Query-service database password. Must match the role you provisioned. Required. |
sslmode is not configurable; CD always uses verify-full. |
|
Settings that do not apply in external mode: admin_db_password, repack_schedule, and the database target. CD does not manage or maintain an external database.
In customer installations, all password values should be encrypted at rest with hiera-eyaml.