4

I know that you can set Security Group rules with ec2-authorize and ec2-revoke. How do you view the rules of a given security group?

2 Answers 2

2

All commands available within the Amazon EC2 API Tools are documented in the Amazon EC2 Command Line Reference - informational commands usually follow the ec2-describe-* pattern, and the one you are looking for is ec2-describe-group:

Returns information about security groups in your account. This includes both EC2 security groups and VPC security groups. For information about how the two types of groups differ, go to Security Groups in the Amazon Virtual Private Cloud User Guide.

1
  • hi Steffen, would you provide a full command-line example, including which environment variables to specify? Jul 20, 2012 at 20:16
1
~$ ec2-describe-group |grep GROUP

will show the list of all security groups

~$ ec2-describe-group |grep GROUP|cut -f4

to get only security groups names

~$ ec2-describe-group|grep <YOUR_GROUP_NAME>

to get the policies for that sec group

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .