0
votes

I'm trying to connect to my aurora serverless but every time I try to do it I receive this error:

2021/03/18 17:10:00 error verifying database connection is alive: dial tcp 10.247.15.113:3306: connect: operation timed out exit status 1

I created a VPC, subnets and security groups.

  • VPC -> 10.247.0.0/20
  • 4 Subnets -> 10.247.0.0/22, 10.247.8.0/22, 10.247.4.0/22 and 10.247.12.0/22
  • Security group -> Lives inside my VPC and as inbound has port SSH 22 for 0.0.0.0/0 and MYSQL/Aurora 3306 for my EC2 instance IP address. Outbound has all traffic

Using ssh in a database client works but inside my code I receive the error I mentioned, I also tried doing telnet and I receive another operation timed out.

I know this may be something related to the networking but not sure why since I can connect via ssh with an EC2 instance. What can it be?

1
Can you clarify? You want to connect to the Aurrar serverless from home/work? Or from an ec2 instance? - Marcin
Please remove the go tag. - Hamza Anis
@Marcin I'm trying to connect from home and I followed this setup for the coding part: docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/… - user2737948

1 Answers

0
votes

Your guide is for RDS. It does not apply to Aurora Serverless (AS). Specifically AS can't be accessed from internet. So you can't connect to it directly from home:

You can't give an Aurora Serverless v1 DB cluster a public IP address. You can access an Aurora Serverless v1 DB cluster only from within a VPC.

You have to connect to it from within a VPC, e.g. EC2 instance, ECS container or a lambda function.

The only way to connect to it from home is to use RDS DataAPI, or setup ssh tunnel or VPN between your home network and your VPC.