Install & Compatibility
Where this runs
tested against v1.43.12 · 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.584s · 51.9MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.8s · import 0.548s · 52MB
50MB installed
● package 50MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
MWAAClient
✓ from mypy_boto3_mwaa import MWAAClient
✗ from boto3.client import MWAAClient
Type stubs are imported from the `mypy_boto3_mwaa` package, not directly from `boto3`.
CreateEnvironmentRequestRequestTypeDef
✓ from mypy_boto3_mwaa.type_defs import CreateEnvironmentRequestRequestTypeDef
Specific TypedDicts for API request/response structures are found in `type_defs`.
This quickstart demonstrates how to initialize a `boto3` client for MWAA and apply the `MWAAClient` type annotation. It also shows an example of using a `TypedDict` for a request, which is common for complex `boto3` API calls. Remember to install `boto3` alongside the type stubs.
import boto3
from mypy_boto3_mwaa import MWAAClient
from mypy_boto3_mwaa.type_defs import CreateEnvironmentRequestRequestTypeDef
def create_mwaa_environment(
env_name: str,
bucket_name: str,
execution_role_arn: str
) -> dict:
client: MWAAClient = boto3.client('mwaa')
# Example of using a TypedDict for a complex request body
environment_config: CreateEnvironmentRequestRequestTypeDef = {
'Name': env_name,
'SourceBucketArn': f'arn:aws:s3:::{bucket_name}',
'ExecutionRoleArn': execution_role_arn,
'AirflowVersion': '2.6.3',
'EnvironmentClass': 'mw1.small',
'MaxWorkers': 1,
'NetworkConfiguration': {
'SubnetIds': ['subnet-xxxxxxxxxxxxxxxxx'], # Replace with actual subnet IDs
'SecurityGroupIds': ['sg-xxxxxxxxxxxxxxxxx'] # Replace with actual security group IDs
}
}
# This call is for demonstration and requires a valid MWAA setup
# response = client.create_environment(**environment_config)
# print(f"Environment creation initiated: {response}")
# For a simple type-checked call, without actual creation:
list_envs_response = client.list_environments()
print(f"Listed MWAA environments: {list_envs_response.get('Environments')}")
return list_envs_response
# Example usage (requires valid AWS credentials and configuration)
# This code will run and show type checking benefits even if the API call is commented out
if __name__ == "__main__":
# Replace with your actual values for a real run
# env_name = "my-airflow-env"
# bucket_name = "my-airflow-bucket"
# execution_role_arn = "arn:aws:iam::123456789012:role/MyMWAAExecutionRole"
# create_mwaa_environment(env_name, bucket_name, execution_role_arn)
create_mwaa_environment(
'example-env', 'example-bucket', 'arn:aws:iam::123456789012:role/ExampleRole'
)
Debug
Known issues
breakingStarting with `mypy-boto3-builder` version 8.12.0 (and consequently packages like `mypy-boto3-mwaa` released after it), support for Python 3.8 has been removed. Projects requiring Python 3.8 should use older versions of `mypy-boto3` packages.fixUpgrade to Python 3.9 or higher, or pin `mypy-boto3-mwaa` to an older version compatible with Python 3.8 (e.g., `<1.42.0`).
affects: >=8.12.0 (builder), corresponding client packages
gotchaThe version of `mypy-boto3-mwaa` should ideally match the version of `boto3` used at runtime. Mismatched versions can lead to incorrect type hints or `mypy` errors, especially when `boto3` introduces new features or changes existing APIs.fixEnsure `pip install boto3==X.Y.Z mypy-boto3-mwaa==X.Y.Z` where X.Y.Z is the desired `boto3` version.
affects: All versions
gotchaThis package provides *only* type annotations for `boto3`. It does not include the `boto3` library itself. You must install `boto3` separately for your application to function at runtime.fixAlways install `boto3` alongside `mypy-boto3-mwaa` (e.g., `pip install boto3 mypy-boto3-mwaa`).
affects: All versions
breakingThe `mypy-boto3-builder` (which generates `mypy-boto3-mwaa`) sometimes changes the naming conventions for generated `TypedDict`s. For example, `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef` in `builder` v8.9.0. If you explicitly import and use specific `TypedDict` names, these changes can break your type checks.fixReview your `type_defs` imports after major `mypy-boto3` package upgrades and update `TypedDict` names as necessary. Rely on IDE auto-completion for correct names.
affects: From `builder` v8.9.0 onwards, specific service `TypedDict`s
Upgrade
Version history
1.43.12latest on PyPI · released May 20, 2026
Audit
Dependencies
boto3requiredThis package provides type stubs for boto3; boto3 itself is required for runtime functionality.