AWS Beanstalk Django не может подключиться к экземпляру RDS из-за неправильного частного IP, полученного с конечной точки RDS

Моя установка:

  1. AWS RDS MySQL Instance located in a custom VPC (Private Subnet)
  2. AWS Beanstalk Django app located in the same custom VPC (Public Subnet)
  3. Beanstalk EC2 Private IP: 10.0.2.37
  4. RDS Endpoint: stockpeektestdbcachekafka-trading-db.cxapiv8ipcaj.ap-southeast-1.rds.amazonaws.com
  5. RDS Private IP after using telnet to the RDS Endpoint inside Beanstalk EC2: 10.0.4.163

Проблема:

  1. I keep getting DB connection refused error with my Django app
  2. Looking closer at the error msg: it is because the RDS endpoint URL is resolved to the EC2 Private IP instead Error Image Link
  3. This is still happening although I have set DB HOST in settings.py to be the RDS Endpoint

Как исправить эту ошибку разрешения конечной точки? Спасибо!`

Вернуться на верх