EC2 / Paginator / DescribeStaleSecurityGroups

DescribeStaleSecurityGroups#

class EC2.Paginator.DescribeStaleSecurityGroups#
paginator = client.get_paginator('describe_stale_security_groups')
paginate(**kwargs)#

Creates an iterator that will paginate through responses from EC2.Client.describe_stale_security_groups().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    DryRun=True|False,
    VpcId='string',
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters:
  • DryRun (boolean) – 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.

  • VpcId (string) –

    [REQUIRED]

    The ID of the VPC.

  • PaginationConfig (dict) –

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) –

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • PageSize (integer) –

      The size of each page.

    • StartingToken (string) –

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type:

dict

Returns:

Response Syntax

{
    'StaleSecurityGroupSet': [
        {
            'Description': 'string',
            'GroupId': 'string',
            'GroupName': 'string',
            'StaleIpPermissions': [
                {
                    'FromPort': 123,
                    'IpProtocol': 'string',
                    'IpRanges': [
                        'string',
                    ],
                    'PrefixListIds': [
                        'string',
                    ],
                    'ToPort': 123,
                    'UserIdGroupPairs': [
                        {
                            'Description': 'string',
                            'GroupId': 'string',
                            'GroupName': 'string',
                            'PeeringStatus': 'string',
                            'UserId': 'string',
                            'VpcId': 'string',
                            'VpcPeeringConnectionId': 'string'
                        },
                    ]
                },
            ],
            'StaleIpPermissionsEgress': [
                {
                    'FromPort': 123,
                    'IpProtocol': 'string',
                    'IpRanges': [
                        'string',
                    ],
                    'PrefixListIds': [
                        'string',
                    ],
                    'ToPort': 123,
                    'UserIdGroupPairs': [
                        {
                            'Description': 'string',
                            'GroupId': 'string',
                            'GroupName': 'string',
                            'PeeringStatus': 'string',
                            'UserId': 'string',
                            'VpcId': 'string',
                            'VpcPeeringConnectionId': 'string'
                        },
                    ]
                },
            ],
            'VpcId': 'string'
        },
    ]
}

Response Structure

  • (dict) –

    • StaleSecurityGroupSet (list) –

      Information about the stale security groups.

      • (dict) –

        Describes a stale security group (a security group that contains stale rules).

        • Description (string) –

          The description of the security group.

        • GroupId (string) –

          The ID of the security group.

        • GroupName (string) –

          The name of the security group.

        • StaleIpPermissions (list) –

          Information about the stale inbound rules in the security group.

          • (dict) –

            Describes a stale rule in a security group.

            • FromPort (integer) –

              If the protocol is TCP or UDP, this is the start of the port range. If the protocol is ICMP or ICMPv6, this is the ICMP type or -1 (all ICMP types).

            • IpProtocol (string) –

              The IP protocol name ( tcp, udp, icmp, icmpv6) or number (see Protocol Numbers).

            • IpRanges (list) –

              The IP ranges. Not applicable for stale security group rules.

              • (string) –

            • PrefixListIds (list) –

              The prefix list IDs. Not applicable for stale security group rules.

              • (string) –

            • ToPort (integer) –

              If the protocol is TCP or UDP, this is the end of the port range. If the protocol is ICMP or ICMPv6, this is the ICMP code or -1 (all ICMP codes).

            • UserIdGroupPairs (list) –

              The security group pairs. Returns the ID of the referenced security group and VPC, and the ID and status of the VPC peering connection.

              • (dict) –

                Describes a security group and Amazon Web Services account ID pair.

                • Description (string) –

                  A description for the security group rule that references this user ID group pair.

                  Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*

                • GroupId (string) –

                  The ID of the security group.

                • GroupName (string) –

                  [Default VPC] The name of the security group. For a security group in a nondefault VPC, use the security group ID.

                  For a referenced security group in another VPC, this value is not returned if the referenced security group is deleted.

                • PeeringStatus (string) –

                  The status of a VPC peering connection, if applicable.

                • UserId (string) –

                  The ID of an Amazon Web Services account.

                  For a referenced security group in another VPC, the account ID of the referenced security group is returned in the response. If the referenced security group is deleted, this value is not returned.

                • VpcId (string) –

                  The ID of the VPC for the referenced security group, if applicable.

                • VpcPeeringConnectionId (string) –

                  The ID of the VPC peering connection, if applicable.

        • StaleIpPermissionsEgress (list) –

          Information about the stale outbound rules in the security group.

          • (dict) –

            Describes a stale rule in a security group.

            • FromPort (integer) –

              If the protocol is TCP or UDP, this is the start of the port range. If the protocol is ICMP or ICMPv6, this is the ICMP type or -1 (all ICMP types).

            • IpProtocol (string) –

              The IP protocol name ( tcp, udp, icmp, icmpv6) or number (see Protocol Numbers).

            • IpRanges (list) –

              The IP ranges. Not applicable for stale security group rules.

              • (string) –

            • PrefixListIds (list) –

              The prefix list IDs. Not applicable for stale security group rules.

              • (string) –

            • ToPort (integer) –

              If the protocol is TCP or UDP, this is the end of the port range. If the protocol is ICMP or ICMPv6, this is the ICMP code or -1 (all ICMP codes).

            • UserIdGroupPairs (list) –

              The security group pairs. Returns the ID of the referenced security group and VPC, and the ID and status of the VPC peering connection.

              • (dict) –

                Describes a security group and Amazon Web Services account ID pair.

                • Description (string) –

                  A description for the security group rule that references this user ID group pair.

                  Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*

                • GroupId (string) –

                  The ID of the security group.

                • GroupName (string) –

                  [Default VPC] The name of the security group. For a security group in a nondefault VPC, use the security group ID.

                  For a referenced security group in another VPC, this value is not returned if the referenced security group is deleted.

                • PeeringStatus (string) –

                  The status of a VPC peering connection, if applicable.

                • UserId (string) –

                  The ID of an Amazon Web Services account.

                  For a referenced security group in another VPC, the account ID of the referenced security group is returned in the response. If the referenced security group is deleted, this value is not returned.

                • VpcId (string) –

                  The ID of the VPC for the referenced security group, if applicable.

                • VpcPeeringConnectionId (string) –

                  The ID of the VPC peering connection, if applicable.

        • VpcId (string) –

          The ID of the VPC for the security group.