{"id":3576,"library":"mypy-boto3-eks-auth","title":"mypy-boto3-eks-auth type annotations","description":"mypy-boto3-eks-auth provides type annotations for the boto3 EKSAuth service, enabling static type checking for AWS EKSAuth client interactions. It is generated by the mypy-boto3-builder project and is currently at version 1.42.3, with updates frequently released alongside new boto3 versions or builder changes.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["mypy","boto3","aws","eks","eks-auth","type-hints","stubs"],"install":[{"cmd":"pip install mypy-boto3-eks-auth","lang":"bash","label":"Install package"}],"dependencies":[{"reason":"Provides the actual runtime client for AWS services, without which these type stubs have no runtime functionality.","package":"boto3","optional":false},{"reason":"Required to perform static type checking and leverage the type annotations provided by this library.","package":"mypy","optional":false},{"reason":"Runtime dependency for advanced type features, automatically installed.","package":"typing-extensions","optional":false}],"imports":[{"note":"Used to type-hint the boto3 EKSAuth client.","symbol":"EKSAuthClient","correct":"from mypy_boto3_eks_auth.client import EKSAuthClient"},{"note":"Example of importing a specific response TypeDef for granular type-hinting.","symbol":"GetTokenResponseTypeDef","correct":"from mypy_boto3_eks_auth.type_defs import GetTokenResponseTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_eks_auth.client import EKSAuthClient\nfrom mypy_boto3_eks_auth.type_defs import GetTokenResponseTypeDef\nimport os\n\n# Type-hint the boto3 client directly for static analysis\neks_auth_client: EKSAuthClient = boto3.client(\n    \"eks-auth\",\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-west-2') # EKS is region-specific\n)\n\nprint(f\"Client object type: {type(eks_auth_client)}\")\n\n# Demonstrating a method call that mypy would type-check.\n# This call requires a valid EKS cluster name and proper AWS credentials to succeed at runtime.\n# For quickstart, we wrap it in a try-except as it might fail without real setup.\ncluster_name = os.environ.get('EKS_CLUSTER_NAME', 'your-eks-cluster-name')\n\ntry:\n    # This will likely result in an authentication/authorization error without real AWS credentials\n    # and a valid EKS cluster configured.\n    response: GetTokenResponseTypeDef = eks_auth_client.get_token(clusterName=cluster_name)\n    print(f\"Successfully called get_token (type checked):\")\n    print(f\"  Token expiry: {response.get('expiration', 'N/A')}\")\nexcept Exception as e:\n    print(f\"Error calling get_token (expected without real setup or valid cluster): {e}\")\n\n# To verify type checking, you would run `mypy your_script_name.py`","lang":"python","description":"Demonstrates how to type-hint a `boto3` EKSAuth client using `mypy-boto3-eks-auth` for static analysis. It shows importing the client type and a response type, and type-hinting a client and its method call. Note that runtime execution of `get_token` requires valid AWS credentials and an existing EKS cluster."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or later.","message":"Python 3.8 support has been removed since `mypy-boto3-builder` version 8.12.0. Users must use Python 3.9 or newer.","severity":"breaking","affected_versions":">=8.12.0 (builder), >=1.42.3 (service package)"},{"fix":"Ensure your `mypy` configuration is up-to-date and correctly pointing to `site-packages` for stub discovery. In most cases, `mypy` should handle this automatically.","message":"Packages migrated to PEP 561 standard with `mypy-boto3-builder` version 8.12.0. This might affect how static analysis tools (like mypy) discover and utilize the stub files, especially in complex project setups.","severity":"breaking","affected_versions":">=8.12.0 (builder), >=1.42.3 (service package)"},{"fix":"Review your code for direct `from mypy_boto3_service.type_defs import ...` imports and update TypeDef names according to the latest package structure.","message":"TypeDef names were changed for clarity and to resolve conflicts in `mypy-boto3-builder` version 8.9.0. If you explicitly imported TypeDefs, their names might have changed (e.g., `CreateDistributionRequestRequestTypeDef` to `CreateDistributionRequestTypeDef`, or `Extra` postfix moved).","severity":"breaking","affected_versions":">=8.9.0 (builder)"},{"fix":"Ensure `boto3` is installed in your environment: `pip install boto3`.","message":"This package provides *type stubs* for `boto3`. You must also install `boto3` itself for your code to run at runtime.","severity":"gotcha","affected_versions":"all"},{"fix":"Install `mypy` (`pip install mypy`) and integrate it into your development workflow (e.g., `mypy your_script.py`).","message":"These type annotations are only effective when used with a static type checker like `mypy`. Without running `mypy`, you will not get the benefits of type checking.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}