def parse_arn(arn):
    """
    Given an ARN, split up the ARN into the ARN namespacing schema dictated by the AWS docs.
    """
    elements = arn.split(':', 5)
    result = {'arn': elements[0], 'partition': elements[1], 'service':
        elements[2], 'region': elements[3], 'account': elements[4],
        'resource': elements[5], 'resource_path': None}
    if '/' in result['resource']:
        result['resource'], result['resource_path'] = result['resource'].split(
            '/', 1)
    elif ':' in result['resource']:
        result['resource'], result['resource_path'] = result['resource'].split(
            ':', 1)
    return result
