DescribeSecurityGroups
Description
Returns information about security groups that you own.
Request Parameters
Name | Description | Required |
---|---|---|
| Name of the security group. Type: String Default: Describes all groups within the account. | No |
Response Elements
Name | Description |
---|---|
|
Type: |
Ancestor: None
Children: requestId
, securityGroupInfo
requestId
The ID of the request.
Type: xsd:string
Ancestor: DescribeSecurityGroupsResponseType
Children: None
securityGroupInfo
Security group set.
Type: SecurityGroupSetType
Ancestor: DescribeSecurityGroupsResponseType
Children: item
item
Information for a security group.
Type: SecurityGroupItemType
Ancestor: securityGroupInfo
Children: ownerId
, groupName
, groupDescription
, and ipPermissions
ownerId
AWS Access Key ID of the owner of the security group.
Type: xsd:string
Ancestor: item
Children: None
groupName
Name of the security group.
Type: xsd:string
Ancestor: item
Children: None
groupDescription
Description of the security group.
Type: xsd:string
Ancestor: item
Children: None
ipPermissions
Set of IP permissions associated with the security group.
Type: IpPermissionSetType
Ancestor: item
Children: item
item
Set of IP permissions.
Type: IpPermissionType
Ancestor: ipPermissions
Children: ipProtocol
, fromPort
, toPort
, groups
, and ipRanges
ipProtocol
IP protocol.
Type: xsd:string
Valid Values: tcp
| udp
| icmp
Ancestor: item
Children: None
fromPort
Start of port range for the TCP and UDP protocols, or an ICMP type number. An ICMP type number of -1 indicates a wildcard (i.e., any ICMP type number).
Type: xsd:int
Ancestor: item
Children: None
toPort
End of port range for the TCP and UDP protocols, or an ICMP code. An ICMP code of -1 indicates a wildcard (i.e., any ICMP code).
Type: xsd:int
Ancestor: item
Children: None
groups
List of security group and user ID pairs.
Type: UserIdGroupPairSetType
Ancestor: item
Children: item
item
Information for one security group.
Type: UserIdGroupPairType
Ancestor: groups
Children: userId
, groupName
userId
AWS User ID of an account. Cannot be used when specifying a CIDR IP address.
Type: xsd:string
Ancestor: item
Children: None
groupName
Name of the security group. Cannot be used when specifying a CIDR IP address.
Type: xsd:string
Ancestor: item
Children: None
ipRanges
IP ranges.
Type: IpRangeSetType
Ancestor: item
Children: item
item
Information for one IP range.
Type: IpRangeItemType
Ancestor: ipRanges
Children: cidrIp
cidrIp
CIDR range.
Type: xsd:string
Ancestor: item
Children: None
Examples
Example Request
This example returns information about two security groups that are configured for the account.
https://ec2.amazonaws.com/?Action=DescribeSecurityGroups&GroupName.1=WebServers&GroupName.2=RangedPortsBySource&AuthParams
Example Response
<DescribeSecurityGroupsResponse xmlns="http://ec2.amazonaws.com/doc/2009-10-31/"> <securityGroupInfo> <item> <ownerId>UYY3TLBUXIEON5NQVUUX6OMPWBZIQNFM</ownerId> <groupName>WebServers</groupName> <groupDescription>Web Servers</groupDescription> <ipPermissions> <item> <ipProtocol>tcp</ipProtocol> <fromPort>80</fromPort> <toPort>80</toPort> <groups/> <ipRanges> <item> <cidrIp>0.0.0.0/0</cidrIp> </item> </ipRanges> </item> </ipPermissions> </item> <item> <ownerId>UYY3TLBUXIEON5NQVUUX6OMPWBZIQNFM</ownerId> <groupName>RangedPortsBySource</groupName> <groupDescription>Group A</groupDescription> <ipPermissions> <item> <ipProtocol>tcp</ipProtocol> <fromPort>6000</fromPort> <toPort>7000</toPort> <groups/> <ipRanges/> </item> </ipPermissions> </item> </securityGroupInfo> </DescribeSecurityGroupsResponse>