def update_account_status()

in functions/source/account_create.py [0:0]


def update_account_status(account_name, account_id, cmd_status, message):
    '''Update DynamoDB Table with account status'''
    result = None

    key = {
        "AccountName": {"S": account_name}
        }
    updates = {
        "Status": {"Value": {"S": cmd_status}},
        "Message": {"Value": {"S": message}},
        "AccountId": {"Value": {"S": account_id}}
        }
    get_item = get_item_from_table(account_name)

    if get_item:
        try:
            result = DYNO.update_item(TableName=TABLE_NAME,
                                      Key=key, AttributeUpdates=updates,
                                      ReturnValues="UPDATED_NEW")
        except Exception as exe:
            LOGGER.error('Unable to update the item: %s', str(exe))

    return result