Set up a PostgreSQL Instance Store
This guide outlines the steps to set up an Ascend Instance Store with PostgreSQL.
Prerequisites​
- Ascend Instance
- PostgreSQL installed to use
psql
CLI tool (brew install postgresql
) - PostgreSQL instance on your preferred cloud provider
Configure your Ascend Instance Store​
-
Access your Ascend Instance settings:
- Navigate to your Instance URL
- Go to Settings > Instance
-
Add your database password to the Instance Vault:
- Scroll to Instance Vault section
- Select Manage Secrets
- Click Add Secret
- For the Secret Details:
- Use a Name like
ascend-instance-store-postgres-admin-password
- Input the password in Value
- Use a Name like
-
Configure the Instance Store:
- Return to Settings > Instance
- Click Edit Instance Store
- Select PostgreSQL
- Enter the following details:
- Hostname
tipThe hostname format may differ across cloud providers.
- User
- Secret name from vault (e.g., `ascend-instance-store-postgres-admin-password`)
- Database name (recommended: `ascend_instance`)
:::note
On GCP, you cannot give your database the same name as your PostgreSQL instance. If you're using GCP, consider naming your instance `ascend-instance` and your database `ascend-instance-db`.- Schema (recommended:
instance_data
)
-
Connect to your PostgreSQL instance via
psql
:
HOSTNAME=<YOUR-HOSTNAME>
PASSWORD=<YOUR-POSTGRES-USER-PASSWORD>
psql "host=${HOSTNAME} port=5432 user=postgres dbname=postgres password=${PASSWORD}"
If you see postgres=>
at the beginning of your output, you're connected to the database and ready for the next step!
- Click Get Setup Script and copy & paste the commands into your terminal. Alternatively, you can run the commands below (after setting the variables).
/* Below we are creating a dedicated database, schema, and user for storing your instance information in Postgres */
\set INSTANCE_DB '<instance-db>' \;
\set INSTANCE_SCHEMA '<instance-schema>' \;
\set INSTANCE_USER '<instance-user>' \;
CREATE DATABASE :INSTANCE_DB;
\connect :INSTANCE_DB \;
CREATE SCHEMA :INSTANCE_SCHEMA;
/* Change the below password and store it in your vault with key POSTGRES_PASSWORD */
CREATE USER :INSTANCE_USER WITH PASSWORD '<your-password>';
GRANT ALL ON SCHEMA :INSTANCE_SCHEMA TO :INSTANCE_USER;
- In the Ascend UI, click Check and Update Instance Store
🎉 Congratulations! Your Ascend Instance is now connected to PostgreSQL.