from typing import Optional


def _gen_resource_type_range(account_id: str, region: Optional[str]) -> str:
    """Generate a range key for the resource type index.

    Arguments:
        account_id (str): The AWS Account ID
        region (str): The AWS region (e.g. ``'eu-west-1'``

    """
    return f"{account_id}#{region or ''}"