DocumentDB Setup Guide link
Updated November 16, 2023
Follow our setup guide to connect Amazon DocumentDB to Fivetran.
Prerequisiteslink
To connect your DocumentDB to Fivetran, you need:
- DocumentDB version 4.0 or higher
- Your database primary instance's IP (e.g.,
1.2.3.4
) or domain (your.server.com
) - Your database's port (usually
27017
) - An SSH server
NOTE: Fivetran can't connect to DocumentDB replica instances because DocumentDB does not support reading change streams from replica instances. We need change streams to perform incremental updates.
Setup instructionslink
Connect to DocumentDBlink
Connect using SSHlink
Fivetran connects to a separate server in your network that provides an SSH tunnel to your DocumentDB primary instance .
To connect using SSH, configure your firewall and/or other access control systems to allow incoming connections to your DocumentDB port (usually 27017
) from your SSH tunnel server's IP.
Before you proceed to the next step, you must follow our SSH connection instructions.
Connect using AWS PrivateLink Betalink
IMPORTANT: You must have a Business Critical plan to use AWS PrivateLink.
AWS PrivateLink allows VPCs and AWS-hosted or on-premises services to communicate with one another without exposing traffic to the public internet. PrivateLink is the most secure connection method. Learn more in AWS’ PrivateLink documentation.
Follow our AWS PrivateLink setup guide to configure PrivateLink for your database.
Create userlink
Create a database user for Fivetran using the DocumentDB Mongo shell.
Open the Mongo shell.
Connect to your primary node as an admin user.
Go to the
admin
database.Execute the following command to create a user for Fivetran. Replace
<username>
and<password>
with a username and password of your choice.use admin db.createUser({ user: "<username>", pwd: "<password>", roles: [ "readAnyDatabase" ] })
content_copy
Enable change streamslink
Fivetran uses change streams to perform incremental updates. You must explicitly enable change streams for all of the collections that you want Fivetran to sync.
Follow Amazon DocumentDB's Enabling Change Streams instructions to enable change streams.
Set change stream log retention durationlink
Set the change stream log retention duration so that it can retain at least 48 hours' worth of changes. We recommend increasing the size to retain seven days' worth of data.
Follow Amazon DocumentDB's Modifying the Change Stream Log Retention Duration instructions to adjust your change stream log retention duration.
Finish Fivetran configurationlink
In your connector setup form, enter a destination schema prefix. This prefix applies to each replicated schema and cannot be changed once your connector is created.
In the Host and ports field, enter the hostname and port number for your primary node. This should be a hostname or IP address that is appended by a colon and the port number (for example,
server.example.com:27017
or1.2.3.4:27017
).NOTE: Do not include any path contents after the top-level domain in this URL.
Enter the Fivetran-specific user that you created in Step 2.
Enter the password for the Fivetran-specific user that you created in Step 2.
Provide the following SSH tunnel information:
- SSH hostname (do not use a load balancer's IP address/hostname)
- SSH port
- SSH user
- If you want Fivetran to tunnel SSH over TLS, set the Require TLS through tunnel toggle to ON.
Select your Pack mode.
Click Save & Test. Fivetran tests and validates our connection to your DocumentDB primary instance. Upon successful completion of the setup tests, you can sync your data using Fivetran.
Setup testslink
Fivetran performs the following tests to ensure that we can connect to your DocumentDB primary instance and that it is properly configured:
- The Connecting to SSH Tunnel Test validates the SSH tunnel details you provided in the setup form. It then checks that we can connect to your database using the SSH Tunnel.
- The Connecting to Host Test validates the database credentials you provided in the setup form. It then verifies that the database host is not private and checks that we can connect to the host.
- The Validating Certificate Test generates a pop-up window where you must choose which certificate you want Fivetran to use. It then validates that certificate and checks that we can connect to your database using TLS.
- The Connecting to Database Test connects to your database instance and verifies that your database is at least version 4.0. It then checks that we can access the schemas in your database. Lastly, it verifies that change stream feature is enabled for at least one collection.
NOTE: The tests may take a few minutes to finish running.