Blog.

How to connect to databases within a VPC network

Cover Image for How to connect to databases within a VPC network
Slik Protect
Slik Protect

Connect within a VPC

Slik Protect supports backup and restoration for databases that sit within a Virtual Private Cloud (VPC). The Slik Protect infrastructure establishes a private and secure SSH tunnel to your database.

However, in order for Slik Protect to establish a secure connection, you need to —

  1. add the Slik Protect IP address to the allowlist, and
  2. provide the connection credentials (including the SSH keys) on the Slik Protect console.

We support VPC from all cloud providers, and have added steps for AWS and Digital Ocean. Other cloud providers also have similar steps. Please reach out to support@slikprotect.com if you face any troubles.

Configure VPC for AWS

Follow the steps below for your Amazon RDS database.

1. Add Slik Protect’s IP Address to the allowlist

To add Slik Protect’s IP address to the allowlist, first navigate to the RDS database instance on AWS. The RDS instance page would look something like —

RDS instance page on AWS.

RDS instance page on AWS.

  1. Go to the “Connectivity & Security” tab and select the configured VPC security group

Connectivity & Security tab for the AWS RDS instance

Connectivity & Security tab for the AWS RDS instance

  1. Go to “Edit inbound rules** in the selected security group

Inbound rules tab in security group

Inbound rules tab in security group

  1. Add the following IP address to the list of inbound rules.

Note: The connection type is SSH with port 22.

Add the Slik Protect IP address with connection type SSH

Add the Slik Protect IP address with connection type SSH

2. Get Amazon EC2 instance credentials

Go to the EC2 instance connected to the database above which will have a link similar to https://us-west-1.console.aws.amazon.com/ec2/v2/home?region=<region_name>#Instances:v=<instance_count>;instanceId=<instance_id>

  1. Get SSH server path

    Once you select the Instance, got to Networking and copy Public IPv4 address. This will be your SSH server path.

  2. Get SSH Key Pair

    Within the same detailed view, Go to Details > Instance Details > Key pair name. This will be the key pair used to establish SSH connection with your EC2 instance.

    Keep this key pair safe.

    If you wish to create another key pair for connection with Slik Protect, you will have to create a new user and generate new key pair for them. You can follow the guide here for detailed overview.

  3. Get SSH username

    Get username for your EC2 connection. Example, For Amazon EC2 instances, following are the default usernames.

    • For Amazon Linux 2 or the Amazon Linux AMI, the user name is ec2-user.
    • For a CentOS AMI, the user name is centos or ec2-user.
    • For a Debian AMI, the user name is admin.
    • For a Fedora AMI, the user name is fedora or ec2-user.
    • For a RHEL AMI, the user name is ec2-user or root.
    • For a SUSE AMI, the user name is ec2-user or root.
    • For an Ubuntu AMI, the user name is ubuntu.
    • For an Oracle AMI, the user name is ec2-user.
    • For a Bitnami AMI, the user name is bitnami.
    • Otherwise, check with the AMI provider.
  4. Get SSH port

    1. Default port for SSH connection is 22

Configure VPC for Digital Ocean

1. Add Slik Protect’s IP Address to the allowlist

  1. Go to “Networking” tab and under the “Firewalls” tab, select “Create Firewall”.

VPC_DO_1.jpg

  1. Under “Inbound Rules”, add the following IP address for Slik Protect to the list of inbound rules.

Note: The connection type is SSH with port 22 and Protocol TCP

Add the Slik Protect IP address with connection type SSH

Add the Slik Protect IP address with connection type SSH