first off, x/3 cable has 4 wires in it, x/2 cable has 3 wires. the ground is not counted, so a 12/2 cable has a hot, a neutral, and a ground
you need to use 10/2 cable. 10 AWG cable is rated for up to 30 amps. 12 AWG cable is only rated for up to 20 amps, which would not be enough in your case