@bp.route('/ec2/<id>/name', methods=['POST'])
@login_required
def instance_name(id):
    name = request.form.get('instance_name')
    tags = [{'Key': 'Name', 'Value': name}]
    create_tags(g.user.account, id, tags)
    flash(f'Name changed to {name}', 'success')
    return redirect(url_for('compute.instance', id=id))
@bp.route('/ec2/<id>/name', methods=['POST'])
@login_required
def instance_name(id):
    name = request.form.get('instance_name')
    tags = [{'Key': 'Name', 'Value': name}]
    create_tags(g.user.account, id, tags)
    flash(f'Name changed to {name}', 'success')
    return redirect(url_for('compute.instance', id=id))