Allow access to an RDS instance from DMS which is outside your AWS account.
USE CASE:
- If you are looking to allow AWS RDS access through DMS service which is outside your VPC or across different AWS accounts then this blog is going to help.
DESCRIPTION:
- We can use any of the DB instances. Here, we are going to use AWS RDS SQL Server (Amazon Relational Database Service) and SSMS client for testing purpose.
- Amazon RDS is a web service that makes it easier to set up, operate and scale a relatonal database in AWS cloud. It provides cost-efficient, resizable capacity for an industrial-standard relational database and manages common database administration tasks..
Create an RDS SQL Server or choose an existing instance,
after logging into AWS Management Console.
NOTE:
We connect to the RDS SQL Server from SSMS client.
STEP 2:
Modify the created RDS with the following:
- By default public accessibility will be ‘no’, change it to ‘yes’.
- Go to Networking section and click on VPC.
Make a note of IPv4 CIDR.
Go back to DB instances---> Connectivity &
security tab which is shown in the step-2 and choose VPC security groups.
Go to Inbound rules tab and choose edit inbound rules and make the following changes to the default one.
- Add
an Inbound rule, select MSSQL or All Traffic and choose My IP.
NOTE:
Here IP address differs from different network we connect with.
This is used for a successful connection of RDS SQL server from SSMS client.
- Add an Inbound rule, select MSSQL or All Traffic and give DMS replication instance’s public IP address (if this DMS is outside your VPC) in custom tab.
NOTE:
This is used to allow any user outside your VPC to connect to RDS from DMS.
Here, only those users are given access whose IP addresses are saved in Inbound rules.
STEP 6:
Go to Outbound rules tab, choose edit outbound rules
and repeat the same process as given in Step-5.
Connect to RDS SQL server from SSMS client as shown below.
- Go to RDS console and choose the database as in the step-1, make a note of end point and port number.
STEP 8:
- Open SSMS and Give the endpoint and port number separated by a comma at the Server Name.
- Choose authentication as ‘SQL Server Authentication’.
- Give ‘Login’ and ‘Password’ of RDS.
STEP 9:
Create a database in RDS SQL Server.
STEP 10:
Create a Source
endpoint for S3 in DMS which is outside your VPC (i.e., different AWS account)
and test the connection.
STEP 11:
Create a target endpoint for RDS SQL server from DMS which is outside your VPC and test the connection.
It requires the following:
- Service ‘ARN’, ‘port number’ of RDS which is shown in step-7.
- User credentials like ‘username’ and ‘password’ which we created at the time of RDS creation.
- ‘Database’ name which we created in step-8.
STEP 12:
Now, Create a DMS task by choosing source endpoint
from step-9 and target endpoint from step-10.Run the task and check the status
for ‘Load Complete’.
STEP 13:
Check if the data got replicated into RDS SQL Server
in the database as in step-9.
Comments
Post a Comment