Registry /
type-stubs / mypy-boto3-cloudcontrol
Install & Compatibility
Where this runs
tested against v1.43.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 116.5MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 6.0s · import 0.000s · 114MB
114MB installed
● package 114MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
CloudControlClient
✓ from mypy_boto3_cloudcontrol.client import CloudControlClient
✗ from boto3.client import CloudControlClient
The `boto3` library does not expose directly typed client classes. `mypy-boto3-cloudcontrol` provides the static type definition for type checkers. Imports of type definitions are typically guarded by `if TYPE_CHECKING:` to avoid runtime dependency.
ResourceDescriptionTypeDef
✓ from mypy_boto3_cloudcontrol.type_defs import ResourceDescriptionTypeDef
Type definitions for response structures and request parameters are available in the `type_defs` submodule.
This quickstart demonstrates how to use `mypy-boto3-cloudcontrol` for type hinting an AWS Cloud Control API client. It shows importing the `CloudControlClient` type within a `TYPE_CHECKING` block to ensure `mypy-boto3-cloudcontrol` is only a development dependency. The `boto3` runtime client is then instantiated and passed to a function with explicit type hints, enabling static analysis by `mypy`.
from typing import TYPE_CHECKING
import boto3
import os
# Only import type stubs when type checking
if TYPE_CHECKING:
from mypy_boto3_cloudcontrol.client import CloudControlClient
from mypy_boto3_cloudcontrol.type_defs import ListResourcesOutputTypeDef
def list_cloud_control_resources(client: 'CloudControlClient') -> 'ListResourcesOutputTypeDef':
"""Lists resources managed by AWS Cloud Control API."""
# Example: List up to 10 resources of a specific type
# Replace 'AWS::S3::Bucket' with an actual resource type if needed
response = client.list_resources(
TypeName='AWS::S3::Bucket', # Use a valid AWS resource type
MaxResults=10
)
print(f"Found {len(response.get('ResourceDescriptions', []))} resources.")
for resource in response.get('ResourceDescriptions', []):
print(f" - ID: {resource.get('Identifier')}, Name: {resource.get('ResourceModel')}")
return response
if __name__ == "__main__":
# Ensure AWS credentials are configured (e.g., via environment variables or AWS CLI)
# This is a runtime client, not directly from mypy-boto3-cloudcontrol
session = boto3.Session(
aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', ''),
aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', ''),
aws_session_token=os.environ.get('AWS_SESSION_TOKEN', ''),
region_name=os.environ.get('AWS_REGION', 'us-east-1')
)
cloudcontrol_client: 'CloudControlClient' = session.client("cloudcontrol")
try:
list_cloud_control_resources(cloudcontrol_client)
except Exception as e:
print(f"An error occurred: {e}")
print("Make sure 'AWS::S3::Bucket' (or chosen TypeName) is a valid and accessible resource type.")
# To run mypy:
# mypy your_script_name.py
Debug
Known issues
breakingPython 3.8 support was removed starting with `mypy-boto3-builder` version 8.12.0 (and thus for generated packages like `mypy-boto3-cloudcontrol`). Projects using Python 3.8 will need to upgrade to Python 3.9 or newer.fixUpgrade your Python environment to 3.9 or higher. For older Python versions, pin `mypy-boto3-builder` and generated stub packages to versions prior to 8.12.0.
affects: >=8.12.0 of mypy-boto3-builder (and corresponding stub package versions)
breakingThe builder migrated to PEP 561 compatible packages in version 8.12.0. While this is generally an improvement for type checker discovery, it's a significant packaging change that might affect build systems or older `mypy` versions.fixEnsure your `mypy` and `pip` versions are up-to-date. If issues arise with type discovery, consult the `mypy-boto3-builder` documentation for any specific `mypy` configuration changes or package root settings.
affects: >=8.12.0 of mypy-boto3-builder (and corresponding stub package versions)
breakingTypeDef naming conventions changed in `mypy-boto3-builder` version 8.9.0. Specifically, redundant 'Request' suffixes were removed (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`), and conflicting 'Extra' postfixes were moved (e.g., `CreateDistributionExtraRequestTypeDef` became `CreateDistributionRequestExtraTypeDef`).fixUpdate explicit imports of TypeDefs to reflect the new naming conventions. This primarily impacts users who directly import TypeDefs by their full names.
affects: >=8.9.0 of mypy-boto3-builder (and corresponding stub package versions)
gotcha`mypy-boto3-cloudcontrol` provides only type annotations; it is not a runtime dependency. You must still install and use the `boto3` library for actual AWS interactions. Importing `mypy-boto3` types directly without `if TYPE_CHECKING:` can make it an unnecessary runtime dependency.fixAlways install `boto3` alongside `mypy-boto3-cloudcontrol`. Wrap explicit type imports (e.g., `from mypy_boto3_cloudcontrol.client import CloudControlClient`) within an `if TYPE_CHECKING:` block to keep `mypy-boto3-cloudcontrol` as a development-only dependency.
affects: All versions
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
boto3requiredProvides the runtime functionality for interacting with AWS services. `mypy-boto3-cloudcontrol` only provides type stubs, not the actual client implementation.
mypyrequiredThe primary static type checker that utilizes these type stubs to perform type analysis.