def alias_to_id(client, key_alias):
    """
    Look up a key ID from a key alias.
    """
    response = client.list_aliases()
    if response and 'Aliases' in response:
        for alias in response['Aliases']:
            if alias['AliasName'] == key_alias:
                return alias.get('TargetKeyId', None)
    return None
