mypy-boto3-fis

1.42.3 · active · verified Sat Apr 11

mypy-boto3-fis provides comprehensive type annotations for the AWS FIS (Fault Injection Service) client in boto3. It is part of the `boto3-stubs` ecosystem, actively generated and maintained by `mypy-boto3-builder` (version 8.12.0), with frequent releases that align with boto3 updates to ensure up-to-date type checking capabilities for Python >=3.9.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to obtain a type-hinted FIS client and use it to list experiments. Explicitly annotating the client type (`client: FISClient`) is often recommended for better IDE support and static analysis. It also shows importing and using a TypedDict for the response structure. The `TYPE_CHECKING` block ensures that stub imports are only used during type checking.

import boto3
from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from mypy_boto3_fis import FISClient
    from mypy_boto3_fis.type_defs import ListExperimentsOutputTypeDef

    # Example of a TypedDict for a specific request parameter
    from mypy_boto3_fis.type_defs import ExperimentTemplateSummaryTypeDef

def list_fis_experiments() -> list['ExperimentTemplateSummaryTypeDef']:
    client: FISClient = boto3.client('fis')
    response: ListExperimentsOutputTypeDef = client.list_experiments()
    return response.get('experimentSummaries', [])

# Example usage (will not be type-checked at runtime by mypy-boto3-fis)
if __name__ == "__main__":
    try:
        experiments = list_fis_experiments()
        print(f"Found {len(experiments)} FIS experiments.")
        for experiment in experiments:
            print(f" - {experiment.get('id')}: {experiment.get('state', {}).get('status')}")
    except Exception as e:
        print(f"Error listing FIS experiments: {e}")

view raw JSON →