{"id":3685,"library":"mypy-boto3-rolesanywhere","title":"Type Annotations for Boto3 IAM Roles Anywhere","description":"mypy-boto3-rolesanywhere provides static type annotations for the `boto3` IAM Roles Anywhere service client. It is part of the `mypy-boto3` project, which generates comprehensive type stubs for all AWS services supported by `boto3`, significantly enhancing code quality and developer experience through static analysis. The library is actively maintained with frequent updates, currently at version 1.42.5, typically aligning with `boto3` and `botocore` releases.","status":"active","version":"1.42.5","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["boto3","mypy","type-hints","aws","rolesanywhere","typescript-for-python"],"install":[{"cmd":"pip install mypy-boto3-rolesanywhere","lang":"bash","label":"Install service-specific stubs"},{"cmd":"pip install boto3 mypy-boto3-rolesanywhere","lang":"bash","label":"Install with Boto3 runtime"}],"dependencies":[{"reason":"Provides the runtime functionality that these type stubs enhance. Required to use the typed client/resource objects.","package":"boto3","optional":false}],"imports":[{"note":"The actual type hints come from the mypy-boto3-rolesanywhere package, not directly from boto3.","wrong":"from boto3.client import RolesAnywhereClient","symbol":"RolesAnywhereClient","correct":"from mypy_boto3_rolesanywhere.client import RolesAnywhereClient"},{"note":"Type definitions for request/response bodies are found in the service-specific `type_defs` module.","wrong":"from boto3.rolesanywhere.type_defs import ListProfilesResponseTypeDef","symbol":"ListProfilesResponseTypeDef","correct":"from mypy_boto3_rolesanywhere.type_defs import ListProfilesResponseTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_rolesanywhere.client import RolesAnywhereClient\nfrom mypy_boto3_rolesanywhere.type_defs import ListProfilesResponseTypeDef\n\n# Get a Boto3 Roles Anywhere client, explicitly typed for mypy\nclient: RolesAnywhereClient = boto3.client(\"rolesanywhere\")\n\ntry:\n    # Call an operation; mypy will now provide completions and type checking\n    response: ListProfilesResponseTypeDef = client.list_profiles()\n\n    print(f\"Successfully listed {len(response.get('profiles', []))} RolesAnywhere profiles.\")\n    if 'nextToken' in response:\n        print(f\"Next token available: {response['nextToken']}\")\n\nexcept client.exceptions.AccessDeniedException as e:\n    print(f\"Access Denied: {e}\")\nexcept Exception as e:\n    print(f\"An unexpected error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to initialize a `boto3` IAM Roles Anywhere client and apply the type hints provided by `mypy-boto3-rolesanywhere`. This allows for static type checking and improved IDE auto-completion when interacting with the service. Ensure `boto3` is also installed."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher.","message":"Support for Python 3.8 was removed starting with `mypy-boto3-builder` version 8.12.0. Packages generated by this builder (including `mypy-boto3-rolesanywhere`) will not function correctly on Python 3.8.","severity":"breaking","affected_versions":">=8.12.0 of `mypy-boto3-builder` and its generated packages"},{"fix":"Ensure your `mypy` configuration is up-to-date. Standard import paths like `from mypy_boto3_rolesanywhere.client import RolesAnywhereClient` remain stable.","message":"The `mypy-boto3` ecosystem, including `mypy-boto3-rolesanywhere`, migrated to PEP 561 compliant packages with `mypy-boto3-builder` version 8.12.0. This might affect advanced build setups or custom type checking configurations.","severity":"breaking","affected_versions":">=8.12.0 of `mypy-boto3-builder` and its generated packages"},{"fix":"Ensure both `mypy-boto3-rolesanywhere` and `boto3` are installed: `pip install boto3 mypy-boto3-rolesanywhere`.","message":"This library provides type stubs only. For runtime functionality, the `boto3` library must be installed alongside `mypy-boto3-rolesanywhere`. Forgetting `pip install boto3` is a common mistake.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Refer to the updated type definitions in the `mypy-boto3-rolesanywhere.type_defs` module. IDE auto-completion usually helps in finding the correct names.","message":"TypeDef argument names for methods were shortened and conflicting TypeDef `Extra` postfixes were reordered in `mypy-boto3-builder` version 8.9.0. If you explicitly import or reference specific TypeDefs for request/response bodies, their names may have changed.","severity":"breaking","affected_versions":">=8.9.0 of `mypy-boto3-builder` and its generated packages"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}