DescribeSecurityGroups#

Description#

Lists all existing filters for security groups and their descriptions. One or more filters can be applied.

Request Parameters#

  • Filter.N — One or more filters.

    • Type: List of Filter objects

    • Required: No

  • GroupId.N — IDs of security groups.

    • Type: Array of strings

    • Required: No

  • GroupName.N — Names of security groups.

    • Type: Array of strings

    • Required: No

Supported Filters#

  • description — The description of the security group.

  • group-id — The ID of the security group.

  • group-name — The name of the security group.

  • ip-permission.cidr — The IPv4 CIDR of the network that is granted access to the security group .

  • ip-permission.from-port — The start of port range for the TCP and UDP protocols, or an ICMP code.

  • ip-permission.group-id — The ID of a security group for which access is granted.

  • ip-permission.protocol — IP protocol name or number (see Protocol Numbers).

  • ip-permission.to-port — The end of port range for the TCP and UDP protocols, or an ICMP code.

  • owner-id — The ID of the project.

  • tag-key — The tag key. Such a filter allows you to get resources with the specified key and any value.

  • tag:<tag-key> — The key/value a pair of a tag. The tag key is passed in the filter name, while the tag value is used as the filter value.

  • vpc-id — The ID of the VPC in which the security group is created.

Response Elements#

  • requestId — The request ID.

    • Type: String

  • securityGroupInfo — Information about security groups.

Examples#

c2-ec2 DescribeSecurityGroups Filter.1.Name ip-permission.from-port Filter.1.Value.1 555 Filter.1.Value.2 666

c2-ec2 DescribeSecurityGroups Filter.1.Name ip-permission.protocol Filter.1.Value.1 tcp

c2-ec2 DescribeSecurityGroups Filter.1.Name ip-permission.protocol Filter.1.Value.1 17

c2-ec2 DescribeSecurityGroups Filter.1.Name owner-id Filter.1.Value.1 <project_name>

c2-ec2 DescribeSecurityGroups Filter.1.Name tag:<tag-key> Filter.1.Value <tag-value>

c2-ec2 DescribeSecurityGroups Filter.1.Name tag-key Filter.1.Value <tag-key>