{"id":3164,"library":"mypy-boto3-vpc-lattice","title":"mypy-boto3-vpc-lattice","description":"mypy-boto3-vpc-lattice provides type annotations for the `boto3` AWS SDK's VPCLattice service, compatible with `mypy`, `pyright`, VSCode, and PyCharm. It's automatically generated by `mypy-boto3-builder` and aims to enhance static type checking for `boto3` users. The project follows a frequent release cadence, often synchronizing with `boto3` updates and `mypy-boto3-builder` enhancements.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["type-hints","mypy","boto3","aws","vpc-lattice","typings"],"install":[{"cmd":"pip install mypy-boto3-vpc-lattice boto3","lang":"bash","label":"Install specific service stubs and boto3"},{"cmd":"pip install 'boto3-stubs[vpc-lattice]' boto3","lang":"bash","label":"Install via boto3-stubs extra and boto3"}],"dependencies":[{"reason":"This package provides type stubs for boto3; boto3 itself is required at runtime for the type hints to be useful.","package":"boto3","optional":false},{"reason":"A type checker like mypy or pyright is necessary to utilize the provided type annotations.","package":"mypy","optional":true}],"imports":[{"note":"Imports the type-hinted client for AWS VPC Lattice service.","symbol":"VPCLatticeClient","correct":"from mypy_boto3_vpc_lattice.client import VPCLatticeClient"},{"note":"Imports the type-hinted paginator for listing services.","symbol":"ListServicesPaginator","correct":"from mypy_boto3_vpc_lattice.paginator import ListServicesPaginator"},{"note":"Imports a common TypeDef for VPC Lattice service summaries.","symbol":"ServiceSummaryTypeDef","correct":"from mypy_boto3_vpc_lattice.type_defs import ServiceSummaryTypeDef"}],"quickstart":{"code":"import os\nfrom typing import TYPE_CHECKING\nimport boto3\n\n# These imports are only for type checking and won't be evaluated at runtime\nif TYPE_CHECKING:\n    from mypy_boto3_vpc_lattice.client import VPCLatticeClient\n    from mypy_boto3_vpc_lattice.type_defs import ServiceSummaryTypeDef\n\ndef list_vpc_lattice_services() -> list[\"ServiceSummaryTypeDef\"]:\n    # Initialize a boto3 client (runtime object)\n    # The type checker uses the VPCLatticeClient stub for this call\n    client: VPCLatticeClient = boto3.client(\"vpc-lattice\", region_name=os.environ.get('AWS_REGION', 'us-east-1'))\n    \n    print(\"Listing VPC Lattice services...\")\n    response = client.list_services()\n    services = response.get(\"items\", [])\n    \n    for service in services:\n        print(f\"  Service ID: {service.get('id')}, Name: {service.get('name')}\")\n    \n    return services\n\nif __name__ == \"__main__\":\n    # Set a dummy AWS_REGION for local execution if not already set\n    # In a real scenario, credentials/region would be configured via env vars, ~/.aws/config, etc.\n    if 'AWS_REGION' not in os.environ:\n        os.environ['AWS_REGION'] = 'us-east-1'\n\n    try:\n        # This call will actually execute and might require AWS credentials\n        services = list_vpc_lattice_services()\n        print(f\"Found {len(services)} VPC Lattice services.\")\n    except Exception as e:\n        print(f\"An error occurred: {e}. Make sure you have AWS credentials configured.\")\n","lang":"python","description":"This quickstart demonstrates how to use `mypy-boto3-vpc-lattice` for type-hinting a `boto3` VPC Lattice client. The `TYPE_CHECKING` block ensures that the type stub imports are only active during static analysis, avoiding runtime dependencies on the stub package. The `boto3.client` call returns the actual runtime client, which `mypy` (or another type checker) will understand as `VPCLatticeClient` thanks to the installed stubs."},"warnings":[{"fix":"Upgrade to Python 3.9+ or pin `mypy-boto3-vpc-lattice` to a version compatible with Python 3.8.","message":"Support for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0, affecting all generated `mypy-boto3` packages. Users on Python 3.8 must pin to an older version of `mypy-boto3-vpc-lattice` (prior to versions generated by builder 8.12.0) or upgrade their Python environment.","severity":"breaking","affected_versions":">=8.12.0 of mypy-boto3-builder (affecting mypy-boto3-vpc-lattice versions built with it)"},{"fix":"Review and update explicit TypeDef imports and usage in your code to match the new naming conventions.","message":"In `mypy-boto3-builder` version 8.9.0, there were breaking changes to TypeDef naming conventions. Packed method arguments now use shorter names (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`), and conflicting `Extra` postfixes were moved to the end of the name (e.g., `CreateDistributionExtraRequestTypeDef` -> `CreateDistributionRequestExtraTypeDef`). This may require updates to explicit TypeDef annotations in user code.","severity":"breaking","affected_versions":">=8.9.0 of mypy-boto3-builder (affecting mypy-boto3-vpc-lattice versions built with it)"},{"fix":"Ensure `pip install boto3` is executed in your environment alongside `mypy-boto3-vpc-lattice`.","message":"This package provides only type annotations for `boto3`. You must install `boto3` separately for your code to run. This package is solely for static analysis tools like `mypy` or `pyright`.","severity":"gotcha","affected_versions":"All"},{"fix":"Switch to `boto3-stubs-lite` for IDE performance, or use an external type checker.","message":"PyCharm's built-in type checker can experience slow performance or high CPU usage with the full `boto3-stubs` packages due to complex Literal overloads. For better IDE performance, consider using `boto3-stubs-lite` (e.g., `pip install 'boto3-stubs-lite[vpc-lattice]'`) or disabling PyCharm's type checker and relying on external tools like `mypy` or `pyright`.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}