Actually the distance between the Earth and the Sun constantly changes. This is because the orbit of the Earth around the Sun is not a circle, but an ellipse. And the centre of the orbit is not at the centre of the ellipse.
So the distance between the Earth and the Sun varies between 147 million kilometres (when the Earth is at its closest to the Sun, called perihelion) and 152 million kilometres (when the Earth is furthest from the Sun, called aphelion).
One astronomical unit was originally defined to be the average of these two distances, 150 million kilometres. Since 2012 its value has been defined as being exactly 149,597,870,700 metres.