AWS: Web application that needs to write to private RDS at runtime

Viewed 16

Hello I am making a Flask app in Python for school and need a database that is private and secure. I opted to use AWS and have set up a MySQL RDS that is not publicly accessible.

To reach it, my plan was to use an EC2 instance in the same VPC and then SSH tunnel within my app to the EC2 instance and then subsequently to the RDS. I have used secrets manager to store the credentials for the EC2 instance and RDS, but I am not sure what to do with my SSH private key?

I could've made the EC2 instance without it but this didn't seem to be standard practice. I need the key to tunnel but can't deploy it with the code or share it through internet communications (ie email, GitHub, etc).The EC2 and RDS are set up properly as I can connect via SSH tunnel through MySQL Workbench and was able to add a table. I just need the connection between my python app and the EC2 that does not risk others being able to get access to the data. What should I do?

0 Answers
Related