Getting Information About Your VPC Peering Connections

You can get information about one or more VPC peering connections.

By default, this action describes all your VPC peering connections. Connections that are in the failed, expired, or deleted states remain visible for 1 hour. For more information, see About VPC Peering Connections > Lifecycle.

If you exceed the number of identical requests allowed for a configured time period, the RequestLimitExceeded error message is returned.

This procedure uses AWS CLI only. Information about these resources is also available from Cockpit v1. For more information, see VPC User Interface.

To get information about one or more VPC peering connections, use the describe-vpc-peering-connections command following this syntax:

Request sample
$ aws ec2 describe-vpc-peering-connections \
    --profile YOUR_PROFILE \
    --vpc-peering-connection-ids pcx-111aaa11 \
    --filters Name=status-code,Values=pending-acceptance \
    --endpoint https://fcu.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • (optional) vpc-peering-connection-ids: The IDs of one or more VPC peering connections you want to get information about.

  • (optional) filters: One or more filters, in the "Name=X,Values=Y" format.

    You can specify several values for a same filter using the "Name=X,Values=Y, Z" format.

    The following filters are available:

    • accepter-vpc-info.cidr-block: The range of IPs of the accepter VPC, in CIDR notation.

    • accepter-vpc-info.owner-id: The account ID of the owner of the accepter VPC.

    • accepter-vpc-info.vpc-id: The ID of the accepter VPC.

    • expiration-time: The date after which the connection expires (for example, 2016-01-23T18:45:30.000Z).

    • requester-vpc-info.cidr-block: The range of IPs of the requester VPC, in CIDR notation.

    • requester-vpc-info.owner-id: The account ID of the owner of the requester VPC.

    • requester-vpc-info.vpc-id: The ID of the requester VPC.

    • status-code: The state of the VPC peering connection (pending-acceptance | active | rejected | failed | expired | deleted).

      To view all VPC peering connection requests in the pending-acceptance state for your VPCs, use the status-code filter with the pending-acceptance value.

    • status-message: Additional information about the state of the VPC peering connection.

    • vpc-peering-connection-id: The ID of the VPC peering connection.

    • tag-key: The key of a tag associated with the resource.

    • tag-value: The value of a tag associated with the resource.

    • tag:XXXX: The value of a tag associated with the resource, where XXXX is the key of the tag.

      To filter a tag whose key is XXXX and value is YYYY, you can therefore use either of the following two formats:

      • --filters Name=tag-key,Values=XXXX Name=tag-value,Values=YYYY

      • --filters Name=tag:XXXX,Values=YYYY

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

The describe-vpc-peering-connections command returns the following elements:

  • VpcPeeringConnections: Information about one or more VPC peering connections. This element contains the following information:

    • AccepterVpcInfo: Information about the accepter VPC. This element contains the following information:

      • CidrBlock: The range of IPs of the VPC, in CIDR notation.

      • OwnerID: The account ID of the owner of the VPC.

      • VpcId: The ID of the VPC.

    • ExpirationTime: The date after which a VPC peering connection request in the pending-acceptance state expires.

    • RequesterVpcInfo: Information about the requester VPC. This element contains the following information:

      • CidrBlock: The range of IPs of the VPC, in CIDR notation.

      • OwnerID: The account ID of the owner of the VPC.

      • VpcId: The ID of the VPC.

    • Status: Information about the state of the VPC peering connection. This element contains the following information:

      • Code: The state of the VPC peering connection (pending-acceptance | active | rejected | failed | expired | deleted).

      • Message: Additional information about the state of the VPC peering connection.

    • Tags: One or more associated with the VPC peering connection. This element contains the following information:

      • Key: The key of the tag.

      • Value: The value of the tag.

    • VpcPeeringConnectionId: The ID of the VPC peering connection.

Result sample
{
    "VpcPeeringConnections": [
        {
            "AccepterVpcInfo": {
                "CidrBlock": "175.0.0.0/28",
                "OwnerId": "888877776666",
                "VpcId": "vpc-11122233"
            },
            "RequesterVpcInfo": {
                "CidrBlock": "10.0.0.0/28",
                "OwnerId": "444455556666",
                "VpcId": "vpc-1a2b3c4d"
            }
            "Status": {
                "Code": "pending-acceptance",
                "Message": "Pending acceptance by 888877776666"
            },
            "Tags": [],
            "VpcPeeringConnectionId": "pcx-111aaa11"
        }
    ]
}

Related Pages

Corresponding API Method

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.