Tesla has signed an agreement with the Shanghai government for a plot of land to build its first overseas US$2 billion (S$2.8 billion) Gigafactory.