{"library":"mypy-boto3-ecs","title":"mypy-boto3-ecs","description":"mypy-boto3-ecs provides type annotations for the AWS boto3 ECS (Elastic Container Service) client, resources, and paginators. It is part of the `mypy-boto3` project, which generates stubs for all boto3 services. The current version is 1.42.88, with frequent releases synchronized with new `boto3` versions and `mypy-boto3-builder` updates.","language":"python","status":"active","last_verified":"Thu May 14","install":{"commands":["pip install boto3 mypy-boto3-ecs mypy"],"cli":null},"imports":["from mypy_boto3_ecs.client import ECSClient","from mypy_boto3_ecs.service_resource import ECSResource","from mypy_boto3_ecs.paginator import ListClustersPaginator"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import boto3\nfrom mypy_boto3_ecs.client import ECSClient\nfrom typing import TYPE_CHECKING\n\n# Ensure boto3 is installed: pip install boto3 mypy-boto3-ecs\n\nif TYPE_CHECKING:\n    # This block is only for type checking, not runtime execution\n    client: ECSClient = boto3.client(\"ecs\")\n    \n    # Example usage with type hints\n    response = client.list_clusters()\n    for cluster in response.get(\"clusters\", []):\n        print(f\"Cluster ARN: {cluster.get('clusterArn')}\")\n\nelse:\n    # Runtime code without explicit type hints (mypy will still check)\n    client = boto3.client(\"ecs\")\n    response = client.list_clusters()\n    for cluster in response.get(\"clusters\", []):\n        print(f\"Cluster Name: {cluster.get('clusterName')}\")","lang":"python","description":"This example demonstrates how to use `mypy-boto3-ecs` with `boto3` to gain static type checking for the ECS client. The `TYPE_CHECKING` block ensures that type-specific imports do not affect runtime behavior. You need to run `mypy your_script.py` to see the benefits.","tag":null,"tag_description":null,"last_tested":"2026-04-25","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-14","installed_version":"1.43.0","pypi_latest":"1.43.0","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":5.9,"avg_import_s":0.77,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"boto3","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.66,"mem_mb":15.2,"disk_size":"115.2M"},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"boto3","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.7,"mem_mb":15.1,"disk_size":"110.2M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"boto3","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":6.2,"import_time_s":0.52,"mem_mb":15.2,"disk_size":"114M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"boto3","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.58,"mem_mb":15.1,"disk_size":"109M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"boto3","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.01,"mem_mb":16.9,"disk_size":"121.4M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"boto3","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":1.16,"mem_mb":16.8,"disk_size":"116.4M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"boto3","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":5.7,"import_time_s":1.01,"mem_mb":16.9,"disk_size":"120M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"boto3","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.89,"mem_mb":16.8,"disk_size":"115M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"boto3","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.77,"mem_mb":15.9,"disk_size":"113.1M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"boto3","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.86,"mem_mb":15.8,"disk_size":"108.0M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"boto3","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":5.2,"import_time_s":0.8,"mem_mb":15.9,"disk_size":"112M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"boto3","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.9,"mem_mb":15.8,"disk_size":"107M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"boto3","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.76,"mem_mb":17.2,"disk_size":"113.0M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"boto3","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.96,"mem_mb":17.1,"disk_size":"107.7M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"boto3","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":5,"import_time_s":0.76,"mem_mb":17.2,"disk_size":"112M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"boto3","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.87,"mem_mb":17.1,"disk_size":"107M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"boto3","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.54,"mem_mb":14.2,"disk_size":"106.7M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"boto3","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.59,"mem_mb":14.2,"disk_size":"106.0M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"boto3","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":7.4,"import_time_s":0.55,"mem_mb":14.2,"disk_size":"106M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"boto3","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.51,"mem_mb":14.2,"disk_size":"105M"}]}}