AWS Beanstalk Django не может подключиться к экземпляру RDS из-за неправильного частного IP, полученного с конечной точки RDS
Моя установка:
- AWS RDS MySQL Instance located in a custom VPC (Private Subnet)
- AWS Beanstalk Django app located in the same custom VPC (Public Subnet)
- Beanstalk EC2 Private IP:
10.0.2.37
- RDS Endpoint:
stockpeektestdbcachekafka-trading-db.cxapiv8ipcaj.ap-southeast-1.rds.amazonaws.com
- RDS Private IP after using telnet to the RDS Endpoint inside Beanstalk EC2:
10.0.4.163
Проблема:
- I keep getting
DB connection refused
error with my Django app - Looking closer at the error msg: it is because the RDS endpoint URL is resolved to the EC2 Private IP instead Error Image Link
- This is still happening although I have set
DB HOST
insettings.py
to be the RDS Endpoint
Как исправить эту ошибку разрешения конечной точки? Спасибо!`