AWS Aurora Postgres
Create a connection between Faraday and AWS Aurora Postgres so that your data is always up to date to make predictions, and your predictions can seamlessly sync back to your database.
In this tutorial, we'll show you how to:
- Connect your AWS Aurora Postgres account to Faraday using a connection.
Let's dive in.
- You'll need a Faraday account — signup is free!
Prerequisites
You'll need the following details to create your connection to AWS Aurora Postgres:
- Host requiredtext
- Schema requiredtext
- Port requiredinteger
- Load balancer DNS name optionaltextIn case the host is deployed behind a load balancer.
- User requiredtext
- SSH bastion optionaltextIn case the host is deployed behind an SSH bastion / jump server. Uses the Faraday SSH public key. This is the address of the bastion including username. For example, faraday@mybastion.example.com
- Password requiredtext
- Database requiredtext
Granting access
First, you'll need Faraday access to your AWS Aurora Postgres account.
Amazon Aurora is a serverless database providing a MySQL or Postgres compatibility layer. Postgres connections are host-based and require a user and password. We suggest that you create a Faraday-only schema to both send and receive data. Within this schema, Faraday would have full read and write access. Alternatively, you can give Faraday access to certain tables in a shared schema.
Example commands:
CREATE USER faraday_user WITH PASSWORD '***'
CREATE SCHEMA faraday_schema
ALTER DEFAULT PRIVILEGES IN SCHEMA faraday_schema GRANT ALL ON TABLES TO faraday_user
GRANT USAGE, CREATE ON SCHEMA faraday_schema TO faraday_user
This connection type can be placed behind an SSH bastion (aka jump server). In that case, specify the user and host of the SSH bastion.
This connection type can also be placed behind a load balancer. In that case, specify the host of the load balancer. Faraday suggests that you use an unguessable string somewhere in the path to your data. This avoids what is called the Confused deputy problem
For example, let's say you were using S3. Instead of naming an S3 bucket s3://faraday-acme/
,
name it s3://faraday-acme-pwiiprz162ez
. This guarantees that
malicious actors cannot guess the name and request that Faraday import data
from it into their account. The same logic applies to any path that is used to
locate data.
Please allowlist these official Faraday IP addresses:
- 34.86.175.54
- 34.86.252.230
- 34.145.239.81
- 35.245.199.181
- 52.22.91.248
- 52.23.137.21
- 52.204.223.208
- 52.204.228.32
- 52.204.230.227
Connecting
Use a POST /connections
request:
curl https://api.faraday.ai/connections --json '{ "name": "AWS Aurora Postgres", "options": { "type": "aws-aurora-postgres", "host": "...", "schema": "...", "user": "...", "password": "...", "database": "..." } }'
- Wait briefly while Faraday establishes your connection. It shouldn't take long.
Your new connection is now ready to use.