mypy-boto3-launch-wizard

1.42.30 · active · verified Sat Apr 11

mypy-boto3-launch-wizard provides type annotations for the `boto3` LaunchWizard service. It is currently at version 1.42.30 and is part of the `mypy-boto3` ecosystem, with new versions released regularly in sync with `boto3` updates, generated by `mypy-boto3-builder`.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to obtain a type-hinted AWS LaunchWizard client using `boto3` and the `mypy-boto3-launch-wizard` stubs. It uses a `TYPE_CHECKING` block to ensure the stubs are only used for static analysis, preventing a runtime dependency if desired.

import boto3
from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from mypy_boto3_launch_wizard.client import LaunchWizardClient


def get_launch_wizard_client() -> LaunchWizardClient:
    """Provides a type-hinted AWS LaunchWizard client."""
    # boto3.client is dynamically typed, so explicit annotation is needed for mypy
    client: LaunchWizardClient = boto3.client(
        "launch-wizard",
        region_name=os.environ.get('AWS_DEFAULT_REGION', 'us-east-1'),
        aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', ''),
        aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', '')
    )
    return client

# Example usage:
if __name__ == "__main__":
    import os
    client = get_launch_wizard_client()
    try:
        # Replace with an actual LaunchWizard API call, e.g., listing deployments
        # This will provide type hints for available methods and parameters
        response = client.list_deployments()
        print("Successfully retrieved LaunchWizard deployments (or similar call).")
        print(f"Deployments: {response.get('deployments', [])}")
    except Exception as e:
        print(f"An error occurred: {e}")
        print("Ensure AWS credentials and region are configured.")

view raw JSON →