{"id":3834,"library":"types-aiobotocore-cloudformation","title":"Type annotations for aiobotocore CloudFormation","description":"Type annotations for aiobotocore CloudFormation 3.4.0 service. It provides comprehensive type hints for `aiobotocore` clients, paginators, waiters, and TypeDefs for the AWS CloudFormation service, compatible with static type checkers like mypy and pyright. The package is generated by the `mypy-boto3-builder` (version 8.12.0) and is released frequently, mirroring `aiobotocore` versions to ensure up-to-date type definitions.","status":"active","version":"3.4.0","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","aiobotocore","typing","stubs","cloudformation","async","mypy","pyright"],"install":[{"cmd":"pip install types-aiobotocore-cloudformation","lang":"bash","label":"Install direct package"},{"cmd":"pip install 'types-aiobotocore[cloudformation]'","lang":"bash","label":"Install via types-aiobotocore extra"}],"dependencies":[{"reason":"Provides the runtime asynchronous AWS client functionality that these stubs type-check. While not a hard runtime dependency, the stubs are useless without the core library.","package":"aiobotocore","optional":true}],"imports":[{"note":"Type stubs are provided by 'types-aiobotocore-cloudformation', not directly from 'aiobotocore'.","wrong":"from aiobotocore.client import CloudFormationClient","symbol":"CloudFormationClient","correct":"from types_aiobotocore_cloudformation.client import CloudFormationClient"},{"note":"Import TypeDefs directly from the `type_defs` submodule for specific service types.","symbol":"StackSummaryTypeDef","correct":"from types_aiobotocore_cloudformation.type_defs import StackSummaryTypeDef"},{"note":"Literal types (e.g., for status enums) are found in the `literals` submodule.","symbol":"StackStatusType","correct":"from types_aiobotocore_cloudformation.literals import StackStatusType"}],"quickstart":{"code":"import asyncio\nimport os\nfrom typing import TYPE_CHECKING\n\nimport aiobotocore.session\n\nif TYPE_CHECKING:\n    from types_aiobotocore_cloudformation.client import CloudFormationClient\n    from types_aiobotocore_cloudformation.type_defs import StackSummaryTypeDef\n\n\nasync def list_cloudformation_stacks():\n    session = aiobotocore.session.get_session()\n    async with session.create_client(\n        \"cloudformation\",\n        region_name=os.environ.get('AWS_REGION', 'us-east-1'),\n        aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', 'testing'),\n        aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', 'testing')\n    ) as client:\n        # The client variable is automatically type-hinted as CloudFormationClient\n        client: \"CloudFormationClient\"\n        response = await client.list_stacks()\n\n        for stack in response.get(\"StackSummaries\", []):\n            stack_summary: \"StackSummaryTypeDef\" = stack\n            print(f\"Stack Name: {stack_summary['StackName']}, Status: {stack_summary['StackStatus']}\")\n\n\nif __name__ == \"__main__\":\n    asyncio.run(list_cloudformation_stacks())\n","lang":"python","description":"This quickstart demonstrates how to obtain a typed `CloudFormationClient` using `aiobotocore` and interact with the CloudFormation service to list stacks. The `TYPE_CHECKING` block ensures that the explicit type imports for `CloudFormationClient` and `StackSummaryTypeDef` are only used during type checking, avoiding a runtime dependency on the stub package."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Python 3.8 support has been removed since `mypy-boto3-builder` version 8.12.0. Users on Python 3.8 or older will need to upgrade their Python version to use the latest `types-aiobotocore-cloudformation` stubs.","severity":"breaking","affected_versions":">=3.4.0 (generated by mypy-boto3-builder 8.12.0)"},{"fix":"Ensure your type checker (e.g., mypy, pyright) and environment are up-to-date. Reinstalling the package may resolve any pathing issues.","message":"The `mypy-boto3-builder` migrated to PEP 561 compliant packages in version 8.12.0. While largely transparent, this may impact specific environments or custom type-checking configurations if they relied on older package structures.","severity":"breaking","affected_versions":">=3.4.0 (generated by mypy-boto3-builder 8.12.0)"},{"fix":"Consult the generated documentation for the specific service to find the correct TypeDef names, or update your code to use the new shorter names.","message":"TypeDef names might have changed to shorter versions (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`) or had postfixes moved (`CreateDistributionExtraRequestTypeDef` -> `CreateDistributionRequestExtraTypeDef`) in `mypy-boto3-builder` 8.9.0. This could break direct imports or references to specific TypeDef names.","severity":"breaking","affected_versions":">=3.x.x (generated by mypy-boto3-builder 8.9.0)"},{"fix":"Always install `types-aiobotocore-cloudformation` alongside `aiobotocore` in your development environment for static analysis.","message":"For full type checking capabilities, both `aiobotocore` and the corresponding `types-aiobotocore-*` stub packages must be installed. Without the stub package, type checkers will have limited or no information for `aiobotocore` calls.","severity":"gotcha","affected_versions":"All versions"},{"fix":"If experiencing performance issues, switch to an external type checker or consider `types-aiobotocore-lite`.","message":"In some IDEs like PyCharm, using `types-aiobotocore` can lead to slow performance or high CPU usage. Workarounds include disabling PyCharm's internal type checker, using external checkers like mypy/pyright, or installing `types-aiobotocore-lite` for a more RAM-friendly option that might require more explicit type annotations.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}