{"id":3302,"library":"types-aiobotocore-lambda","title":"Type Annotations for aiobotocore Lambda","description":"types-aiobotocore-lambda provides machine-generated type annotations (stubs) for the aiobotocore Lambda service, enabling static type checking and improved IDE autocompletion for asynchronous AWS SDK usage in Python. It is part of the mypy-boto3-builder project, currently at version 3.4.0, with regular updates following upstream aiobotocore and botocore releases.","status":"active","version":"3.4.0","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["type annotations","aiobotocore","aws","lambda","mypy","pyright","stubs","async"],"install":[{"cmd":"pip install types-aiobotocore-lambda","lang":"bash","label":"Standalone installation"},{"cmd":"pip install 'types-aiobotocore[lambda]'","lang":"bash","label":"As part of the main types-aiobotocore package"}],"dependencies":[{"reason":"Runtime dependency for the AWS SDK client.","package":"aiobotocore","optional":false},{"reason":"Optional, for static type checking.","package":"mypy","optional":true},{"reason":"Optional, for static type checking.","package":"pyright","optional":true}],"imports":[{"symbol":"LambdaClient","correct":"from types_aiobotocore_lambda.client import LambdaClient"},{"symbol":"LambdaServiceResource","correct":"from types_aiobotocore_lambda.service_resource import LambdaServiceResource"},{"note":"For client exceptions, usually accessed via `client.exceptions` at runtime.","symbol":"Exceptions","correct":"from types_aiobotocore_lambda.client import Exceptions"}],"quickstart":{"code":"import asyncio\nfrom aiobotocore.session import get_session\nfrom types_aiobotocore_lambda.client import LambdaClient\n\nasync def list_lambda_functions():\n    session = get_session()\n    # Ensure AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are set in environment\n    # or ~/.aws/credentials for this to run.\n    async with session.create_client(\"lambda\") as client:\n        client: LambdaClient # Explicit type hint for static analysis\n        response = await client.list_functions()\n        for func in response.get(\"Functions\", []):\n            print(f\"Function Name: {func['FunctionName']}, Runtime: {func['Runtime']}\")\n\nif __name__ == \"__main__\":\n    asyncio.run(list_lambda_functions())\n","lang":"python","description":"This example demonstrates how to set up an aiobotocore Lambda client with explicit type annotations using `types-aiobotocore-lambda` to leverage static analysis and IDE autocompletion for asynchronous AWS Lambda operations. It lists available Lambda functions."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer. Ensure your CI/CD pipelines use a compatible Python version.","message":"Python 3.8 is no longer supported. Packages generated by mypy-boto3-builder 8.12.0 and later require Python 3.9 or higher.","severity":"breaking","affected_versions":"mypy-boto3-builder 8.12.0+ (corresponds to types-aiobotocore-lambda ~3.4.0+)"},{"fix":"Update your code to use the new TypeDef names. Refer to the documentation for specific service changes.","message":"Breaking changes in generated TypeDef naming conventions were introduced. Type definitions like `CreateDistributionRequestRequestTypeDef` might have been shortened to `CreateDistributionRequestTypeDef`.","severity":"breaking","affected_versions":"mypy-boto3-builder 8.9.0+ (corresponds to types-aiobotocore-lambda ~3.x.x+)"},{"fix":"If integrating with SMS Voice functionality, switch to `types-aiobotocore-pinpoint-sms-voice` or `pinpoint-sms-voice` in your aiobotocore client calls.","message":"The `sms-voice` service was deprecated in favor of `pinpoint-sms-voice`. While this specific package is for Lambda, users transitioning from broader `types-aiobotocore` installations might encounter this if they used `sms-voice` types.","severity":"deprecated","affected_versions":"mypy-boto3-builder 8.11.0+ (all packages)"},{"fix":"Consider installing `types-aiobotocore-lite-lambda` instead (`pip install types-aiobotocore-lite-lambda`) or disable PyCharm's internal type checker and rely on `mypy`/`pyright`.","message":"PyCharm users may experience slow performance due to Literal overloads. The `types-aiobotocore-lite` package is recommended as an alternative for better IDE responsiveness.","severity":"gotcha","affected_versions":"All versions with PyCharm"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}