Security groups are essential for controlling traffic to and from your EC2 instances. In this session, we explored how to manage security groups, adjust inbound and outbound rules, and troubleshoot connectivity issues. This hands-on approach will help you secure your AWS infrastructure effectively.
sg-xxxxxxxx).Inbound rules define which traffic is allowed into the EC2 instance.
Example of default inbound rules:
| Type | Protocol | Port Range | Source | Purpose |
|---|---|---|---|---|
| SSH | TCP | 22 | 0.0.0.0/0 | Allows remote access |
| HTTP | TCP | 80 | 0.0.0.0/0 | Allows web traffic |
If port 80 (HTTP) is removed, accessing the website will timeout.
Troubleshooting tip: If you cannot connect to an EC2 instance and get a timeout, the issue is most likely a missing security group rule.