Tested on UDM-Pro 1.10.0
The following scripts can be used on a UDM-Pro with on boot script to force specific vlans out WAN2 as well as prevent that traffic from going out wan1 and all other traffic from going out wan2 in the event one WAN is disconnected.
curl -fsSLo /mnt/data/on_boot.d/98-vlan_to_wan2.sh https://gist.githubusercontent.com/GlitchWitch/9833888842dbd7d0b42669faab4c4a4a/raw/9ede55da6820c65c3aeb5d0951a71855641b0041/98-vlan_to_wan2.sh
curl -fsSLo /mnt/data/on_boot.d/99-disable_wan_failover.sh https://gist.githubusercontent.com/GlitchWitch/9833888842dbd7d0b42669faab4c4a4a/raw/9ede55da6820c65c3aeb5d0951a71855641b0041/99-disable_wan_failover.sh
chmod +x /mnt/data/on_boot.d/*.sh
Modify 98-vlan_to_wan2.sh
and replace the three instances of 1337
with the desired vlan you wish to route out wan2.
Reference: