{"id":3168,"library":"mypy-boto3-wellarchitected","title":"Type annotations for boto3 WellArchitected","description":"This library provides static type annotations for the AWS Well-Architected service, enabling `mypy` to perform static type checking on `boto3` code. It ensures type safety and enhances developer experience with improved autocompletion. The current version is 1.42.3, and it follows the `mypy-boto3-builder` release cadence, which is typically frequent due to `boto3` updates.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["mypy","boto3","aws","type-checking","wellarchitected","stubs","productivity"],"install":[{"cmd":"pip install mypy-boto3-wellarchitected","lang":"bash","label":"Install service-specific stubs"},{"cmd":"pip install 'boto3-stubs[wellarchitected]'","lang":"bash","label":"Install via boto3-stubs extras (recommended)"}],"dependencies":[{"reason":"Runtime dependency for AWS SDK functionality; stubs are for this library.","package":"boto3"},{"reason":"Required for static type checking, the primary purpose of the library.","package":"mypy","optional":true}],"imports":[{"note":"Directly importing from `boto3.client` will not provide the type hints. The `mypy_boto3_wellarchitected` package provides the necessary type stubs for the specific service client.","wrong":"from boto3.client import wellarchitected","symbol":"WellArchitectedClient","correct":"from mypy_boto3_wellarchitected.client import WellArchitectedClient"},{"note":"Type definitions are typically found in the `type_defs` submodule, corresponding to API request/response structures.","symbol":"WellArchitectedServiceName","correct":"from mypy_boto3_wellarchitected.type_defs import CreateWorkloadInputRequestTypeDef"}],"quickstart":{"code":"import os\nimport boto3\nfrom mypy_boto3_wellarchitected.client import WellArchitectedClient\n\n\ndef get_wellarchitected_client() -> WellArchitectedClient:\n    \"\"\"Initializes and returns a WellArchitectedClient with type annotations.\"\"\"\n    session = boto3.Session(\n        aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', 'DUMMY_KEY'),\n        aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', 'DUMMY_SECRET'),\n        region_name=os.environ.get('AWS_REGION', 'us-east-1')\n    )\n    client: WellArchitectedClient = session.client(\"wellarchitected\")\n    return client\n\n# Example usage (will require valid AWS credentials for actual execution)\nif __name__ == \"__main__\":\n    try:\n        wa_client = get_wellarchitected_client()\n        # This call will typically fail without proper credentials and permissions\n        # but demonstrates type-hinted client usage.\n        response = wa_client.list_workloads(\n            MaxResults=10\n        )\n        print(\"Successfully initialized WellArchitected client (response may be empty/error without valid creds).\")\n        # print(response.get('WorkloadSummaries'))\n    except Exception as e:\n        print(f\"An error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to obtain a type-hinted `WellArchitectedClient` using `boto3` and the `mypy-boto3-wellarchitected` stubs. It uses environment variables for AWS credentials, which is good practice. The `list_workloads` call is included to show typical client interaction, though it requires valid AWS credentials and permissions to execute successfully."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Support for Python 3.8 has been removed in `mypy-boto3-builder` version 8.12.0 and subsequent `mypy-boto3` packages. Users on Python 3.8 will need to upgrade to Python 3.9 or higher.","severity":"breaking","affected_versions":">=8.12.0 of mypy-boto3-builder, affecting mypy-boto3-wellarchitected versions built with it"},{"fix":"Review your code for direct imports of `TypeDef` objects from `mypy_boto3_wellarchitected.type_defs` and adjust to the new naming conventions if they break.","message":"In `mypy-boto3-builder` version 8.9.0, TypeDef names for packed method arguments were shortened, and conflicting `Extra` postfixes were moved. If you have explicitly imported or referenced generated `TypeDef` names, these may have changed.","severity":"breaking","affected_versions":">=8.9.0 of mypy-boto3-builder, affecting mypy-boto3-wellarchitected versions built with it"},{"fix":"Ensure your `pip` is up-to-date (`pip install --upgrade pip`) and your build environment correctly recognizes PEP 561 compliant stub packages.","message":"The `mypy-boto3` ecosystem migrated to PEP 561 packages in `mypy-boto3-builder` 8.12.0. While beneficial for type checkers, it might cause unexpected behavior with older `pip` versions or custom build systems that do not correctly handle PEP 561 stub distribution.","severity":"gotcha","affected_versions":">=8.12.0 of mypy-boto3-builder, affecting mypy-boto3-wellarchitected versions built with it"},{"fix":"Keep `mypy-boto3-wellarchitected` updated to a version compatible with your `boto3` installation. The `mypy-boto3` documentation often suggests installing with `boto3-stubs[boto3]` to ensure synchronization.","message":"For optimal type checking and compatibility, the version of `mypy-boto3-wellarchitected` should ideally align with the version of `boto3` you are using. Mismatched versions can lead to incorrect type hints or missing attributes, especially after significant `boto3` updates.","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"}