Set up a PostgreSQL Instance Store
This guide outlines the steps to set up an Ascend Instance Store with PostgreSQL.
Before you begin​
Prerequisites​
- An active Ascend Instance
- PostgreSQL CLI tools installed locally (
brew install postgresql
) - A PostgreSQL-compatible database instance (hosted anywhere). For reference, here are setup guides for major public cloud providers:
Network access requirements​
Your PostgreSQL instance must allow connections from these Ascend IP addresses:
52.205.57.63
44.217.175.189
44.217.47.213
54.173.192.81
3.227.46.125
If you're running a self-hosted Ascend Instance, you'll need to allowlist your own cluster's egress IP addresses instead of the ones listed above.
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 (the IP address or domain name where your PostgreSQL database can be reached)
- User
- Secret name from vault (e.g.,
ascend-instance-store-postgres-admin-password
) - Database name (recommended:
ascend_instance
)
noteOn 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 databaseascend-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.