Obtenir des informations sur vos Net peerings

Vous pouvez obtenir des informations sur un ou plusieurs Net peerings.

Par défaut, cette action décrit tous vos Net peerings. Les connexions dont l’état est failed, expired ou deleted restent visibles pendant 1 heure. Pour en savoir plus, voir À propos des Net peerings > Cycle de vie.

Obtenir des informations sur vos Net peerings avec Cockpit v2

Voir le dashboard Net Peerings.

Obtenir des informations sur vos Net peerings avec OSC CLI

À ce jour, cette section est disponible en anglais uniquement.

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"
    }
  ]
}

Obtenir des informations sur vos VPC peering connections avec AWS CLI

Pour obtenir des informations sur une ou plusieurs VPC peering connections, utilisez la commande describe-vpc-peering-connections en suivant cette syntaxe :

Exemple de requête
$ 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

Cette commande contient les attributs suivants que vous devez spécifier :

  • (optionnel) profile : Le profil nommé que vous voulez utiliser, créé pendant la configuration d’AWS CLI. Pour en savoir plus, voir Installer et configurer AWS CLI.

  • (optionnel) vpc-peering-connection-ids : Un ou plusieurs ID de VPC peering connections pour lesquelles vous voulez obtenir des informations.

  • (optionnel) filters : Un ou plusieurs filtres, au format "Name=X,Values=Y".

    Vous pouvez spécifier plusieurs valeurs pour un même filtre en utilisant le format "Name=X,Values=Y, Z".

    Les filtres suivants sont disponibles :

    • accepter-vpc-info.cidr-block : La plage d’IP du VPC accepteur, en notation CIDR.

    • accepter-vpc-info.owner-id : L’ID de compte du propriétaire du VPC accepteur.

    • accepter-vpc-info.vpc-id : L’ID du VPC accepteur.

    • expiration-time : La date d’expiration de la requête de connexion (par exemple, 2016-01-23T18:45:30.000Z).

    • requester-vpc-info.cidr-block : La plage d’IP du VPC requêteur, en notation CIDR.

    • requester-vpc-info.owner-id : L’ID de compte du propriétaire du VPC requêteur.

    • requester-vpc-info.vpc-id : L’ID du VPC requêteur.

    • status-code : L’état de la VPC peering connection (pending-acceptance | active | rejected | failed | expired | deleted).

      Pour voir toutes les requêtes de VPC peering connections dont l’état est pending-acceptance pour vos VPC, utilisez le filtre status-code avec la valeur pending-acceptance.

    • status-message : Informations supplémentaires sur l’état de la VPC peering connection.

    • vpc-peering-connection-id : L’ID de la VPC peering connection.

    • tag-key : La clé d’un tag associé à la ressource.

    • tag-value : La valeur d’un tag associé à la ressource.

    • tag:XXXX : La valeur d’un tag associé à la ressource, où XXXX est la clé du tag.

      Pour filtrer un tag dont la clé est XXXX et la valeur est YYYY, vous pouvez donc utiliser un des deux formats suivants :

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

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

  • endpoint : Le endpoint correspondant à la Région à laquelle vous voulez envoyer la requête.

La commande describe-vpc-peering-connections renvoie les éléments suivants :

  • VpcPeeringConnections : Informations à propos d’une ou plusieurs VPC peering connections. Cet élément contient les informations suivantes :

    • AccepterVpcInfo : Informations à propos du VPC accepteur. Cet élément contient les informations suivantes :

      • CidrBlock : La plage d’IP du VPC, en notation CIDR.

      • OwnerID : L’ID de compte du propriétaire du VPC.

      • VpcId : L’ID du VPC.

    • ExpirationTime : La date d’expiration d’une VPC peering connection à l’état pending-acceptance.

    • RequesterVpcInfo : Informations à propos du VPC requêteur. Cet élément contient les informations suivantes :

      • CidrBlock : La plage d’IP du VPC, en notation CIDR.

      • OwnerID : L’ID de compte du propriétaire du VPC.

      • VpcId : L’ID du VPC.

    • Status : Informations à propos de l’état de la VPC peering connection. Cet élément contient les informations suivantes :

      • Code : L’état de la VPC peering connection (pending-acceptance | active | rejected | failed | expired | deleted).

      • Message : Informations supplémentaires à propos de la VPC peering connection.

    • Tags : Un ou plusieurs tags associés à la VPC peering connection. Cet élément contient les informations suivantes :

      • Key : La clé du tag.

      • Value : La valeur du tag.

    • VpcPeeringConnectionId : L’ID de la VPC peering connection.

Exemple de résultat
{
    "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"
        }
    ]
}

Pages connexes

Méthodes API correspondantes

AWS™ et Amazon Web Services™ sont des marques de commerce d’Amazon Technologies, Inc. ou de ses affiliées aux États-Unis et/ou dans les autres pays.