Stents or scaffolds made from magnesium or magnesium alloys including additives or barrier coatings that modify the corrosion rate of the stent are disclosed. Methods of forming barrier coatings that modify the corrosion rate of the stent are disclosed.