Registry / type-stubs / mypy-boto3-cloudcontrol

mypy-boto3-cloudcontrol

JSON →
library1.42.3pypypiunverified

mypy-boto3-cloudcontrol provides type annotations for the AWS boto3 CloudControlApi service. It is part of the larger `mypy-boto3-builder` ecosystem, which generates stubs for all boto3 services. This specific package, currently at version 1.42.3, helps static type checkers like Mypy understand the dynamic nature of boto3 clients, offering improved code completion, error detection, and overall developer experience for Cloud Control API interactions. The builder project releases frequently, often synchronizing with `boto3` and `botocore` updates.

type-stubsawshttp-networking
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
musl
glibc
py 3.10
4/5 runs
4/5 runs
py 3.11
4/5 runs
4/5 runs
py 3.12
4/5 runs
4/5 runs
py 3.13
4/5 runs
4/5 runs
py 3.9
4/5 runs
4/5 runs
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

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.

from mypy_boto3_cloudcontrol.client import CloudControlClient

Type definitions for response structures and request parameters are available in the `type_defs` submodule.

from mypy_boto3_cloudcontrol.type_defs import ResourceDescriptionTypeDef

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 footguns
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.
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.
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`).
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.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
17 hits · last 30 days
gptbot
4
ahrefsbot
4
bytedance
4
script
1
Resources