write-for-the-community
write-for-the-community copied to clipboard
Set up Google Cloud Platform Postgres as a source in Airbyte
How can I connect to a GCP Postgres database as a Airbyte source?
- What set up steps do I need to take?
- What values do I use for the new Airbyte source configuration? (and where do I get them?)
I specifically need this information for these
- Airbyte Deployment locations
- Local Airbyte deployment
- GCP Compute Engine
- On Kubernetes
- Methods of authorizing to GCP Postgres
- Cloud SQL Auth proxy
- Self-managed SSL/TLS certificates
- Authorized networks
It would be great if https://github.com/airbytehq/airbyte/blob/master/docs/integrations/sources/postgres.md could be updated with this information
Stretch
For the tutorial to be most helpful for the widest audience, it would probably be best if the tutorial showed this information for all of the other places Airbyte can be deployed to
- Airbyte Cloud
- On AWS (EC2)
- On AWS ECS
- On Azure(VM)
- On Plural
- On Oracle Cloud Infrastructure VM
- On DigitalOcean (Droplet)
I ended up not being able to figure out how to do this locally.
⚠️ THIS DOES NOT WORK ⚠️
This was as far as I got but I couldn't figure out either the right host name or what I was doing wrong in the addition to docker-compose.yaml
- In your
airbyte
repository, open yourdocker-compose.yaml
file and add this at the bottom of theservices
top level sectionproxy: container_name: cloud-sql-proxy image: gcr.io/cloudsql-docker/gce-proxy:1.30.0 volumes: - ..\{{FULL_PATH_TO_SERVICE_ACCOUNT_JSON_FILE}}:/config ports: - 127.0.0.1:5436:5436 command: "/cloud_sql_proxy -instances={{INSTANCE_CONNECTION_NAME}}=tcp:5436 -credential_file=/config/{{SERVICE_ACCOUNT_JSON_FILE_NAME}}"
- Follow the instructions in the
Start Airbyte
section above - Once Airbyte loads, in the lefthand menu click
Sources
- Click
+ add new source
- Choose
Postgres
from the dropdown menu - Host: :question:
- Port:
5436
- Fill in other fields
- Replication Method:
Standard
- SSH Tunnel Method:
No Tunnel
- Click
Set up source
- Choose
⚠️ This also did not work ⚠️ Run the Cloud SQL Auth proxy in a Docker container (per https://cloud.google.com/sql/docs/postgres/connect-admin-proxy#connecting-docker) as I couldn't figure out
- Which Airbyte Docker container needed to connect to the Proxy Docker container
- How to connect them
I did get the combo of GCP Compute Engine
and Cloud SQL Auth Proxy
working and have submitted a PR to update https://docs.airbyte.com/deploying-airbyte/on-gcp-compute-engine for that use case: https://github.com/airbytehq/airbyte/pull/12086