Obtenir des informations sur vos load balancers

Vous pouvez obtenir des informations sur vos load balancers en utilisant AWS CLI.

Obtenir des informations sur vos load balancers avec Cockpit v2

Voir le dashboard Load Balancers.

Obtenir des informations sur vos load balancers avec OSC CLI

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

The ReadLoadBalancers command lists one or more load balancers and their attributes.

Request sample
$ osc-cli api ReadLoadBalancers --profile "default" \
    --Filters '{
        "LoadBalancerNames": ["private*"],
      }'

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.

    • LoadBalancerNames: (optional) The names of the load balancers.

The ReadLoadBalancers command returns the following elements:

  • LoadBalancers: Information about one or more load balancers.

    • AccessLog: Information about access logs.

      • IsEnabled: If true, access logs are enabled for your load balancer. If false, they are not. If you set this to true in your request, the OsuBucketName parameter is required.

      • OsuBucketName: The name of the OOS bucket for the access logs.

      • OsuBucketPrefix: The path to the folder of the access logs in your OOS bucket (by default, the root level of your bucket).

      • PublicationInterval: The time interval for the publication of access logs in the OOS bucket, in minutes. This value can be either 5 or 60 (by default, 60).

    • ApplicationStickyCookiePolicies: The stickiness policies defined for the load balancer.

      • CookieName: The name of the application cookie used for stickiness.

      • PolicyName: The mnemonic name for the policy being created. The name must be unique within a set of policies for this load balancer.

    • BackendIps: One or more public IPs of backend VMs.

    • BackendVmIds: One or more IDs of backend VMs for the load balancer.

    • DnsName: The DNS name of the load balancer.

    • HealthCheck: Information about the health check configuration.

      • CheckInterval: The number of seconds between two requests (between 5 and 600 both included).

      • HealthyThreshold: The number of consecutive successful requests before considering the VM as healthy (between 2 and 10 both included).

      • Path: If you use the HTTP or HTTPS protocols, the request URL path.

      • Port: The port number (between 1 and 65535, both included).

      • Protocol: The protocol for the URL of the VM (HTTP | HTTPS | TCP | SSL).

      • Timeout: The maximum waiting time for a response before considering the VM as unhealthy, in seconds (between 2 and 60 both included).

      • UnhealthyThreshold: The number of consecutive failed requests before considering the VM as unhealthy (between 2 and 10 both included).

    • Listeners: The listeners for the load balancer.

      • BackendPort: The port on which the backend VM is listening (between 1 and 65535, both included).

      • BackendProtocol: The protocol for routing traffic to backend VMs (HTTP | HTTPS | TCP | SSL).

      • LoadBalancerPort: The port on which the load balancer is listening (between 1 and 65535, both included).

      • LoadBalancerProtocol: The routing protocol (HTTP | HTTPS | TCP | SSL).

      • PolicyNames: The names of the policies. If there are no policies enabled, the list is empty.

      • ServerCertificateId: The OUTSCALE Resource Name (ORN) of the server certificate. For more information, see Resource Identifiers > OUTSCALE Resource Names (ORNs).

    • LoadBalancerName: The name of the load balancer.

    • LoadBalancerStickyCookiePolicies: The policies defined for the load balancer.

      • CookieExpirationPeriod: The time period, in seconds, after which the cookie should be considered stale.
        If 1, the stickiness session lasts for the duration of the browser session.

      • PolicyName: The name of the stickiness policy.

    • LoadBalancerType: The type of load balancer. Valid only for load balancers in a Net.
      If LoadBalancerType is internet-facing, the load balancer has a public DNS name that resolves to a public IP.
      If LoadBalancerType is internal, the load balancer has a public DNS name that resolves to a private IP.

    • NetId: The ID of the Net for the load balancer.

    • PublicIp: (internet-facing only) The public IP associated with the load balancer.

    • SecuredCookies: Whether secure cookies are enabled for the load balancer.

    • SecurityGroups: One or more IDs of security groups for the load balancers. Valid only for load balancers in a Net.

    • SourceSecurityGroup: Information about the source security group of the load balancer, which you can use as part of your inbound rules for your registered VMs.
      To only allow traffic from load balancers, add a security group rule that specifies this source security group as the inbound source.

      • SecurityGroupAccountId: The account ID of the owner of the security group.

      • SecurityGroupName: The name of the security group.

    • Subnets: The ID of the Subnet in which the load balancer was created.

    • SubregionNames: The ID of the Subregion in which the load balancer was created.

    • Tags: One or more tags associated with the load balancer.

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

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

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  },
  "LoadBalancers": [
    {
      "Tags": [],
      "SourceSecurityGroup": {
        "SecurityGroupName": "security-group-example",
        "SecurityGroupAccountId": "123456789012"
      },
      "SecuredCookies": false,
      "PublicIp": "192.0.2.0",
      "Subnets": [
        "subnet-12345678"
      ],
      "NetId": "vpc-12345678",
      "BackendVmIds": [],
      "ApplicationStickyCookiePolicies": [],
      "SecurityGroups": [
        "sg-12345678"
      ],
      "LoadBalancerType": "internet-facing",
      "AccessLog": {
        "PublicationInterval": 60,
        "IsEnabled": false
      },
      "DnsName": "private-lb-example.123456789.eu-west-2.lbu.outscale.com",
      "HealthCheck": {
        "UnhealthyThreshold": 2,
        "Timeout": 5,
        "CheckInterval": 30,
        "Protocol": "TCP",
        "HealthyThreshold": 10,
        "Port": 80
      },
      "LoadBalancerStickyCookiePolicies": [],
      "SubregionNames": [
        "eu-west-2a"
      ],
      "Listeners": [
        {
          "ServerCertificateId": "orn:ows:idauth::012345678910:server-certificate/Certificate",
          "BackendPort": 80,
          "BackendProtocol": "HTTP",
          "LoadBalancerPort": 443,
          "LoadBalancerProtocol": "HTTPS"
        }
      ],
      "LoadBalancerName": "private-lb-example"
    }
  ]
}

Obtenir des informations sur vos load balancers avec AWS CLI

Obtenir des informations générales sur vos load balancers

Pour obtenir des informations sur un ou plusieurs load balancers, utilisez la commande describe-load-balancer en suivant cette syntaxe :

Exemple de requête
$ aws elb describe-load-balancers \
    --profile YOUR_PROFILE \
    --load-balancer-names my-load-balancer \
    --endpoint https://lbu.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) load-balancer-names : Le nom d’un ou plusieurs load balancers.

    Si vous ne spécifiez aucun nom de load balancer, la requête renvoie une description de l’ensemble de vos load balancers.

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

La commande describe-load-balancers renvoie les éléments suivants :

  • LoadBalancerDescriptions : Informations à propos d’un ou plusieurs load balancers. Cet élément contient les informations suivantes pour chaque load balancer :

    • Subnets : L’ID du subnet dans lequel le load balancer a été créé, si celui-ci est dans un VPC.

    • ListenerDescriptions : Informations à propos d’un ou plusieurs listeners ajoutés au load balancer. Cet élément contient les informations suivantes pour chaque listener :

      • Listener : Informations à propos d’un listener :

        • InstancePort : Le port sur lequel les instances backend écoutent.

        • LoadBalancerPort : Le port sur lequel le load balancer écoute.

        • Protocol : Le protocole de routage du load balancer ( HTTP, HTTPS, TCP ou SSL ).

        • InstanceProtocol : Le protocole utilisé pour router le trafic vers les instances backend ( HTTP ou TCP ).

      • PolicyNames : Le nom des politiques mises en places pour le load balancer, s’il y en a.

    • HealthCheck : Informations à propos de la configuration du health check pour le load balancer. Cet élément contient les informations suivantes :

      • HealthyThreshold : Le nombre de requêtes réussies consécutives nécessaires pour considérer l’instance comme saine.

      • Interval : Le nombre de secondes entre deux requêtes.

      • Target : Le port et le protocole pour les instances backend ciblées par les health checks (et le chemin à vérifier pour le protocole HTTP).

      • Timeout : Le temps d’attente maximum d’une réponse avant de considérer la requête comme non réussie, en secondes.

      • UnhealthyThreshold : Le nombre de requêtes non réussies consécutives pour considérer l’instance comme non saine.

    • VPCId : L’ID du VPC pour le load balancer, s’il y en a un.

    • BackendServerDescriptions : Informations à propos des instances backend. Cet élément contient les informations suivantes pour chaque instance backend :

      • InstancePort : Le port sur lequel les instances backend écoutent.

      • PolicyNames : Le nom des politiques activées pour les instances backend, s’il y en a.

    • Instances : Informations à propos d’une ou plusieurs instances backend. Cet élément contient l’information suivante pour chaque instance backend :

      • InstanceId : L’ID de l’instance backend.

    • DNSName : Le nom DNS du load balancer.

    • SecurityGroups : Les security groups pour le load balancer, si celui-ci est dans un VPC.

    • Policies : Informations à propos des politiques pour le load balancer, s’il y en a :

      • LBCookieStickinessPolicies : Le nom de la politique utilisée pour les permanences de sessions basées sur la durée.

      • AppCookieStickinessPolicies : Le nom de la politique pour les permanences de sessions contrôlées par application.

      • OtherPolicies : Le nom de politiques autres que les politiques de permanences de sessions.

    • LoadBalancerName : Le nom du load balancer.

    • CreatedTime : La date et l’heure de création du load balancer.

    • AvailabilityZones : L’ID de l’Availability Zone (AZ) dans laquelle le load balancer a été créé. Dans le Cloud public, c’est l’AZ spécifiée lors de la création du load balancer. Dans un VPC, c’est l’AZ qui correspond au subnet spécifié lors de la création du load balancer.

    • Scheme : Le type de load balancer. Pour en savoir plus, voir À propos des load balancers > Types de load balancers.

Exemple de résultat
{
  "LoadBalancerDescriptions": [
    {
      "Subnets": [
          "subnet-12345678"
      ],
      "ListenerDescriptions": [
          {
              "Listener": {
                  "InstancePort": 80,
                  "LoadBalancerPort": 80,
                  "Protocol": "HTTP",
                  "InstanceProtocol": "HTTP"
              },
              "PolicyNames": []
          },
      ],
      "HealthCheck": {
          "HealthyThreshold": 3,
          "Interval": 15,
          "Target": "HTTP:80/index.html",
          "Timeout": 3,
          "UnhealthyThreshold": 3
      },
      "VPCId": "vpc-87654321",
      "BackendServerDescriptions": [
          {
              "InstancePort": 80,
              "PolicyNames": []
          }
      ],
      "Instances": [
          {
              "InstanceId": "i-56781234"
          },
          {
              "InstanceId": "i-43218765"
          }
      ],
      "DNSName": "my-load-balancer-1234567890.lbu.eu-west-2.outscale.com",
      "SecurityGroups": [
          "sg-18273465"
      ],
      "Policies": {
          "LBCookieStickinessPolicies": [],
          "AppCookieStickinessPolicies": [],
          "OtherPolicies": []
      },
      "LoadBalancerName": "my-load-balancer",
      "CreatedTime": "2016-05-12T05:22:08.364Z",
      "AvailabilityZones": [
          "eu-west-2a"
      ],
      "Scheme": "internet-facing",
      "SourceSecurityGroup": {
          "OwnerAlias": "123456789012",
          "GroupName": "my-lb-sg"
      }
    }
  ]
}

Obtenir des informations sur les attributs de vos load balancers

Pour obtenir des informations sur les attributs d’un load balancer, utilisez la commande describe-load-balancer-attributes en suivant cette syntaxe :

Exemple de requête
$ aws elb describe-load-balancer-attributes \
    --profile YOUR_PROFILE \
    --load-balancer-name LOAD_BALANCER_NAME \
    --endpoint https://lbu.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.

  • load-balancer-name : Le nom du load balancer dont vous voulez obtenir les attributs.

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

La commande describe-load-balancer-attributes renvoie les éléments suivants :

  • LoadBalancerAttributes : Informations sur les attributs du load balancer. Cet élément contient les informations suivantes :

    • AccessLog : Informations sur la publication des access logs. Cet élément contient les informations suivantes :

      • Enabled : Si true, les access logs sont activés pour le load balancer spécifié. Si false, ils ne le sont pas.

      • S3BucketName : Le nom du bucket OOS dans lequel les access logs sont publiés. Pour en savoir plus, voir À propos d’OOS.

      • EmitInterval : L’intervalle de temps pour la publication des access logs dans le bucket OOS, en minutes. Cette valeur peut être 5 ou 60 (par défaut, 60).

      • S3BucketPrefix : Le chemin d’accès au répertoire dans votre bucket OOS dans lequel les access logs sont publiés (par défaut, le niveau root du bucket).

    • ConnectionDraining : Informations sur le drainage des connexions. Cet élément contient les informations suivantes :

      • Enabled : Si true, le drainage de connexion est activé pour votre load balancer. Si false, il ne l’est pas.

      • Timeout : La durée maximum en secondes durant laquelle le load balancer laisse les connexions ouvertes avant de désenregistrer les instances.

    • ConnectionSettings : Informations sur le délai d’inactivité des connexions. Cet élément contient les informations suivantes :

      • IdleTimeout : La durée d’inactivité de la connexion en secondes avant sa fermeture par le load balancer.

    • AdditionalAttributes : Informations sur les attributs additionnels des load balancers. Cet élément contient les informations suivantes :

      • Key : Le nom de l’attribut, par exemple SecuredCookies.

      • Value : La valeur de l’attribut. Si le nom de l’attribut est SecuredCookies et sa valeur est true, les cookies sécurisés sont activés. Si false, ils sont désactivés.

Exemple de résultat
{
    "LoadBalancerAttributes": {
        "AccessLog": {
            "Enabled": true,
            "S3BucketName": "BUCKET_NAME",
            "EmitInterval": 60,
            "S3BucketPrefix": "BUCKET_PREFIX"
        },
        "ConnectionDraining": {
            "Enabled": true,
            "Timeout": 1
        },
        "ConnectionSettings": {
            "IdleTimeout": 1
        },
        "AdditionalAttributes": [
            {
                "Key": "SecuredCookies",
                "Value": "true"
            }
        ]
    }
}

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.