mypy-boto3-acm

1.42.80 · active · verified Sat Apr 11

mypy-boto3-acm provides type annotations for the `boto3` AWS Certificate Manager (ACM) service, generated by the `mypy-boto3-builder`. It enhances static analysis for `boto3` code, enabling robust type checking with tools like MyPy, Pyright, VSCode, and PyCharm. The library is currently at version 1.42.80, aligning with `boto3` versions, and is part of an actively maintained project with frequent updates.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to use `mypy-boto3-acm` for type-hinting a `boto3` ACM client. It shows importing `ACMClient` and a relevant `TypeDef` for type-checking the response of `list_certificates`. The `TYPE_CHECKING` block ensures these imports are only used by type checkers, avoiding runtime dependencies if desired.

from typing import TYPE_CHECKING
import boto3

if TYPE_CHECKING:
    from mypy_boto3_acm.client import ACMClient
    from mypy_boto3_acm.type_defs import CertificateSummaryTypeDef

    # Example of a TypedDict for a specific API response item
    # For a full list, refer to the mypy-boto3-acm documentation

def get_acm_certificates() -> list['CertificateSummaryTypeDef']:
    client: ACMClient = boto3.client("acm")
    response = client.list_certificates()
    certificates = response.get("CertificateSummaryList", [])
    return certificates

if __name__ == "__main__":
    # Example usage (requires AWS credentials configured)
    try:
        certs = get_acm_certificates()
        if certs:
            print(f"Found {len(certs)} ACM certificates:")
            for cert in certs:
                print(f"  ARN: {cert['CertificateArn']}, Domain: {cert.get('DomainName')}")
        else:
            print("No ACM certificates found.")
    except Exception as e:
        print(f"Error retrieving certificates: {e}")

view raw JSON →