Types for aiobotocore ACM Service
types-aiobotocore-acm provides type annotations for the aiobotocore AWS Certificate Manager (ACM) service client, generated by mypy-boto3-builder. These annotations enable static type checking with tools like MyPy, Pyright, and enhance IDE auto-completion for asynchronous AWS client interactions. The library maintains a versioning in sync with the corresponding aiobotocore and botocore versions and is actively developed with frequent releases.
Common errors
-
ModuleNotFoundError: No module named 'aiobotocore.session'
cause The `aiobotocore` library itself is not installed.fixInstall the `aiobotocore` library: `pip install aiobotocore`. -
ModuleNotFoundError: No module named 'types_aiobotocore_acm.client'
cause The `types-aiobotocore-acm` type stub package is not installed or incorrectly installed.fixInstall `types-aiobotocore-acm`: `pip install types-aiobotocore-acm` or `pip install 'types-aiobotocore[acm]'`. -
error: Need type annotation for 'client' (hint: "client: Any = ...")
cause MyPy or another type checker cannot infer the type of the `aiobotocore` client, usually because an explicit type hint (e.g., `client: ACMClient`) is missing or the type stubs are not correctly picked up.fixAdd an explicit type annotation for your client variable: `client: ACMClient = await session.create_client("acm")`. -
error: Argument 'CertificateStatuses' to 'list_certificates' of 'ACMClient' has incompatible type 'List[str]'; expected 'List[CertificateStatusType]' [arg-type]
cause Using a string literal that is not a valid `CertificateStatusType` or a mistyped list of strings when the stub expects specific literal types.fixEnsure the values passed match the `types_aiobotocore_acm.literals.CertificateStatusType` or other specific TypedDict/Literal types. Import literals for clarity, e.g., `from types_aiobotocore_acm.literals import CertificateStatusType`.
Warnings
- breaking Support for Python 3.8 was officially removed with mypy-boto3-builder version 8.12.0. Users on Python 3.8 will need to upgrade their Python version to 3.9 or newer to use current versions of `types-aiobotocore-acm`.
- breaking TypeDef names for packed method arguments were shortened (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`) and conflicting `Extra` postfixes were moved (e.g., `CreateDistributionExtraRequestTypeDef` -> `CreateDistributionRequestExtraTypeDef`). This affects type hint usage for request/response dictionaries.
- gotcha This package provides only type annotations (stubs) and does not include the actual `aiobotocore` library. You must install `aiobotocore` separately for the code to run, otherwise you will encounter `ModuleNotFoundError` for `aiobotocore` components.
- gotcha Since `mypy-boto3-builder` migrated to PEP 561 packages, type checkers typically auto-discover types. However, for explicit typing or complex environments (e.g., custom `MYPYPATH`), ensure your type checker is correctly configured to find stub packages. `types-aiobotocore-lite` users must always use explicit type annotations.
Install
-
pip install types-aiobotocore-acm -
pip install 'types-aiobotocore[acm]'
Imports
- ACMClient
from types_aiobotocore_acm.client import ACMClient
- get_session
from aiobotocore.session import get_session
Quickstart
import asyncio
from aiobotocore.session import get_session
from types_aiobotocore_acm.client import ACMClient
async def list_acm_certificates():
session = get_session()
async with session.create_client("acm", region_name="us-east-1") as client:
client: ACMClient # Explicit type annotation for the client
response = await client.list_certificates(CertificateStatuses=['ISSUED'])
for cert in response.get('CertificateSummaryList', []):
print(f"Certificate ARN: {cert['CertificateArn']}")
if __name__ == "__main__":
asyncio.run(list_acm_certificates())