Interview Prep/Networking/NAT, Firewalls & VPN

Can a security group reference another security group, and why is that useful?

IntermediateConceptNAT, Firewalls & VPN
Answer

Yes. A rule's source can be another security group ID, meaning "any ENI that has that group attached". Instances can scale and change IPs without rule edits.

aws ec2 authorize-security-group-ingress --group-id sg-db --protocol tcp --port 5432 --source-group sg-app

That one rule says "only the app tier may reach Postgres", which is the standard three-tier pattern.

All Networking questions Roadmap: Networking for DevOps

More on NAT, Firewalls & VPN