Adds security group support

Allows security groups to be specified in the template.