Redshift Setup Guide
Prerequisites
- An Amazon Redshift provisioned cluster or Redshift Serverless workgroup.
- Access to the AWS Management Console with permission to view the cluster or workgroup and edit its VPC security group.
- A Redshift user with permission to create users and grant privileges (for example, a superuser).
Setup Guide
Step 1: Find your Hostname, Port, and Database
- Log in to the Amazon Redshift console.
- Open your cluster or workgroup:
- Provisioned cluster: In the left menu, click Clusters, then select your cluster.
- Redshift Serverless: In the left menu, click Redshift Serverless > Workgroup configuration, then select your workgroup.
- In the General information pane, copy the Endpoint. It has the format
hostname:port/database, for exampledefault.123456789012.us-east-1.redshift-serverless.amazonaws.com:5439/dev. - Split the endpoint into three values and make a note of them. You will need them to configure your connection.
- Hostname: everything before the colon (
:), for exampledefault.123456789012.us-east-1.redshift-serverless.amazonaws.com. - Port: the number between the colon and the slash (
/), for example5439. - Database: everything after the slash, for example
dev.
- Hostname: everything before the colon (
Step 2: Allow Matia to Connect
- In your cluster or workgroup's Network and security settings, check that Publicly accessible is turned on.
- In the same section, click the VPC security group linked to your cluster or workgroup.
- Click the Inbound rules tab, then click Edit inbound rules.
- Add a rule for each of Matia's IP addresses:
- Type: Custom TCP
- Port range: your Redshift port, for example
5439 - Source: one of the following IP addresses:
52.20.96.22/3223.21.86.124/3244.219.180.239/32
- Click Save rules.
Step 3: Create a Read-Only User for Matia
-
Connect to your database as a user who can create users and grant privileges, for example from the Redshift Query editor v2.
-
Create a dedicated user for Matia:
CREATE USER matia PASSWORD '<strong, unique password>';The password must be 8–64 characters long and include at least one uppercase letter, one lowercase letter, and one number. It can't contain
',",\,/, or@. -
Grant the user read access. Choose one of the following options:
-
Option A: The whole database. Gives read access to every schema and table in the database, including schemas and tables created later by any user.
GRANT USAGE FOR SCHEMAS IN DATABASE "<database>" TO matia;
GRANT SELECT FOR TABLES IN DATABASE "<database>" TO matia; -
Option B: Only some schemas. Run the following for each schema you want Matia to read:
GRANT USAGE ON SCHEMA "<schema>" TO matia;
GRANT SELECT ON ALL TABLES IN SCHEMA "<schema>" TO matia;
-- Optional: also give read access to tables you create in this schema later
ALTER DEFAULT PRIVILEGES IN SCHEMA "<schema>" GRANT SELECT ON TABLES TO matia;
-
-
Make a note of the Username (
matia) and Password. You will need them to configure your connection.
Note: In Option B, ALTER DEFAULT PRIVILEGES only covers tables created by the user who runs it. If other users create tables in the schema, run it again for each of them with FOR USER <user>, or use Option A.
Step 4: Complete Configuration in Matia
- Enter the Hostname, Port, and Database you found in Step 1.
- Enter the Username and Password of the user you created in Step 3.
- If your cluster or workgroup requires SSL connections, set the SSL toggle to ON.
- Enter an Asset Name.
- (Optional) Enter a Description.
- (Optional) Assign Tags.
- Select an Owner.
- Verify that your Redshift database is successfully connected by clicking on Test Connection.
- Click Connect.