How to Set up RDS PostgreSQL Destination in Daton
Last updated
Last updated
Before you get started, ensure you have the following:
Active Daton and AWS account
Administrative user for your AWS account to create or configure a Daton-specific RDS PostgreSQL database
Log in to your RDS dashboard.
On the VPC dashboard, choose Create VPC.
For Resources to create, choose VPC and more and perform the following.
Name the VPC.
Provide the details according to custom requirements and set the rest to default.
You can now visualize the relationships between the VPC resources you've configured.
When you are finished configuring your VPC, choose Create VPC.
Your VPC connection is set.
Navigate to the RDS in the Amazon Console.
Navigate to the Subnet groups section and click Create DB subnet group.
On the DB subnet creation page, perform the following:
Provide your Subnet group name and description.
Select the above-created VPC identifier.
Add Availability zones and Subnets, click Create When choosing the Subnets, please ensure to exclusively select the private subnets.
A Subnet group has been created.
In the Amazon RDS navigation pane, choose Databases.
Choose Create database and perform the following:
Select the Engine type as PostgreSQL and the Template as Free tier.
Provide a Name in the DB instance identifier, a Master username, and create a Master Password.
In the Instance configuration section, set Burstable classes to db.t3.micro. This can be configured as per your specific requirements.
In the Storage section, select the fields as per requirement. It is recommended to set the Storage Type to General Purpose SSD (gp2).
In the Connectivity section,
Select Don't connect to an EC2 compute resource
Select the above-created VPC and DB subnet groups
Set the Public access to No
Create a new VPC security group for firewall purposes, Name it, and Select an Availability Zone according to your preferences.
Check the Create an RDS Proxy checkbox.
Keep the rest as default or customize according to your requirements.
Select your Database Authentication method, Monitoring preferences, and Additional Configuration as per your requirements.
Now check your Estimated Monthly cost and click on Create Database. A new Database will be successfully created.
Please note that you can customize the database according to your specific requirements. To know more follow the link, Creating an Amazon RDS DB instance.
On the AWS Management Console, go to the Amazon EC2 console.
Choose EC2 Dashboard, and then choose Launch instance.
Provide a Name to the EC2 instance.
Under Application and OS Images (Amazon Machine Image), choose an AMI of your choice.
Select the t2.micro option under the Instance type.
For the Key pair (login), you have two options. If you already have a key pair, just pick its name. If you want a new key pair, click on Create new key pair. Then, follow the steps in the Create key pair window to make the new key pair.
For more information about creating a new key pair, see Create a key pair in the Amazon EC2 User Guide.
In the Network settings section, configure these values while leaving the rest at their default:
Select the previously created VPC.
Select one of its Public Subnets.
Set Auto-assign public IP to Enable.
Create a Firewall security group and Name it.
Now check the settings of the EC2 instance for configuration or keep them as default and click on Launch. A note saying the Instance is successfully launched will appear. This is how your EC2 instance would look like:
Here we edit the inbound subnet groups to connect the EC2 instance with the Database. This step creates a communication tunnel between the EC2 instance and the Database.
In the Amazon RDS dashboard, choose the above-created database instance and click on the VPC security groups URL under the Security section.
You will be redirected to the Security Groups page of the dedicated Database instance. Find the Edit inbound rules button and click on it.
On the edit page, perform the following:
Add rule. Under the Type dropdown, select PostgreSQL and select the source as the security groups corresponding to the EC2 instance.
Add another rule. Here, select the Port range as 3306 and add the IP address accordingly.
Launch a Database Management tool of your choice.
Create a new PostgreSQL Database connection.
In the connection settings:
Provide the Endpoint of the above-created Database Instance. You may find the endpoint in the following location:
Provide the Master Username and Password of the Database instance.
In the SSH tunneling section:
Insert the Public IPv4 DNS of the EC2 instance. You may find the Public IPv4 DNS of the EC2 instance in the following location:
Provide the Key Pair used while Launching the EC2 Instance. Remember that, this Key pair is supposedly a .pem file.
Test the SSH connection.
Save the Database by clicking on the Finish button. Your RDS PostgreSQL Database is successfully configured.
Note that, you can query in your now created database to create Schemas and Tables as per your requirement.
Log in to your Daton account and search for RDS PostgreSQL in the list of Destinations, then click Configure.
Enter the Integration Name and click Next:
Enter the following credentials to configure your warehouse:
RDS PostgreSQL JDBC URL in the format: jdbc:postgresql://AmazonRDSPostgreSQL_Database_Endpoint:3306/your_db_name
RDS PostgreSQL Master Username and Password
Set Use Tunnel to SSH and provide Proxy Host. Proxy Host is your Public IPv4 DNS that can be found in details of the EC2 instance in consideration.
Set the Proxy Port to 22 and the Proxy user to ec2-user(Default). You may also create a separate user in the EC2 instance.
Select the Schema of your choice.
Now Submit. Your warehouse is configured successfully.
Note:
You may copy the SSH Key that appears at the bottom of the Setup page and add it to you repository for secure Authentication.
You can query in your created database to create additional Schemas and Tables as per your requirement.