def parse_resource_type(resource_type):
    """Splits a resource type into it's components.

    :exc:`ValueError` is raised if the resource type is invalid.

    >>> parse_resource_type('AWS::ECS::Instance')
    ['AWS', 'ECS', 'Instance']
    >>> parse_resource_type('AWS::ECS')
    Traceback (most recent call last):
    ...
    ValueError: Resource type 'AWS::ECS' is invalid
    >>> parse_resource_type('AWS__ECS__Instance')
    Traceback (most recent call last):
    ...
    ValueError: Resource type 'AWS__ECS__Instance' is invalid
    """
    segments = resource_type.split("::")
    if len(segments) != 3:
        raise ValueError("Resource type '{}' is invalid".format(resource_type))
    return segments