{"id":7816,"library":"types-aiobotocore-elbv2","title":"Type annotations for aiobotocore Elastic Load Balancing V2","description":"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.","status":"active","version":"3.4.0","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","aiobotocore","types","mypy","type-hints","elbv2","load-balancer","async"],"install":[{"cmd":"pip install types-aiobotocore-elbv2 aiobotocore","lang":"bash","label":"Install library and aiobotocore"}],"dependencies":[{"reason":"Runtime dependency for the actual AWS service interaction. This package provides type stubs for aiobotocore.","package":"aiobotocore","optional":false},{"reason":"Provides backports of new `typing` features for older Python versions (e.g., `NotRequired`). Required for Python < 3.10.","package":"typing-extensions","optional":true}],"imports":[{"note":"Type stubs are organized by service within their own `types_aiobotocore_<service_name>` package, not as submodules of a main `types_aiobotocore` package.","wrong":"from types_aiobotocore.elbv2 import ELBv2Client","symbol":"ELBv2Client","correct":"from types_aiobotocore_elbv2.client import ELBv2Client"},{"note":"Type definitions for method inputs/outputs are typically found in the `type_defs` submodule, not directly in `client`.","wrong":"from types_aiobotocore_elbv2.client import DescribeLoadBalancersOutputTypeDef","symbol":"DescribeLoadBalancersOutputTypeDef","correct":"from types_aiobotocore_elbv2.type_defs import DescribeLoadBalancersOutputTypeDef"}],"quickstart":{"code":"import asyncio\nfrom aiobotocore.session import get_session\nfrom types_aiobotocore_elbv2.client import ELBv2Client\n\nasync def describe_elbv2_load_balancers():\n    session = get_session()\n    async with session.create_client(\"elbv2\") as client:\n        # Explicitly type-hint the client for static analysis\n        elbv2_client: ELBv2Client = client\n        response = await elbv2_client.describe_load_balancers()\n        print(f\"ELBv2 Load Balancers: {response.get('LoadBalancers')}\")\n\nif __name__ == \"__main__\":\n    asyncio.run(describe_elbv2_load_balancers())\n","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or later.","message":"Support for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0. Users on Python 3.8 must upgrade their Python version to 3.9 or newer.","severity":"breaking","affected_versions":">=8.12.0 of mypy-boto3-builder generated packages"},{"fix":"Review your code for `TypeDef` names and adjust them according to the latest generated types. Mypy will highlight incorrect names.","message":"Type definition (TypeDef) argument names might have changed in `mypy-boto3-builder` version 8.9.0 for brevity (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`).","severity":"breaking","affected_versions":">=8.9.0 of mypy-boto3-builder generated packages"},{"fix":"Ensure `pip install aiobotocore` is executed alongside `pip install types-aiobotocore-elbv2`.","message":"This library provides *type annotations* only. `aiobotocore` (and optionally `boto3` if you mix async/sync operations) must be installed separately for the code to run at runtime.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Stick to documented public import paths (e.g., `types_aiobotocore_elbv2.client` or `types_aiobotocore_elbv2.type_defs`).","message":"The `mypy-boto3-builder` projects now use PEP 561 packaging. While this generally improves compatibility, ensure you are not relying on internal builder structures or non-standard import paths that might have changed.","severity":"gotcha","affected_versions":">=8.12.0 of mypy-boto3-builder generated packages"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Run `pip install types-aiobotocore-elbv2`.","cause":"The type stub package is not installed in your environment.","error":"ModuleNotFoundError: No module named 'types_aiobotocore_elbv2'"},{"fix":"Run `pip install aiobotocore`.","cause":"The runtime library for interacting with AWS is not installed.","error":"ModuleNotFoundError: No module named 'aiobotocore'"},{"fix":"Consult the `types-aiobotocore-elbv2` documentation or source for the correct `TypeDef` or `Literal` type. Ensure your `aiobotocore` and `types-aiobotocore-elbv2` versions are compatible and up-to-date.","cause":"Mypy is flagging an incorrect type for a function argument. This often happens if you're passing a plain string when a `Literal` type or a more specific `TypedDict` is expected, or if your types-aiobotocore version is out of sync with your aiobotocore version.","error":"Argument of type \"str\" cannot be assigned to parameter \"load_balancer_arn\" of type \"LoadBalancerArnType\" in call to \"delete_load_balancer\""},{"fix":"Ensure you are importing `ELBv2Client` from `types_aiobotocore_elbv2.client` and explicitly type-hinting the client instance: `elbv2_client: ELBv2Client = client`.","cause":"You are assigning the result of `session.create_client('elbv2')` to a variable explicitly type-hinted as `ELBv2Client` without a type assertion or without the correct import.","error":"error: Incompatible types in assignment (expression has type \"BaseClient\", variable has type \"ELBv2Client\")"}]}