The sound is due to the Camera Lens Barrel that required to operate the Auto Focus function.
Samsung Galaxy A8/A8+ 2018 supports a 16MP main camera with Auto Focus feature that is required for high quality and resolution of the camera.
Auto Focus feature adjusts focus by moving the Lens units up and down over the Image Sensor. This enables Auto Focus speed and accuracy and helps in reducing battery usage.
However Camera module is fitted with a Stopper part to limit lens unit movement within the space for the Camera module.
When the device is shaken, the lens and stopper will touch causing a noise to occur. This is normal due to the operation of Auto Focus feature of the camera and the device is not faulty.