AWS DMS issue with source endpoint in EC2-classic - amazon-web-services

We are using several EC2-Classic servers (Linux Ubuntu) with following configuration: mounted EBS volumes and on them is running Server version: 5.5.48-MariaDB
I would like to use AWS DMS (AWS Database Migration Service) and to migrate our EBS DBs to the RDS AuroraDB in new VPC.
I created VPC, AuroraDB (not public accessible), AWS DMS replication instance and endpoints.
From EC2-classic instance I am able to open remote AuroraDB console (thanks to Classic Link), which is in the VPC.
Target endpoint (to the AuroraDB) works OK and TEST was finished successful
Source Endpoint show me following error:
Operation:testEndpointDetails:[errType=ERROR_RESPONSE,
status=122502, errMessage=Cannot connect to ODBC provider 122502 ODBC general error.,
errDetails= RetCode: SQL_ERROR SqlState: HY000 NativeError: 2003 Message: unixODBCMySQL http://ODBC 5.3(w)
DriverCan't connect to MySQL server on 'Private.DNS.name' (110) http://122502] ODBC general error.
I tried to set like Server name
Private/Public DNS, and Private/Public IP, still same.
Credentials are OK, and I am not using any special characters.
I am operate in North Virginia Region.
AWS DMS replication instance is set as Public.
I am able to log into MariaDB console from remote EC2-classic instance.
I tried set port 3306 and Private/Public IP of AWS DMS replication instance into right Security Groups, but I guess that I still miss something, probably in the SG area, but I am not sure.

I had the same issue with the same error message and it was a network issue. My replication instance didn't have access to the database.
My database is in a VPC with a subnet x and my replication instance is in the same VPC with the same subnet x. I opened the 3306 port in my Network ACL and in the security group of the database to the Internet (0.0.0.0/0) just to test if it was a network problem. The connection test worked with those settings. After the test, I removed the last setting for security.
The solution to my problem was to open the 3306 port in the security group and in the network ACL of the database to all the vpc connection. e.g. 172.0.0.0/16.
Hope it helps

You must add the security group from your DMS replication instance to your RDS database associated security group as an authorised inbound traffic.
Go to Database Migration Service dashboard and them to "Replication Instances"
Select your replication instance to get the "VPC Security Group"

Related

Can't connect to server on AWS RDS

ı try conncet my sql database on amazon aws
mysql -h database-2.csgofm1hhtui.eu-central-1.rds.amazonaws.com -P 3306 -u ismail -p
But i recieve this exception
ERROR 2002 (HY000): Can't connect to server on 'database-2.csgofm1hhtui.eu-central-1.rds.amazonaws.com' (10060)
Maybe a stupid question, but have you opened inbound Security Group rules?
This error is a result of the inbound connection rule set on your DB instance.
In AWS RDS console, under 'Databases', click on the 'DB Identifier' of your RDS instance. Then in the 'Security group rules' section, click on 'Inbound' type security group and edit the inbound rule to allow appropriate inbound connections.
IF you are trying to connect from an EC2 instance, then the Inbound connection can be the security group of your EC2 instance on port 3306.
See point 4 in the following link :
Create a VPC security group for a private DB instance
If its not Security Group, then it could be a route table issue.
AWS Knowledge Center - How do I resolve problems when connecting to my Amazon RDS DB instance?

Redshift ODBC Driver test fails: Is the server running on host and accepting TCP/IP connections on port 5439?

I have installed the 64x Amazon Redshift ODBC driver on my Windows 10 and it shows up under System DSN tab of ODBC Data Source Administrator (64-bit). I click on Configure and as I enter the connection information from my Amazon Redshift cluster properties, I face the following error:
Here are the current Network Security settings of the cluster. The only thing I have changed is that I have made it Publicly accessible (the value changed from No to Yes). But I haven't changed anything in VPC and VPC security group. As far as I see, all Inbound and Outbound traffic is allowed.
Anything I might have missed?
Should I add a firewall rule to my local machine for this port as well?
UPDATE:
Inbound rules for the VPC Group
Outbound rules for the VPC Group
If you check your security group (SG), you can notice that the source in the inbound rule is sg-9054xxxx. This means that all internet traffic is blocked.
You can only connect to your redshift from EC2 instance having same SG.
Alternatively, you can modify the source of the inbound rule in the SG to be your home/work ip address/range, or any IP address (not recommended).
Other option is to setup a bastion instance in a public subnet with ssh connectivity. Then you can setup ssh tunnel between between your windows and redshift using the bastion. Similar for VPN connection.
To query redshift you may also use its data api. This does not require establishing a regular connection to the cluster.

Unable to ping Private IP of DMS Replication Instance from on-premises over Site-to-Site VPN & DMS source DB endpoint test connection fails

What am I trying to do?
I want to migrate and automatically replicate data from SQL Server in my on-premises Windows Server to DB in AWS Cloud. I am using AWS DMS (Database Migration Service) for this.
What have I done/tried already?
I have set up a site-to-site VPN (between on-premises network and AWS VPC)
I am able to ping EC2 instance in VPN from Windows Server on-premises
I am able to ping Windows Server on-premises from EC2 instance in VPN
I have created a DMS Replication Instance. Its Private IP is within the allowed VPC CIDR of the VPN connection set already
I am able to ping the Private IP of DMS Replication Instance from EC2 instance
However, I am NOT able to ping the Private IP of DMS Replication Instance from Windows Server on-premises
I have set-up a DB Server in my on-premises Windows Server. I added this DB as a DMS source endpoint. When I tried to test the connection, it failed with the following error message:
I have linked a Security Group to the DMS Replication Instance. This is the same Security Group I used in the VPN connection set up
My DMS source DB endpoint configuration is as follows:
What do I want to know?
Why am I not able to ping the private IP of DMS Replication Instance while I am able to ping an EC2 instance by setting up VPN
Why the DMS endpoint test connection is failing?
Could you help me in doing this DB migration please?
Probably the following debugging method would help you.
As you have mentioned that you are able to ping the EC2 instance private IP from your on-premise network, it was clear that Site-Site VPN is successful.
You did not mention that you created the DMS instance in the same subnet as the other windows instance which you are able to ping from your on-premise network. If you are created DMS in a different subnet please make sure the route table associated with that subnet has route propagation enabled . Then please check in the security groups that in the inbound rules you are allowing the port numbers and IP addresses. This way we can make sure all the things are setup proper in AWS.
From your on-premise sites please make a telnet test with the following command.
Windows/Linux:
Open command prompt in windows or terminal in linux and try
telnet <<DMS IP>> <<Port Number>>
If it is successful connected then you have connectivity between on-premise to DMS host.
If it is not successfully connected or timed out then you need to contact your on-premise network manager or who is in-charge and tell them that you have an issue connecting with AWS Subnet x.x.x.x/x CIDR from on-premise network

connecting to private aws rds

I'm new and trying to explore AWS and creating a test app running on IIS (EC2 set in Public) and MSSQL RDS(set in Private). However my IIS is not able to connect on the RDS. Looking on my IIS EC2 it has a defined private IP too, same subnet used also from RDS, security group of RDS allows the subnet of the EC2, IAM of EC2 also has RDS Full access.
But still my ec2 wont connect on the RDS. May I ask on what I'm missing on my settings?
It appears that your configuration is:
One VPC
A Public Subnet containing an Amazon EC2 instance
A Private Subnet containing an Amazon RDS for SQL Server instance
You are attempting to connect from the EC2 instance to the RDS db instance
For this to work, you should configure:
A Security Group (let's call it EC2-SG) that is associated with the EC2 instance, permitting connections such that you can login to the EC2 instance
A Security Group (RDS-SG) associated with the RDS db instance, with an incoming connection configured for SQL Server (port 1433) with source set to EC2-SG
That is, the database security group should ALLOW an incoming connection with a source of the security group that is associated to the EC2 instance. The VPC will automatically figure out the IP addresses — you do not need to specify them.
Then, connect from the EC2 instance to the RDS db instance via the DNS Name of the RDS instance that is given in the RDS console.

How to configure security group on AWS

Ok, I have an application on ElasticBeanstalk and have setup an EC2 server for my database.
I've been trying to limit the connections to the database to my IP and that of the applications (EB), however all configurations I have tried have not worked.
I have tried using the security group ID - where on the security group ID used by the App had a outgoing connection to the DB and the DB security group had an incoming connection from the security group ID from the App.
Unfortunately that didn't work. And I don't know how to find the CIDR for the EB environment.
Any ideas?
Add the security group on ec2 server to allow the traffic from your home IP and elasticbeanstalk appliaction static IP.
you can find the Elasticbeanstalk application static IP from Ec2 console Or you can use the following command using amazon cli.
aws ec2 describe-instances --instance-ids <instance-id>
I created a windows machine on AWS EC2, and I wanted that only I should be able to connect from my MAC to it, using remote desktop client.
Inbound Rule is used for incoming traffic and outbound rule is used for outgoing traffic.
Since I wanted to connect using Remote Desktop, in the inbound rule of security group I selected "RDP" and then in the source I selected 'My Ip' and thus I secured my ec2 instance such that only I can access it