{"id":3063,"library":"mypy-boto3-config","title":"mypy-boto3-config - Boto3 ConfigService Type Stubs","description":"mypy-boto3-config provides comprehensive type annotations for the AWS Boto3 ConfigService client, enabling static type checking with tools like MyPy. It is part of the `mypy-boto3` ecosystem, which generates stubs for all Boto3 services. Updates are frequent, often aligned with Boto3 releases and `mypy-boto3-builder` enhancements, with the current version being 1.42.68.","status":"active","version":"1.42.68","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["mypy","boto3","aws","type-hinting","stubs","configservice","static-analysis"],"install":[{"cmd":"pip install mypy-boto3-config","lang":"bash","label":"Install service stubs"},{"cmd":"pip install 'boto3<2'","lang":"bash","label":"Install boto3 (if not already)"}],"dependencies":[{"reason":"Provides the actual AWS SDK runtime, these are only type stubs.","package":"boto3","optional":false},{"reason":"Required for static type checking against the stubs.","package":"mypy","optional":true}],"imports":[{"note":"Boto3 itself does not export specific service client types; these are provided by mypy-boto3 stubs.","wrong":"from boto3.client import ConfigServiceClient","symbol":"ConfigServiceClient","correct":"from mypy_boto3_config.client import ConfigServiceClient"},{"note":"TypeDefs are specific to the mypy-boto3 stubs and not part of boto3's public interface.","wrong":"from boto3.type_defs import DescribeConfigurationRecordersResponseTypeDef","symbol":"DescribeConfigurationRecordersResponseTypeDef","correct":"from mypy_boto3_config.type_defs import DescribeConfigurationRecordersResponseTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_config.client import ConfigServiceClient\nfrom mypy_boto3_config.type_defs import DescribeConfigurationRecordersResponseTypeDef\nimport os\n\ndef check_config_recorders() -> None:\n    # Initialize the Boto3 client, type-hinted with mypy-boto3-config's client type\n    config_client: ConfigServiceClient = boto3.client(\n        \"config\",\n        region_name=os.environ.get(\"AWS_REGION\", \"us-east-1\")\n    )\n\n    try:\n        # Call a method and type-hint its response\n        response: DescribeConfigurationRecordersResponseTypeDef = config_client.describe_configuration_recorders()\n        print(f\"Configuration recorders found: {len(response['ConfigurationRecorders'])}\")\n        for recorder in response[\"ConfigurationRecorders\"]:\n            strategy = recorder.get('recordingGroup', {}).get('recordingStrategy', {}).get('recordingStrategyType', 'N/A')\n            print(f\"- {recorder['name']} (Status: {strategy})\")\n    except Exception as e:\n        print(f\"Error describing configuration recorders: {e}\")\n\nif __name__ == \"__main__\":\n    # Ensure AWS_REGION is set in your environment or replace 'us-east-1'\n    # For real applications, use proper credential management.\n    check_config_recorders()\n","lang":"python","description":"This quickstart demonstrates how to initialize a Boto3 ConfigService client and use the `mypy-boto3-config` stubs to add type hints for both the client object and its method responses, enhancing static analysis."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Support for Python 3.8 has been removed from `mypy-boto3-builder` version 8.12.0 onwards, which generates these stubs. This means `mypy-boto3-config` versions generated by `builder>=8.12.0` will not support Python 3.8.","severity":"breaking","affected_versions":"mypy-boto3-builder>=8.12.0 (and generated packages)"},{"fix":"Review and update TypeDef names in your type hints if you encounter `NameError` or type checking failures after upgrading.","message":"TypeDef naming conventions changed in `mypy-boto3-builder` 8.9.0. Some deeply nested or conflicting TypeDef names may have been shortened or reordered (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`).","severity":"breaking","affected_versions":"mypy-boto3-builder>=8.9.0 (and generated packages)"},{"fix":"Ensure `pip install boto3` is run alongside `pip install mypy-boto3-config`.","message":"These packages provide type stubs for static analysis (e.g., MyPy) only; they do not include the Boto3 runtime. You must install `boto3` separately for your code to function.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Regularly update `mypy-boto3-config` when you update `boto3` to ensure consistency.","message":"For optimal type checking accuracy, the version of `mypy-boto3-config` should ideally match or be newer than your installed `boto3` version to reflect the latest AWS API changes.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}