Amazon Redshift
BInbox signs in to Redshift with a database user’s name and password over PostgreSQL’s wire protocol, with TLS 1.2 or higher, and reads with that user’s own privileges.
What you will paste into BInbox
Section titled “What you will paste into BInbox”On New connection, choose Amazon Redshift.
| Field | What to enter |
|---|---|
| Endpoint host | The cluster’s or workgroup’s endpoint, without its port and database, such as mycluster.abc123.us-east-1.redshift.amazonaws.com. |
| Port | 5439 unless the endpoint says otherwise. You may leave it empty. |
| Database | The database to read. |
| Certificate authority | Optional. Paste the authority’s certificate in PEM only when a public authority did not sign the cluster’s certificate. |
| How BInbox signs in | A service account’s user name and password or key file. This is the only choice. |
| User name | The user you make below, binbox_reader. |
| Password | That user’s password. |
Find the endpoint
Section titled “Find the endpoint”In the console, open Amazon Redshift, then your cluster or serverless workgroup, and copy the Endpoint, then
remove :5439/<database> from its end. The same value comes from the command line:
aws redshift describe-clusters --cluster-identifier <cluster> --query "Clusters[0].Endpoint"aws redshift-serverless get-workgroup --workgroup-name <workgroup> --query "workgroup.endpoint"The endpoint must be publicly accessible. For a cluster, set Publicly accessible on, and let its security group accept inbound traffic on the port.
Make a read-only user
Section titled “Make a read-only user”Run these statements in the query editor or with psql, as a user who may create users. Redshift requires a password
with 8 to 64 characters, an upper-case letter, a lower-case letter and a digit.
CREATE USER binbox_reader PASSWORD '<a long random password>';GRANT USAGE ON SCHEMA <schema> TO binbox_reader;GRANT SELECT ON ALL TABLES IN SCHEMA <schema> TO binbox_reader;ALTER DEFAULT PRIVILEGES IN SCHEMA <schema> GRANT SELECT ON TABLES TO binbox_reader;Repeat the grants for each schema BInbox should read. Then check the new user before you paste anything into BInbox:
psql "host=<endpoint> port=5439 dbname=<database> user=binbox_reader sslmode=verify-full" -c "select 1"Least permissions
Section titled “Least permissions”| Grant | Why BInbox needs it |
|---|---|
USAGE on each schema to read |
To list the schemas. |
SELECT on each table or view to read |
To read tables and run queries. |
Do not grant CREATE, INSERT, UPDATE or DELETE.
Check: the test-connection report
Section titled “Check: the test-connection report”Choose Test connection in BInbox. All four permissions must be Granted:
| Permission | Granted when |
|---|---|
| Sign in | The user name and password are accepted over TLS. |
| List the schemas | The user may use at least one schema that is not the cluster’s own. |
| Read at least one table | The user may SELECT from at least one table or view. |
| Run a query | A select 1 runs. |
| Refuse a write, so SQL an author writes can run (optional) | A delete of no rows from the first table the user may read, DELETE FROM <table> WHERE 1 = 0, is refused inside a read-only transaction. BInbox runs every query in such a transaction. Without this, authors still pick tables, but cannot write a dataset’s SQL. |
Add it in BInbox
Section titled “Add it in BInbox”An owner or admin opens the Data tab at app.binbox.ai, chooses Connect, then New connection, fills in the fields above, and chooses Test and save. Connections describes the screen.
Then an author sets up a dataset from one of the connection’s tables or views, as Pick a table describes.