AWS CLI EC2 Cheat Sheet/Describe security groups

List security groups and their rules.

Section: VPC, Subnets, and Security Groups

Describe security groups

bash
bash
aws ec2 describe-security-groups
Explanation

Use queries to narrow to specific ports or group IDs.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing VPC, Subnets, and Security Groups
Add inbound security group rule
Allow inbound TCP 443 from a CIDR block.
OpenIn sheetbashsame section
Remove inbound security group rule
Delete an inbound rule from a security group.
OpenIn sheetbashsame section
Describe VPCs
List VPCs in the account.
OpenIn sheetbashsame section
Describe subnets
List subnets and their attributes.
OpenIn sheetbashsame section
Tag EC2 resources
Apply tags to one or more EC2 resources.
OpenIn sheetbashsame section
Describe instances
List EC2 instances and their attributes.
OpenIn sheetbash2 tag match