def stack_is_failing(events):
    """iterate stack events, determine if resource creation failed"""
    failed = False
    failure_modes = ('CREATE_FAILED', 'UPDATE_ROLLBACK_IN_PROGRESS')
    for event in events['StackEvents']:
        if event['ResourceStatus'] in failure_modes:
            failed = True
        if event.get('ResourceStatusReason') == "User Initiated":
            break
    return failed