After the victim repeatedly contacted him, the defendant threatened to post explicit photos she had previously sent him while they were an item.
When she did not comply, Valli - under the influence of alcohol and egged on by his friends, according to defence counsel Jo Turner - posted three images of the girl on the "Dirty South Car Club".
He advertised the victim as "for sale" for a dollar and tagged her by name.
That meant all her Facebook friends, which numbered more than 1000, could also see the photos.
She was alerted by family members and the social media site removed the pictures as soon as they were alerted.
"He has ruined my life," the teenage victim said in a statement.
Judge Coyle said she had started self-harming had been bullied because of the Facebook post.
"She feels worthless and depressed and embarrassed to leave her home," the judge said.
"For her, your click of a button, which probably happened in an instant, has had devastating consequences on her."
The judge said it appeared to be a recurring pattern of behaviour.
After another relationship broke down this year, Valli sent an abusive message to his ex's friend.
"When you're in a relationship and women do not behave as you think they should behave, your innate response is to humiliate as best you can and threaten them. And that's got to be incredibly concerning," Judge Coyle said.
"What concerns me is that before [posting the photos], you had already threatened her. You had clearly thought about it beforehand. It wasn't a spur of the moment, foolish decision."
As well as the prison term, Valli was banned from being behind the wheel for six months for two drink-driving offences committed while on bail.
Valli opposed his photo being used in media reports but the judge said people who committed such offences deserved to be "named and shamed".