Registry /
type-stubs / mypy-boto3-network-firewall
Install & Compatibility
Where this runs
tested against v1.43.81 · 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.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.7MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 1.7s · import 0.000s · 19MB
17MB installed
● package 17MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
NetworkFirewallClient
✓ from mypy_boto3_network_firewall import NetworkFirewallClient
✗ from mypy_boto3_network_firewall import NetworkFirewallClient
NetworkFirewallServiceResource
✓ from mypy_boto3_network_firewall import NetworkFirewallServiceResource
ServiceResource
✓ from mypy_boto3_network_firewall import ServiceResource
This quickstart demonstrates how to initialize a `boto3` NetworkFirewall client with type annotations and perform a basic operation like listing firewalls. The `TYPE_CHECKING` block ensures type hints are only present during type checking, avoiding runtime dependencies on `mypy-boto3-network-firewall`.
import boto3
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from mypy_boto3_network_firewall.client import NetworkFirewallClient
def list_network_firewalls():
# The AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are typically picked
# up from environment variables or AWS config files.
# Using os.environ.get for example purposes to avoid hardcoding credentials.
client: NetworkFirewallClient = boto3.client(
"network-firewall",
region_name=os.environ.get('AWS_REGION', 'us-east-1')
)
response = client.list_firewalls(
MaxResults=5 # Limit for demonstration
)
print("Found Firewalls:")
for firewall in response.get("Firewalls", []):
print(f" - {firewall.get('FirewallName')} ({firewall.get('FirewallArn')})")
if __name__ == "__main__":
import os
# Set dummy AWS credentials for local execution without actual AWS calls
# For actual execution, ensure valid credentials and region are configured.
os.environ['AWS_ACCESS_KEY_ID'] = os.environ.get('AWS_ACCESS_KEY_ID', 'testing')
os.environ['AWS_SECRET_ACCESS_KEY'] = os.environ.get('AWS_SECRET_ACCESS_KEY', 'testing')
os.environ['AWS_SESSION_TOKEN'] = os.environ.get('AWS_SESSION_TOKEN', 'testing')
try:
list_network_firewalls()
except Exception as e:
print(f"An error occurred: {e}")
Debug
Known issues
breakingSupport for Python 3.8 was removed in mypy-boto3-builder 8.12.0. As mypy-boto3-network-firewall 1.42.3 was generated with this builder version, it requires Python 3.9 or higher. Ensure your environment meets this requirement.fixUpgrade your Python environment to 3.9 or newer. Consider using Python 3.9+ for all `mypy-boto3-*` packages.
affects: mypy-boto3-builder >=8.12.0, mypy-boto3-network-firewall >=1.42.3
breakingThe `mypy-boto3-builder` (version 8.12.0) migrated to PEP 561 compliant packages. This change might affect how type checkers locate stubs in some environments or require a clean reinstall of stub packages.fixIf encountering issues with type checker discovery, perform a clean reinstall of `mypy-boto3-network-firewall` and ensure your `mypy` or `pyright` configuration is up to date.
affects: mypy-boto3-builder >=8.12.0, mypy-boto3-network-firewall >=1.42.3
gotchaThe version of `mypy-boto3-network-firewall` (e.g., 1.42.3) directly corresponds to the `boto3` and `botocore` version it provides stubs for, not the `mypy-boto3-builder` version. Ensure your installed `boto3` version is compatible with the `mypy-boto3-network-firewall` version for accurate type checking.fixInstall `boto3` with a version matching or closely compatible with your `mypy-boto3-network-firewall` package version. For example, if using `mypy-boto3-network-firewall==1.42.3`, install `boto3==1.42.3`.
affects: All versions
breakingThe `mypy-boto3-builder` (from version 8.9.0) introduced breaking changes to `TypeDef` naming conventions, such as shortening names for packed method arguments (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`) and moving the `Extra` postfix for conflicting names.fixIf you directly import and use `TypeDef` classes, you may need to update their names in your code to match the new conventions. Review the specific `type_defs` for `network-firewall` if you encounter type resolution errors.
affects: mypy-boto3-builder >=8.9.0
gotchaWhen using `mypy-boto3` stubs with Pylint, if you employ `TYPE_CHECKING` guards to conditionally import types, Pylint might incorrectly report `undefined-variable` warnings for the type-hinted variables. This is a known issue with Pylint.fixImplement the recommended workaround by conditionally setting the types to `object` outside the `TYPE_CHECKING` block. Example: `if TYPE_CHECKING: from mypy_boto3_ec2.client import EC2Client else: EC2Client = object`.
affects: All versions when used with Pylint
gotchaWhile static type checkers like mypy and pyright can often infer types, some IDEs (especially older versions of VSCode with Pylance) might require explicit type annotations for `boto3.client`, `boto3.session.client`, `client.get_waiter`, and `client.get_paginator` calls to provide full autocomplete and type hinting.fixExplicitly add type annotations to your `boto3` client, paginator, or waiter objects, as shown in the quickstart example, to ensure optimal IDE support.
affects: All versions when using certain IDEs/language servers
Upgrade
Version history
1.43.81latest on PyPI · released Aug 26, 2026
Audit
Dependencies
boto3requiredProvides type annotations for the boto3 library, specifically for the Network Firewall service. A compatible version of boto3 is required at runtime.
mypyoptionalA static type checker that consumes these annotations.
pyrightoptionalA static type checker that consumes these annotations.
typing-extensionsrequiredRequired for proper handling of certain type constructs in older Python versions supported by the builder, though less critical for Python 3.9+ which this package primarily targets.