title: How do I create hierarchical AWS Security Groups?
body: <p>I want to create a 2-level security group heirarchy in AWS.</p>
  
  <ol>
  <li><strong>Location Groups</strong> - groups of IP addresses specific to different locations (e.g. "office", "home", "customer 1", etc.).  Each of these base groups grants each IP access to All Traffic (ports 0-65535)</li>
  <li><strong>Environment Groups</strong> - I then am trying to add these base Location Groups to my higher-level Environment Groups (e.g. "test", "prod", "reporting db", etc.).  I will use Environment groups for my different instances in EC2. So a server "uat_01" for example will reference the "test" environment group, which will in turn grant access to "office", for example.</li>
  </ol>
  
  <p>Here's my inbound rule setup for security group sg-f2d8.... (office)</p>
  
  <p><a href="https://i.stack.imgur.com/JY9IB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JY9IB.png" alt="enter image description here"></a></p>
  
  <p>I'm adding the base groups using port ranges for access to HTTP (or HTTPS, or MySQL, etc., based on need), and referencing the base group using "Custom" configuration with the group identifier, e.g. "sg-f2d8...." </p>
  
  <p><a href="https://i.stack.imgur.com/cuphK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cuphK.png" alt="enter image description here"></a></p>
  
  <p>In the Security Groups panel, everything looks ok, but I can't get access from the selected IPs.</p>
  
  <p>Please help!  I've been told EC2 Security Groups can reference base groups this way, but I can't seem to figure it out!</p>
  
  <p>Thanks!</p>