{"id":4298,"library":"types-boto3-rds","title":"Type annotations for boto3 RDS","description":"types-boto3-rds provides static type annotations for the Amazon Relational Database Service (RDS) client in the `boto3` library. It enhances development experience by offering robust code completion, type checking, and error detection in IDEs and with static analysis tools like Mypy and Pyright. This package is generated by `mypy-boto3-builder` version 8.12.0 and currently aligns with `boto3` version 1.42.75, with frequent updates to match `boto3` releases.","status":"active","version":"1.42.75","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["type-hints","boto3","aws","rds","mypy","pyright","typing"],"install":[{"cmd":"pip install types-boto3-rds","lang":"bash","label":"Install specific RDS type stubs"},{"cmd":"pip install 'types-boto3[rds]' # Install via types-boto3 extras","lang":"bash","label":"Install via types-boto3 essential extras"}],"dependencies":[{"reason":"Provides type stubs for this library; must be installed separately.","package":"boto3","optional":false}],"imports":[{"symbol":"RDSClient","correct":"from types_boto3_rds.client import RDSClient"},{"symbol":"DBInstanceTypeDef","correct":"from types_boto3_rds.type_defs import DBInstanceTypeDef"},{"symbol":"DescribeDBInstancesOutputTypeDef","correct":"from types_boto3_rds.type_defs import DescribeDBInstancesOutputTypeDef"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING, List\nimport os\n\nif TYPE_CHECKING:\n    from types_boto3_rds.client import RDSClient\n    from types_boto3_rds.type_defs import DBInstanceTypeDef, DescribeDBInstancesOutputTypeDef\n\ndef get_typed_rds_client() -> \"RDSClient\":\n    \"\"\"Returns a type-hinted RDS client.\"\"\"\n    # AWS credentials typically managed by boto3's default credential chain\n    # or environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION)\n    # Example of setting region via environment variable for client creation:\n    aws_region = os.environ.get('AWS_REGION', 'us-east-1')\n    return boto3.client(\"rds\", region_name=aws_region)\n\ndef list_db_instances_typed() -> List[\"DBInstanceTypeDef\"]:\n    \"\"\"Lists all available DB instances with type hints.\"\"\"\n    rds_client: \"RDSClient\" = get_typed_rds_client()\n    try:\n        response: \"DescribeDBInstancesOutputTypeDef\" = rds_client.describe_db_instances()\n        db_instances: List[\"DBInstanceTypeDef\"] = response.get(\"DBInstances\", [])\n        print(f\"Found {len(db_instances)} DB instances:\")\n        for instance in db_instances:\n            print(f\"- Identifier: {instance.get('DBInstanceIdentifier')}, Status: {instance.get('DBInstanceStatus')}, Engine: {instance.get('Engine')}\")\n        return db_instances\n    except Exception as e:\n        print(f\"Error describing DB instances: {e}\")\n        return []\n\nif __name__ == \"__main__\":\n    # Set a dummy region for local testing if not already set\n    if 'AWS_REGION' not in os.environ:\n        os.environ['AWS_REGION'] = 'us-east-1'\n    list_db_instances_typed()","lang":"python","description":"This quickstart demonstrates how to obtain a type-hinted RDS client and use it to list DB instances, leveraging the type definitions provided by `types-boto3-rds`."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher.","message":"Python 3.8 support was removed for all `mypy-boto3-builder` generated packages, including `types-boto3-rds`, starting with builder version 8.12.0. The package now requires Python 3.9 or newer.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0"},{"fix":"Review and update TypeDef import paths and names in your codebase according to the new naming conventions, consulting the `types-boto3` documentation for the specific service.","message":"The `mypy-boto3-builder` (version 8.9.0) changed TypeDef naming conventions, potentially shortening names for packed method arguments (e.g., `CreateDistributionRequestRequestTypeDef` to `CreateDistributionRequestTypeDef`). If you were explicitly referencing the older, longer TypeDef names, your code may break.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0"},{"fix":"Use `if TYPE_CHECKING:` guards around your type imports. Example: `from typing import TYPE_CHECKING; if TYPE_CHECKING: from types_boto3_rds.client import RDSClient`.","message":"When using `mypy-boto3` type stubs (including `types-boto3-rds`) with Pylint, it might report undefined variables if types are imported directly. To avoid this and ensure compatibility in production environments where stubs are not installed, wrap type imports within a `typing.TYPE_CHECKING` block.","severity":"gotcha","affected_versions":"All versions"},{"fix":"If experiencing performance issues in PyCharm, try installing `types-boto3-lite[rds]` instead of `types-boto3-rds`.","message":"PyCharm users might experience slow performance with Literal overloads in type stubs. For improved IDE performance, consider using the `types-boto3-lite` variants of the packages, which provide a more RAM-friendly experience at the cost of requiring more explicit type annotations.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Update your `pip install` commands to `types-boto3-rds` and modify import statements (e.g., `from mypy_boto3_rds.client import RDSClient` becomes `from types_boto3_rds.client import RDSClient`).","message":"This library is the successor to `boto3-stubs`. If you are migrating from `boto3-stubs` or `mypy-boto3` packages, you need to replace `boto3-stubs` dependencies with `types-boto3` and adjust import paths from `mypy_boto3_<service>` to `types_boto3_<service>`.","severity":"deprecated","affected_versions":"Prior to types-boto3 adoption"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}