{"id":4295,"library":"types-boto3-cloudformation","title":"Type Annotations for boto3 CloudFormation","description":"types-boto3-cloudformation provides type annotations for the `boto3` AWS SDK's CloudFormation service, compatible with static analysis tools like mypy, pyright, and IDEs such as VSCode and PyCharm. It is generated by the `mypy-boto3-builder` (currently version 8.12.0) and typically releases updates in sync with `boto3` to provide accurate type hints for the latest AWS service APIs. The current version of these annotations is 1.42.3, matching `boto3`'s version.","status":"active","version":"1.42.3","language":"python","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","cloudformation","types","mypy","type-hints","stub","static-analysis","aws-sdk"],"install":[{"cmd":"pip install types-boto3-cloudformation","lang":"bash","label":"Install standalone package"},{"cmd":"pip install 'types-boto3[cloudformation]'","lang":"bash","label":"Install via types-boto3 extras"}],"dependencies":[{"reason":"Required Python version.","package":"python","optional":false},{"reason":"This package provides type hints for boto3. Boto3 itself must be installed separately to provide runtime functionality.","package":"boto3","optional":false}],"imports":[{"wrong":"from types_boto3_cloudformation import CloudFormationClient","symbol":"CloudFormationClient","correct":"from types_boto3_cloudformation import CloudFormationClient"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n    from types_boto3_cloudformation.client import CloudFormationClient\n    from types_boto3_cloudformation.type_defs import StackSummaryTypeDef\n\n# Create a boto3 client. Types are typically auto-discovered by IDEs/type checkers\n# if types-boto3-cloudformation is installed.\nclient: CloudFormationClient = boto3.client(\"cloudformation\")\n\ntry:\n    # Example: List CloudFormation stacks\n    response = client.list_stacks(StackStatusFilter=[\n        'CREATE_COMPLETE', 'UPDATE_COMPLETE', 'ROLLBACK_COMPLETE'\n    ])\n\n    print(\"CloudFormation Stacks:\")\n    for stack_summary: StackSummaryTypeDef in response.get(\"StackSummaries\", []):\n        print(f\"  - {stack_summary['StackName']} ({stack_summary['StackStatus']})\")\n\nexcept Exception as e:\n    print(f\"Error listing stacks: {e}\")\n    # In a real application, handle specific AWS exceptions like ClientError","lang":"python","description":"This quickstart demonstrates how to obtain a typed CloudFormation client and use it to list stacks. The `TYPE_CHECKING` block ensures the type imports are only used during static analysis, avoiding a runtime dependency if desired. You must have AWS credentials configured for boto3 to function (e.g., via `~/.aws/credentials` or environment variables)."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher.","message":"Python 3.8 support was removed with `mypy-boto3-builder` version 8.12.0. Users on Python 3.8 will need to upgrade to Python 3.9 or newer to use `types-boto3-cloudformation` versions generated by this builder version or newer.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0 (and corresponding types-boto3-cloudformation versions)"},{"fix":"Review and update `TypeDef` import paths and names in your code to match the new conventions.","message":"Type definition (TypeDef) naming conventions changed in `mypy-boto3-builder` 8.9.0. Specifically, packed method arguments use shorter names (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`), and conflicting `Extra` postfixes moved to the end (e.g., `CreateDistributionExtraRequestTypeDef` -> `CreateDistributionRequestExtraTypeDef`).","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.9.0 (and corresponding types-boto3-cloudformation versions)"},{"fix":"Ensure `boto3` is installed in your project: `pip install boto3`.","message":"This package provides *only* type annotations. The actual `boto3` library must be installed separately for your code to run at runtime. `types-boto3-cloudformation` does not include or replace the `boto3` runtime.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consider installing `types-boto3-lite-cloudformation` instead (`pip install types-boto3-lite-cloudformation`) or configure your PyCharm environment to use external type checkers.","message":"PyCharm users might experience slow performance or high CPU usage due to `Literal` overloads (issue PY-40997). The recommendation is to use `types-boto3-lite` versions or disable PyCharm's internal type checker and use `mypy` or `pyright` externally.","severity":"gotcha","affected_versions":"All versions (PyCharm specific)"},{"fix":"Ensure your static analysis tools (mypy, pyright) and IDEs are updated to their latest versions and configured to correctly discover PEP 561-compliant stub packages.","message":"With the migration to PEP 561 packages in `mypy-boto3-builder` 8.12.0, while core import paths should remain stable, there's a potential for tooling that relied on non-standard stub discovery mechanisms to require updates or configuration adjustments.","severity":"gotcha","affected_versions":"mypy-boto3-builder >=8.12.0 (and corresponding types-boto3-cloudformation versions)"}],"env_vars":null,"search_vec":"'1.42.3':74 '8.12.0':47 'accur':58 'analysi':24,90 'annot':2,12,72 'api':66 'aw':16,64,79,92 'aws-sdk':91 'boto3':4,8,15,43,55,76,80 'builder':44 'cloudform':5,9,19,81 'compat':21 'current':45,68 'generat':38 'hint':60,86 'ide':30 'latest':63 'like':26 'match':75 'mypi':27,42,83 'mypy-boto3-builder':41 'provid':10,57 'pycharm':35 'pyright':28 'releas':50 'sdk':17,93 'servic':20,65 'static':23,89 'static-analysi':88 'stub':87 'sync':53 'tool':25 'type':1,7,11,59,82,85 'type-hint':84 'types-boto3-cloudformation':6 'typic':49 'updat':51 'version':46,69,78 'vscode':33","created_at":"2026-04-12T03:49:16.169058+00:00","updated_at":"2026-04-16T23:31:04.178755+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/tmp/tmpfexxdnrb/venv/lib/python3.12/site-packages/types_boto3_cloudformation/__init__.py\", line 90, in <module>\n    from .client import CloudFormationClient\n  File \"/tmp/tmpfexxdnrb/venv/lib/python3.12/site-packages/t"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.43.62","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/youtype/mypy_boto3_builder","docs":"https://youtype.github.io/types_boto3_docs/types_boto3_cloudformation/","changelog":null,"pypi":"https://pypi.org/project/types-boto3-cloudformation/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["type-stubs","aws"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-08-29","next_check":"2026-07-10","install_tag":null}}