Getting Information About Your Net Peerings

You can get information about one or more Net peerings.

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

Getting Information About Your Net Peerings Using Cockpit v2

See the Net Peerings dashboard.

Getting Information About Your Net Peerings Using OSC CLI

The ReadNetPeerings command lists one or more peering connections between two Nets.

Request sample
$ osc-cli api ReadNetPeerings --profile "default" \
    --Filters '{
        "NetPeeringIds": ["pcx-12345678"],
      }'
Request sample
$ osc-cli api ReadNetPeerings --profile "default" \
    --Filters '{
        "SourceNetNetIds": ["vpc-12345678"],
        "StateNames": ["active", "pending-acceptance"],
      }'

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

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • Filters: (optional) One or more filters.

    • AccepterNetAccountIds: (optional) The account IDs of the owners of the peer Nets.

    • AccepterNetIpRanges: (optional) The IP ranges of the peer Nets, in CIDR notation (for example, 10.0.0.0/24).

    • AccepterNetNetIds: (optional) The IDs of the peer Nets.

    • ExpirationDates: (optional) The dates and times at which the Net peerings expire, in ISO 8601 date-time format (for example, 2020-06-14T00:00:00.000Z).

    • NetPeeringIds: (optional) The IDs of the Net peerings.

    • SourceNetAccountIds: (optional) The account IDs of the owners of the peer Nets.

    • SourceNetIpRanges: (optional) The IP ranges of the peer Nets.

    • SourceNetNetIds: (optional) The IDs of the peer Nets.

    • StateMessages: (optional) Additional information about the states of the Net peerings.

    • StateNames: (optional) The states of the Net peerings (pending-acceptance | active | rejected | failed | expired | deleted).

    • TagKeys: (optional) The keys of the tags associated with the Net peerings.

    • TagValues: (optional) The values of the tags associated with the Net peerings.

    • Tags: (optional) The key/value combination of the tags associated with the Net peerings, in the following format: "Filters":{"Tags":["TAGKEY=TAGVALUE"]}.

  • NextPageToken: (optional) The token to request the next page of results. Each token refers to a specific page.

  • ResultsPerPage: (optional) The maximum number of logs returned in a single response (between 1`and `1000, both included). By default, 100.

The ReadNetPeerings command returns the following elements:

  • NetPeerings: Information about one or more Net peerings.

    • AccepterNet: Information about the accepter Net.

      • AccountId: The account ID of the owner of the accepter Net.

      • IpRange: The IP range for the accepter Net, in CIDR notation (for example, 10.0.0.0/16).

      • NetId: The ID of the accepter Net.

    • ExpirationDate: The date and time (UTC) at which the Net peerings expire.

    • NetPeeringId: The ID of the Net peering.

    • SourceNet: Information about the source Net.

      • AccountId: The account ID of the owner of the source Net.

      • IpRange: The IP range for the source Net, in CIDR notation (for example, 10.0.0.0/16).

      • NetId: The ID of the source Net.

    • State: Information about the state of the Net peering.

      • Message: Additional information about the state of the Net peering.

      • Name: The state of the Net peering (pending-acceptance | active | rejected | failed | expired | deleted).

    • Tags: One or more tags associated with the Net peering.

      • Key: The key of the tag, with a minimum of 1 character.

      • Value: The value of the tag, between 0 and 255 characters.

  • NextPageToken: The token to request the next page of results. Each token refers to a specific page.

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  },
  "NetPeerings": [
    {
      "Tags": [],
      "State": {
        "Name": "active",
        "Message": "Active"
      },
      "AccepterNet": {
        "NetId": "vpc-12345678",
        "IpRange": "172.16.0.0/16",
        "AccountId": "123456789012"
      },
      "SourceNet": {
        "NetId": "vpc-12345678",
        "IpRange": "10.0.0.0/16",
        "AccountId": "123456789012"
      },
      "NetPeeringId": "pcx-12345678"
    }
  ]
}

Getting Information About Your VPC Peering Connections Using AWS CLI

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": "172.16.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 Methods

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