mypy-boto3-resiliencehub Type Stubs
mypy-boto3-resiliencehub provides static type annotations for the `boto3` Resilience Hub service client. It is part of the `mypy-boto3` collection, generated by `mypy-boto3-builder`, aiming to improve developer experience by enabling type checking for AWS SDK for Python (boto3) code. The package version `1.42.3` corresponds to the `boto3` version it types. This project is actively maintained with frequent updates to align with new `boto3` releases and address issues.
Warnings
- breaking Python 3.8 support has been removed across all `mypy-boto3` packages. You must use Python 3.9 or higher.
- breaking TypeDef names for packed method arguments were shortened and conflicting names moved postfix. This affects direct imports of specific `TypeDef` classes.
- gotcha This package (`mypy-boto3-resiliencehub`) provides only type stubs. It does not include the runtime functionality of the `boto3` library. You must install `boto3` separately to use AWS services.
- gotcha This package provides type stubs for the Resilience Hub service specifically. If you need type annotations for other AWS services, you must install their respective `mypy-boto3-SERVICE_NAME` packages or the monolithic `mypy-boto3` package.
Install
-
pip install mypy-boto3-resiliencehub boto3
Imports
- ResilienceHubClient
from mypy_boto3_resiliencehub.client import ResilienceHubClient
- ListAppsOutputTypeDef
from mypy_boto3_resiliencehub.type_defs import ListAppsOutputTypeDef
Quickstart
import os
import boto3
from mypy_boto3_resiliencehub.client import ResilienceHubClient
from mypy_boto3_resiliencehub.type_defs import ListAppsOutputTypeDef
# Ensure boto3 is configured, e.g., via AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION_NAME env vars
# Or AWS_PROFILE and AWS_REGION
region_name = os.environ.get('AWS_REGION_NAME', 'us-east-1')
client: ResilienceHubClient = boto3.client("resiliencehub", region_name=region_name)
try:
print(f"Attempting to list Resilience Hub applications in {region_name}...")
response: ListAppsOutputTypeDef = client.list_apps()
apps = response.get('apps', [])
print(f"Successfully listed {len(apps)} Resilience Hub applications.")
for app in apps:
print(f" - App Name: {app.get('name')}, Status: {app.get('status')}")
except Exception as e:
print(f"Error listing Resilience Hub applications: {e}")
print("Please ensure you have configured AWS credentials and the ResilienceHub service is available in your region.")