mypy-boto3-mwaa-serverless

1.42.3 · active · verified Sat Apr 11

This package provides type annotations for the `boto3` MWAA Serverless service, generated by `mypy-boto3-builder`. It enhances type checking for `boto3` users, allowing tools like MyPy to validate usage of the `mwaa-serverless` client. The library follows a frequent release cadence, typically updated with new `boto3` versions and `mypy-boto3-builder` enhancements.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to initialize a `boto3` client for MWAA Serverless and use it with type annotations provided by `mypy-boto3-mwaa-serverless`. It shows importing the `MWAAServerlessClient` type and using it to hint a `boto3` client, then making a sample `list_environments` call. Remember that `boto3` itself must be installed and configured for actual runtime execution.

import boto3
from mypy_boto3_mwaa_serverless.client import MWAAServerlessClient
from typing import TYPE_CHECKING

# This block is for type-checking only, for documentation of what types are available
if TYPE_CHECKING:
    # Example of importing a specific TypeDef for request/response structures
    from mypy_boto3_mwaa_serverless.type_defs import ListEnvironmentsResponseTypeDef

def get_mwaa_client() -> MWAAServerlessClient:
    """
    Returns a type-hinted MWAA Serverless client using boto3.
    """
    # 'mwaa-serverless' is the correct service name for boto3 client creation
    return boto3.client("mwaa-serverless")

def list_mwaa_environments(client: MWAAServerlessClient) -> None:
    """
    Lists MWAA Serverless environments with type annotations.
    """
    # The client method call itself is from boto3, type-checked by mypy-boto3-mwaa-serverless
    response: ListEnvironmentsResponseTypeDef = client.list_environments()
    print("MWAA Environments:")
    for env in response.get('Environments', []):
        print(f"  - Name: {env.get('Name')}, Status: {env.get('Status')}")

if __name__ == "__main__":
    # Ensure AWS credentials are configured (e.g., via environment variables, ~/.aws/credentials)
    mwaa_client = get_mwaa_client()
    list_mwaa_environments(mwaa_client)

view raw JSON →