How did I get shingles?

Patient: I’ve recently been on a family holiday to turkey and I came back with a rash that resembles acne spots under arm and they started to spread to my breast. Originally there were no spots and it was just painful but there was nothing there about 3 days later the spots appeared. I went to the doctors today and they’ve told me I have shingles and given me aciclovir 800g tablets to take 5 times a day.I have a few questions on how I may have got shingles? Does it have to be direct contact?

Symptoms: Painful bumps