I have the following setup on Amazon AWS:
- An Auto-Scaling Group
- An ELB
- An RDS database
- Everything is in the default VPC
The only thing about this setup that I don't quite understand yet relates to the security rules.
For the RDS instance, I want to:
- allow port
3306
access only from the EC2 instances that are launched by the Auto-Scaling Group, - allow the same port
3306
access from my own IP.
I already have a SG set up for the latter that is working fine. However, I'm not sure how to go about the first point.
Various resources mention simply attaching the same SG the EC2 instances use to the RDS instance. But if, for example, the EC2 SG allows port 80
traffic for everyone, and if I use that same SG for the RDS instance, wouldn't that grant everyone port 80
access to the RDS instance as well?
So the question is: how do I create a SG that only allows the EC2 instances in the Auto-Scaling group access to the RDS' port 3306
, and not everybody else?
Lastly, how do I create a SG for the EC2 instances that will only allow the ELB access?
I'd greatly prefer to use the AWS web UI for this. Thank you!