Process Flow - Security group as virtual firewall
Create Security Group
Define Inbound Rules
Define Outbound Rules
Attach Security Group to Instance
Traffic Arrives at Instance
Check Inbound Rules
Allow Traffic
This flow shows how a security group is created, rules are set, attached to an instance, and then how incoming traffic is checked against rules to allow or block it.