A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html below:

DescribeSecurityGroups - Amazon Elastic Compute Cloud

DescribeSecurityGroups

Describes the specified security groups or all of your security groups.

Request Parameters

The following parameters are for this specific action. For more information about required and optional parameters that are common to all actions, see Common Query Parameters.

DryRun

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Type: Boolean

Required: No

Filter.N

The filters. If using multiple filters for rules, the results include security groups for which any combination of rules - not necessarily a single rule - match all filters.

Type: Array of Filter objects

Required: No

GroupId.N

The IDs of the security groups. Required for security groups in a nondefault VPC.

Default: Describes all of your security groups.

Type: Array of strings

Required: No

GroupName.N

[Default VPC] The names of the security groups. You can specify either the security group name or the security group ID.

Default: Describes all of your security groups.

Type: Array of strings

Required: No

MaxResults

The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. This value can be between 5 and 1000. If this parameter is not specified, then all items are returned. For more information, see Pagination.

Type: Integer

Valid Range: Minimum value of 5. Maximum value of 1000.

Required: No

NextToken

The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.

Type: String

Required: No

Response Elements

The following elements are returned by the service.

nextToken

The token to include in another request to get the next page of items. This value is null when there are no more items to return.

Type: String

requestId

The ID of the request.

Type: String

securityGroupInfo

Information about the security groups.

Type: Array of SecurityGroup objects

Errors

For information about the errors that are common to all actions, see Common client error codes.

Examples Example 1

This example describes the specified security group. The response indicates that this security group references another security group. The referenced group can be in a different VPC if used through a VPC peering connection. If the referenced security group or the VPC peering connection is deleted, the rule becomes stale but is not automatically removed from the security group.

Sample Request
https://ec2.amazonaws.com/?Action=DescribeSecurityGroups
&GroupId.1=sg-1a2b3c4d
&AUTHPARAMS
Sample Response
<DescribeSecurityGroupsResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/">
    <requestId>edb7c570-be05-4192-bd1b-example</requestId>
    <securityGroupInfo>
        <item>
            <ownerId>123456789012</ownerId>
            <groupId>sg-1a2b3c4d</groupId>
            <groupName>MySecurityGroup</groupName>
            <groupDescription>MySecurityGroup</groupDescription>
            <vpcId>vpc-81326ae4</vpcId>
            <ipPermissions>
                <item>
                    <ipProtocol>tcp</ipProtocol>
                    <fromPort>22</fromPort>
                    <toPort>22</toPort>
                    <groups/>
                    <ipRanges>
                        <item>
                            <cidrIp>0.0.0.0/0</cidrIp>
                        </item>
                    </ipRanges>
                    <prefixListIds/>
                </item>
                <item>
                    <ipProtocol>icmp</ipProtocol>
                    <fromPort>-1</fromPort>
                    <toPort>-1</toPort>
                    <groups>
                        <item>
                            <securityGroupRuleId>sgr-abcdefghi01234560</securityGroupRuleId>
                            <userId>111222333444</userId>
                            <groupId>sg-11aa22bb</groupId>
                            <vpcId>vpc-dd326ab8</vpcId>
                            <vpcPeeringConnectionId>pcx-11223344</vpcPeeringConnectionId>
                            <peeringStatus>active</peeringStatus>
                        </item>
                    </groups>
                    <ipRanges/>
                    <prefixListIds/>
                </item>
            </ipPermissions>
            <ipPermissionsEgress>
                <item>
                    <ipProtocol>-1</ipProtocol>
                    <groups/>
                    <ipRanges>
                        <item>
                            <cidrIp>0.0.0.0/0</cidrIp>
                        </item>
                    </ipRanges>
                    <prefixListIds/>
                </item>
            </ipPermissionsEgress>
        </item>
    </securityGroupInfo>
</DescribeSecurityGroupsResponse>
Example 2

This example describes all security groups that grant access over port 22 and that grant access from instances associated with app_server_group or database_group.

Sample Request
https://ec2.amazonaws.com/?Action=DescribeSecurityGroups
&Filter.1.Name=ip-permission.protocol
&Filter.1.Value.1=tcp
&Filter.2.Name=ip-permission.from-port
&Filter.2.Value.1=22
&Filter.3.Name=ip-permission.to-port
&Filter.3.Value.1=22
&Filter.4.Name=ip-permission.group-name
&Filter.4.Value.1=app_server_group
&Filter.4.Value.2=database_group
&AUTHPARAMS
Example 3

This example describes the specified security group. The security group has a rule that allows all outbound IPv6 traffic (this rule is added by default for security groups in an IPv6-enabled VPC) and a rule that allows inbound access over SSH for IPv6 traffic.

Sample Request
https://ec2.amazonaws.com/?Action=DescribeSecurityGroups
&GroupId.1=sg-9bf6ceff
&AUTHPARAMS    
Sample Response
<DescribeSecurityGroupsResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/">
    <requestId>1d62eae0-acdd-481d-88c9-example</requestId>
    <securityGroupInfo>
        <item>
            <ownerId>123456789012</ownerId>
            <groupId>sg-9bf6ceff</groupId>
            <groupName>SSHAccess</groupName>
            <groupDescription>Security group for SSH access</groupDescription>
            <vpcId>vpc-31896b55</vpcId>
            <ipPermissions>
                <item>
                    <ipProtocol>tcp</ipProtocol>
                    <fromPort>22</fromPort>
                    <toPort>22</toPort>
                    <groups/>
                    <ipRanges>
                        <item>
                            <cidrIp>0.0.0.0/0</cidrIp>
                        </item>
                    </ipRanges>
                    <ipv6Ranges>
                        <item>
                            <cidrIpv6>::/0</cidrIpv6>
                        </item>
                    </ipv6Ranges>
                    <prefixListIds/>
                </item>
            </ipPermissions>
            <ipPermissionsEgress>
                <item>
                    <ipProtocol>-1</ipProtocol>
                    <groups/>
                    <ipRanges>
                        <item>
                            <cidrIp>0.0.0.0/0</cidrIp>
                        </item>
                    </ipRanges>
                    <ipv6Ranges>
                        <item>
                            <cidrIpv6>::/0</cidrIpv6>
                        </item>
                    </ipv6Ranges>
                    <prefixListIds/>
                </item>
            </ipPermissionsEgress>
        </item>
    </securityGroupInfo>
</DescribeSecurityGroupsResponse>
Example 4

This example describes the specified security group. For the ingress rule that permits RDP traffic from IPv4 address range 203.0.113.0/24, there is a rule description.

Sample Request
https://ec2.amazonaws.com/?Action=DescribeSecurityGroups
&GroupId.1=sg-bcc24bcd
&AUTHPARAMS
Sample Response
<DescribeSecurityGroupsResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/">
<requestId>6b0c76fb-0da6-4357-bb60-1fexample</requestId>
    <securityGroupInfo>
        <item>
            <ownerId>123456789012</ownerId>
            <groupId>sg-bcc24bcd</groupId>
            <groupName>default</groupName>
            <groupDescription>default VPC security group</groupDescription>
            <vpcId>vpc-a33cbfda</vpcId>
            <ipPermissions>
                <item>
                    <ipProtocol>-1</ipProtocol>
                    <groups>
                        <item>
                            <userId>123456789012</userId>
                            <groupId>sg-bcc24bcd</groupId>
                        </item>
                    </groups>
                    <ipRanges/>
                    <ipv6Ranges/>
                    <prefixListIds/>
                </item>
                <item>
                    <ipProtocol>tcp</ipProtocol>
                    <fromPort>3389</fromPort>
                    <toPort>3389</toPort>
                    <groups/>
                    <ipRanges>
                        <item>
                            <cidrIp>203.0.113.0/24</cidrIp>
                            <description>RDP access from B network</description>
                        </item>
                    </ipRanges>
                    <ipv6Ranges/>
                    <prefixListIds/>
                </item>
            </ipPermissions>
            <ipPermissionsEgress>
                <item>
                    <ipProtocol>-1</ipProtocol>
                    <groups/>
                    <ipRanges>
                        <item>
                            <cidrIp>0.0.0.0/0</cidrIp>
                        </item>
                    </ipRanges>
                    <ipv6Ranges/>
                    <prefixListIds/>
                </item>
            </ipPermissionsEgress>
        </item>
    </securityGroupInfo>
</DescribeSecurityGroupsResponse>
See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4