Connect EC2 in private subnet to RDS mysql in another private subnet

0

Hello!! I am looking for guidance on connecting EC2 to mysql (RDS) - both in separate private subnets but in the same VPC My current setup is:

  • 1 public subnet w/ ALB and a bastion server.
  • 1 private subnet w/ EC2 instance running my web app
  • 1 private subnet w/ RDS running mysql What configuration(s) do I need to have EC2 connect to mysql? Also, is there any way to use phpmyadmin to access mysql in a private subnet? Thank you in advance!
Ash
질문됨 9달 전458회 조회
1개 답변
1

When setting up your private subnets. Ensure there is a local route for the cidr range for the subnets you wish to connect or for the whole VPC which is usual practice.

Your public subnets will have a different route than the private subnets because the default route 0.0.0.0/0 will have a different path. Other than that the VPC cidr range route is set as local and they can all route to each other.

You can use the DNS endpoint name of your RDS for your EC2 to connect to your RDS.

You will need to allow in the inbound rule the SQL port on the RDS security group the EC2 security group or CIDR as the source.

Not sure what you mean use phpadmin. Are you referring to a SQL tool like workbench? Where will this be hosted?

profile picture
전문가
답변함 9달 전
profile picture
전문가
검토됨 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠