#29590
Bit of refac to move security group code into a better place, adding the ability to set hostname based on rules we agreed upon in associated ticket.
#29590

Adding better validation of the hostname, will skip hostname configuration if the hostname template + parts do not add up to a valid hostname.