Skip to content

Conversation

fivetran-sahilkhirwal
Copy link
Contributor

Jira ticket

Closes https://fivetran.atlassian.net/browse/RD-978153

Description of Change

Adds example for connecting to source using the bastion server ( jump server )
The source is a postgreSQL database in this case

Testing

  • EC2 instance with all traffic allowed for inbound and outbound traffic ( bastion host )
  • EC2 instance with no Public IP, Inbound allowed only on port 22 and 5432 and for the bastion host IP
  • PostgreSQL running on private EC2
  • Data is fetched from the database using the Jump server using paramiko and sshtunnel using private key based authentication
Screenshot 2025-08-29 at 01 56 12 Screenshot 2025-08-29 at 01 58 16 Screenshot 2025-08-29 at 01 58 26 Screenshot 2025-08-29 at 01 59 17 Screenshot 2025-08-29 at 02 00 10

Checklist

Some tips and links to help validate your PR:

  • Tested the connector with fivetran debug command.
  • Added/Updated example specific README.md file, refer here for template.
  • Followed Python Coding Standards, refer here

Copy link

github-actions bot commented Aug 28, 2025

🧹 Python Code Quality Check

✅ No issues found in Python Files.

🔍 See how this check works

This comment is auto-updated with every commit.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new example connector that demonstrates how to connect to a private PostgreSQL database through an SSH tunnel using a bastion server. The example implements SSH key-based authentication and incremental data synchronization based on timestamp tracking.

Key changes:

  • Implements SSH tunneling with paramiko and sshtunnel libraries for secure database access
  • Provides incremental sync functionality using modified_at timestamp column
  • Includes comprehensive error handling for SSH and database connection issues

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
examples/common_patterns_for_connectors/bastion_server/requirements.txt Specifies required dependencies for SSH tunneling and PostgreSQL connectivity
examples/common_patterns_for_connectors/bastion_server/connector.py Main connector implementation with SSH tunnel setup and database operations
examples/common_patterns_for_connectors/bastion_server/configuration.json Template configuration file with placeholder values for connection parameters
examples/common_patterns_for_connectors/bastion_server/README.md Comprehensive documentation covering setup, configuration, and usage
README.md Updates main README to include reference to the new bastion server example

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@fivetran-dejantucakov fivetran-dejantucakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fivetran-sahilkhirwal Please see suggestions.

Copy link
Collaborator

@fivetran-satvikpatil fivetran-satvikpatil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added minor comments, rest looks good.

@fivetran-sahilkhirwal fivetran-sahilkhirwal requested review from varundhall and 5tran-alexil and removed request for varundhall September 2, 2025 18:53
Copy link
Contributor

@5tran-alexil 5tran-alexil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README LGTM

Copy link
Contributor

@fivetran-dejantucakov fivetran-dejantucakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fivetran-sahilkhirwal fivetran-sahilkhirwal merged commit e69132f into main Sep 8, 2025
3 checks passed
@fivetran-sahilkhirwal fivetran-sahilkhirwal deleted the sahil/bastian-server branch September 8, 2025 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants