Amazon Elastic Compute Cloud

2016/05/12 - Amazon Elastic Compute Cloud - 2 new api methods

Changes  Update ec2 client to latest version

DescribeStaleSecurityGroups (new) Link ¶

[EC2-VPC only] Describes the stale security group rules for security groups in a specified VPC. Rules are stale when they reference a deleted security group in a peer VPC, or a security group in a peer VPC for which the VPC peering connection has been deleted.

Request Syntax

client.describe_stale_security_groups(
    DryRun=True|False,
    VpcId='string',
    MaxResults=123,
    NextToken='string'
)
type DryRun:

boolean

param DryRun:

Checks whether you have the required permissions for the operation, 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 VpcId:

string

param VpcId:

[REQUIRED]

The ID of the VPC.

type MaxResults:

integer

param MaxResults:

The maximum number of items to return for this request. The request returns a token that you can specify in a subsequent call to get the next set of results.

type NextToken:

string

param NextToken:

The token for the next set of items to return. (You received this token from a prior call.)

rtype:

dict

returns:

Response Syntax

{
    'StaleSecurityGroupSet': [
        {
            'GroupId': 'string',
            'GroupName': 'string',
            'Description': 'string',
            'VpcId': 'string',
            'StaleIpPermissions': [
                {
                    'FromPort': 123,
                    'IpProtocol': 'string',
                    'IpRanges': [
                        'string',
                    ],
                    'PrefixListIds': [
                        'string',
                    ],
                    'ToPort': 123,
                    'UserIdGroupPairs': [
                        {
                            'UserId': 'string',
                            'GroupName': 'string',
                            'GroupId': 'string',
                            'VpcId': 'string',
                            'VpcPeeringConnectionId': 'string',
                            'PeeringStatus': 'string'
                        },
                    ]
                },
            ],
            'StaleIpPermissionsEgress': [
                {
                    'FromPort': 123,
                    'IpProtocol': 'string',
                    'IpRanges': [
                        'string',
                    ],
                    'PrefixListIds': [
                        'string',
                    ],
                    'ToPort': 123,
                    'UserIdGroupPairs': [
                        {
                            'UserId': 'string',
                            'GroupName': 'string',
                            'GroupId': 'string',
                            'VpcId': 'string',
                            'VpcPeeringConnectionId': 'string',
                            'PeeringStatus': 'string'
                        },
                    ]
                },
            ]
        },
    ],
    'NextToken': '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).

        • GroupId (string) --

          The ID of the security group.

        • GroupName (string) --

          The name of the security group.

        • Description (string) --

          The description of the security group.

        • VpcId (string) --

          The ID of the VPC for 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) --

              One or more IP ranges. Not applicable for stale security group rules.

              • (string) --

            • PrefixListIds (list) --

              One or more prefix list IDs for an AWS service. 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) --

              One or more 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 AWS account ID pair.

                • UserId (string) --

                  The ID of an AWS account. For a referenced security group in another VPC, the account ID of the referenced security group is returned.

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

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

                • GroupId (string) --

                  The ID of the security group.

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

                • PeeringStatus (string) --

                  The status of a 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) --

              One or more IP ranges. Not applicable for stale security group rules.

              • (string) --

            • PrefixListIds (list) --

              One or more prefix list IDs for an AWS service. 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) --

              One or more 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 AWS account ID pair.

                • UserId (string) --

                  The ID of an AWS account. For a referenced security group in another VPC, the account ID of the referenced security group is returned.

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

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

                • GroupId (string) --

                  The ID of the security group.

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

                • PeeringStatus (string) --

                  The status of a VPC peering connection, if applicable.

    • NextToken (string) --

      The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

DescribeSecurityGroupReferences (new) Link ¶

[EC2-VPC only] Describes the VPCs on the other side of a VPC peering connection that are referencing the security groups you've specified in this request.

Request Syntax

client.describe_security_group_references(
    DryRun=True|False,
    GroupId=[
        'string',
    ]
)
type DryRun:

boolean

param DryRun:

Checks whether you have the required permissions for the operation, 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 GroupId:

list

param GroupId:

[REQUIRED]

One or more security group IDs in your account.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'SecurityGroupReferenceSet': [
        {
            'GroupId': 'string',
            'ReferencingVpcId': 'string',
            'VpcPeeringConnectionId': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • SecurityGroupReferenceSet (list) --

      Information about the VPCs with the referencing security groups.

      • (dict) --

        Describes a VPC with a security group that references your security group.

        • GroupId (string) --

          The ID of your security group.

        • ReferencingVpcId (string) --

          The ID of the VPC with the referencing security group.

        • VpcPeeringConnectionId (string) --

          The ID of the VPC peering connection.