Connect Amazon Aurora PostgreSQL to Infograph
What it brings in: Every table and view the user can read.
What you need
- An Aurora PostgreSQL cluster that uses password login, and access to it in the AWS console.
- A database user with a password. Infograph cannot use IAM authentication tokens, so express configuration clusters, which accept only those, will not work.
- Infograph's sync servers connect from 51.222.152.247.
Your connection string
Each part is one thing you fill in, and each can fail on its own.
postgresql://[master-username]user: fix for "The username or password was not accepted.":[password]password: fix for "The username or password was not accepted."@[cluster-name].cluster-[random-id].[region].rds.amazonaws.comhost: fix for "We couldn't find that host. Check the host name, then try again.":5432port: fix for "The host refused the connection. Check the port, and that your database accepts connections from Infograph's address."/[db-name]database: fix for "That database does not exist on this server."?sslmode=requireSteps
Copy the Writer endpoint
In the RDS console, open your cluster and the Connectivity & security tab. Copy the Writer endpoint, not a Reader or custom one. The port is 5432.
Make it reachable from Infograph
The instance must be Publicly accessible. Then add an inbound rule to its VPC security group for the addresses below on port 5432. If the cluster must stay private, connect through an SSH server under Advanced instead.
51.222.152.247/32Create a read-only user
Infograph only reads. Give it its own user so you can see and revoke its access in one place. Run this as the user that owns your tables, with your own password and database name.
CREATE USER infograph WITH PASSWORD '[strong-password]'; GRANT CONNECT ON DATABASE [database] TO infograph; GRANT USAGE ON SCHEMA public TO infograph; GRANT SELECT ON ALL TABLES IN SCHEMA public TO infograph; ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO infograph;Write your connection string
Put the Writer endpoint, port and database together like this, with the user you created in place of the master username.
postgresql://[master-username]:[password]@[cluster-name].cluster-[random-id].[region].rds.amazonaws.com:5432/[db-name]?sslmode=requirePaste it in Infograph and choose your tables
Open Amazon Aurora PostgreSQL in Infograph, paste the string and press Connect. Pick the tables you want and Infograph starts loading them.
Allow 51.222.152.247 through your firewall so Infograph can connect.
Connect
Troubleshooting
Each entry is the message Infograph shows when a connection fails. Open it for the fix.
This host is not reachable from Infograph. Use your database's public address.
The address is private. RDS Proxy endpoints (they contain .proxy-) are reachable only inside your VPC. Use the Writer endpoint of a publicly accessible cluster, or connect through an SSH server under Advanced.
We couldn't find that host. Check the host name, then try again.
Copy the Writer endpoint again from the Connectivity & security tab. It contains .cluster- and ends in .rds.amazonaws.com.
The host refused the connection. Check the port, and that your database accepts connections from Infograph's address.
Check the port is 5432 and that the security group allows 51.222.152.247 on it. Use the Writer endpoint, since a custom endpoint may route to a reader.
The server closed the connection. Check that it allows Infograph's address, and whether it requires an encrypted connection.
The server answered, then hung up before Infograph could sign in. Check it allows 51.222.152.247: some hosts close the connection rather than refuse it. If the server accepts only encrypted connections, set SSL Mode to Require under Advanced.
The host did not answer in time. Check the host and port, and that your firewall allows Infograph's address.
Usually the security group. Add an inbound rule for 51.222.152.247 on port 5432 and check the instance is Publicly accessible. An Aurora Serverless v2 cluster that has paused can take about 15 seconds to wake, so try again.
The username or password was not accepted.
Use the database user's password, not an IAM authentication token (a long value containing X-Amz-Signature= that expires after 15 minutes). Characters such as @, # or / must be percent-encoded, so @ becomes %40.
Those credentials were not accepted.
Check the user and password. An express configuration cluster accepts only IAM tokens, which expire, so create a cluster with password login instead.
That database does not exist on this server.
The database name is the part after the last / in the string. Check its spelling and case, for example with \l in psql.
Through an SSH server
Infograph could not reach your SSH server. Check its address and port, and that it allows connections from Infograph's address.
Check the SSH server's public address and port, and that its firewall allows 51.222.152.247 on that port, usually 22.
Your SSH server only offers old encryption settings. Infograph needs a current OpenSSH with an Ed25519, ECDSA or RSA (SHA-2) host key.
Your SSH server only offers old encryption settings. Update OpenSSH on it. It needs an Ed25519, ECDSA or RSA (SHA-2) host key.
Your SSH server refused Infograph's key. Check the key is in authorized_keys for that user.
Add Infograph's public key, shown in the form when you turn on SSH, to ~/.ssh/authorized_keys for the SSH user you entered. Check that user exists and that the file is readable only by them.
Your SSH server's identity changed. If you expected this, trust the new server on the connection.
Infograph remembers your SSH server's key from the first connect, and the server now shows a different one. If you rebuilt or replaced the server, open the connection and press Trust the new server. If you did not, ask whoever runs the server before you trust it.
This connection has not trusted an SSH server yet. Open the connection and use Re-discover streams to trust it.
The connection has not checked your SSH server yet. Open the connection and press Re-discover streams. Infograph then remembers the server's key.
Your SSH server would not forward to the database host. Check the permitopen rule and the database host and port.
The SSH server would not pass the connection on to the database. In authorized_keys, the permitopen rule must name the database host and port exactly as you entered them. In sshd_config, AllowTcpForwarding must not be no. The database must also accept connections from the SSH server, for example in its firewall or security group.