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) --

              The start of the port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.

            • IpProtocol (string) --

              The IP protocol name (for tcp , udp , and icmp ) 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) --

              The end of the port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.

            • 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.

                Note

                We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide .

                • 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) --

                  The name of the security group. In a request, use this parameter for a security group in EC2-Classic or a default VPC only. 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.

                  [EC2-Classic] Required when adding or removing rules that reference a security group in another Amazon Web Services account.

                • 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) --

              The start of the port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.

            • IpProtocol (string) --

              The IP protocol name (for tcp , udp , and icmp ) 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) --

              The end of the port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.

            • 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.

                Note

                We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide .

                • 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) --

                  The name of the security group. In a request, use this parameter for a security group in EC2-Classic or a default VPC only. 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.

                  [EC2-Classic] Required when adding or removing rules that reference a security group in another Amazon Web Services account.

                • 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.