EC2 Security Groups
A security group is a stateful virtual firewall associated with supported resources such as EC2 instances. Rules control allowed inbound and outbound traffic.
Why it matters
A running server should expose only the ports and sources required by the workload.
How it works
Define inbound rules → define outbound rules → attach security group → test from an allowed source → remove unnecessary rules.
Core Concept
Security groups act as stateful virtual firewalls.
Example: allow TCP 22 only from your trusted administration IP and TCP 8080 only when your application needs it.
What you should remember
Key idea
Security groups act as stateful virtual firewalls.
Key idea
Example: allow TCP 22 only from your trusted administration IP and TCP 8080 only when your application needs it.
Real-world example
Use a realistic cloud workload and focus on the responsibility of this AWS service.
Choose the service that matches the responsibility instead of forcing every workload into one resource.
Quick Test
1 QuestionWhat is an EC2 security group?