Type annotations for aiobotocore Elastic Load Balancing V2

3.4.0 · active · verified Thu Apr 16

This library provides type annotations for the `aiobotocore` client interacting with the AWS Elastic Load Balancing V2 (ELBv2) service. It is generated by `mypy-boto3-builder` and ensures type-safe asynchronous AWS interactions. The current version is 3.4.0, and the `mypy-boto3-builder` project has a frequent release cadence, often aligning with new AWS service features and SDK updates.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to instantiate an `aiobotocore` ELBv2 client and apply the `ELBv2Client` type hint for full static analysis support with `mypy` or similar tools. It retrieves a list of ELBv2 load balancers in the configured region.

import asyncio
from aiobotocore.session import get_session
from types_aiobotocore_elbv2.client import ELBv2Client

async def describe_elbv2_load_balancers():
    session = get_session()
    async with session.create_client("elbv2") as client:
        # Explicitly type-hint the client for static analysis
        elbv2_client: ELBv2Client = client
        response = await elbv2_client.describe_load_balancers()
        print(f"ELBv2 Load Balancers: {response.get('LoadBalancers')}")

if __name__ == "__main__":
    asyncio.run(describe_elbv2_load_balancers())

view raw JSON →