Support a variable defining which values it allows.

    Args:
        allowed_values (Optional[list]): A list of allowed values from the
            variable definition
        value (obj): The object representing the value provided for the
            variable

    Returns:
        bool: Boolean for whether or not the value is valid.

def validate_allowed_values(allowed_values, value):
    """Support a variable defining which values it allows.

    Args:
        allowed_values (Optional[list]): A list of allowed values from the
            variable definition
        value (obj): The object representing the value provided for the
            variable

    Returns:
        bool: Boolean for whether or not the value is valid.

    """
    # ignore CFNParameter, troposphere handles these for us
    if not allowed_values or isinstance(value, CFNParameter):
        return True

    return value in allowed_values