Skip to content

Databases

All applications in an environment share a common database cluster.

The database cluster set up for your environment is {Environment}-main, and the default database is {Environment}-main-one.

Step 1: Add and configure the databases package

repo-iac/environments/dev/
ok pkg add databases
cd databases

Update package-config.yml with your preferences. Enabling Serverless creates a Serverless database cluster. To create a traditional database cluster, set Enable to false.

Step 2: Install the package

repo-iac/environments/dev/databases/
ok pkg install

Step 3: Initialize and apply the databases stack

repo-iac/environments/dev/databases/
terraform init
terraform apply

Step 4: Verify

Run the following command:

aws rds describe-db-instances | jq '.DBInstances[].DBInstanceIdentifier'

The output list should contain the name of the VPC you just created.

Login to the AWS console and navigate to RDS. Select Databases in the left-hand menu.

The list should contain the name of the database cluster you just created.


Commit your files

At this stage it is a good idea to commit your files.

Next step

Set up certificates.