Lloyd Gunton showed no obvious emotion in the dock as he was told that his autism, young age and previous good character had saved him from an even longer minimum term.
Judge Mark Wall QC told the teenager the "usual range" of minimum sentences for someone convicted of similar offences was 21 to 30 years.
The judge said the would-be Isis attacker, who only held a provisional driving licence, had carried out significant planning.
The judge told Gunton: "You were committed to carrying out the attack throughout a protracted period, a commitment best demonstrated by your martyrdom letter and open support for Isis on Instagram.
"You were dedicated to the cause for approximately one year: this was no passing phase.
"The author (of a pre-sentence report) recognises that at present you are a high risk of re-offending and that if you do, you pose a high risk of causing the public serious harm."
Turning to the defendants mitigation, the judge said of Gunton's diagnosis of autism: "This condition made you something of a loner and someone more easily impressed by the things you read on the internet.
"Yours is not a condition from which you will recover.
"It is important that, having been tempted to commit a serious offence such as this, you are under some form of supervision for the rest of your life."
Earlier in his remarks to the teenager, Judge Wall said the plan to attack Cardiff appeared to have two phases.
The judge added: "You were to steal a vehicle and drive it into a crowd of people and then produce your knife and your hammer to inflict as much harm as possible before you were stopped.
"I am sure that you intended to use a vehicle with which to begin the attack."