Besides whatever firewall you run on an EC2 instance (which you REALLY NEED TO BE DOING!!), AWS puts a “security group” in front of it as well. This is a group of firewall rules that control what the outside world can reach on your server.
Editing security groups
- Go to AWS Console ⇒ EC2 ⇒ Instances
- Select the instance you want to edit
- In the “Security” tab, find the “Security Groups” option
- Click on the group. You should land on a page titled “Edit inbound rules.”
- Add inbound port forwards as needed:
- Select the connection type from the Type dropdown. If what you want isn’t there, select either “Custom UDP” or “Custom TCP.”
- Click Save