I have 2 EC2 instances (application and bastion) and one RDS instance (database) in AWS. I want my RDS to only be accessible through the bastion (for when I as an admin want to manually change things in the database), and the application (where users can make changes to the database but only in accordance with the functionality provided by the application). For the EC2 instances, I want the bastion to be only accessible by me on my laptop (so only I can perform admin changes), and I want the application EC2 instance to be available to everyone on the internet (since its a public app). I've configured a few settings in AWS as follows, but I just wanted to confirm whether the assumptions below are correct, and whether they're enough to satisfy the requirements I've outlined above?
- I've placed the application EC2 instance in a public subnet - is this enough for making sure that anyone on the internet can (safely/securely) use the app?
- I've placed the bastion in a different public subnet, but it requires a public/private key pair (which only I have) to access - is this enough to keep it secure?
- Based on my RDS instance's availability zone, it seems to be in a subnet that when I check the route table, destination 0.0.0.0/0 has target set to iw-..... does this mean it's a public subnet, and if so is there a way to smoothly move it to a private subnet without losing connectivity to the application and bastion EC2 instances? I've also set public accessibility to no, so does that mean it can't be accessed publicly even if it's in a public subnet?