본문 바로가기
IT일반

AWS RDS 외부접속 안될때

by xavi2019 2022. 11. 14.

상황

  • 퍼블릭 액세스도 가능하게 하고 보안그룹의 인바운드 규칙도 제대로 설정했는데 안되는 경우.
  • EC2에서는 연결이 되는 경우..

 

해결방법

  • 라우팅 테이블을 손봐주면 됨

AWS의 해결책을 잘 보면 됨

https://aws.amazon.com/ko/premiumsupport/knowledge-center/rds-connectivity-instance-subnet-vpc/

 

https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Internet_Gateway.html#Add_IGW_Attach_Gateway

 

Connect to the internet using an internet gateway - Amazon Virtual Private Cloud

If you assigned a public IPv4 address to your instance during launch, then your instance is reachable from the internet, and you do not need to assign it an Elastic IP address. For more information about IP addressing for your instance, see IP addressing.

docs.aws.amazon.com

 

라우팅 테이블로 이동

https://ap-northeast-2.console.aws.amazon.com/vpc/home?region=ap-northeast-2#RouteTables: 

첫번째 라우팅 테이블이 외부로 가는 것으로 보임. 클릭하고 들어가면 0.0.0.0/0 이 있음 

그러나 명시적 서브넷 연결란이 - 로 한개도 없음

서브넷 연결 탭을 누르고 편집을 눌러서, 프라이빗 서브넷을 추가해주면 됨

댓글