I have been trying to port a web application set-up to EC2 using VPC. The application requires an externally accessible web server which is to talk to a number of back end servers managing a database and other data resources within a subnet of the VPC. In addition to this I require a compute head node which should connect to a grid of EC2 worker nodes hosted in another subnet of the VPC accessible only through the head node which should act as a router between the two subnets of the VPC using NAT.
The basic configuration should be something similar to the below schematic:
-
- External Connection ----------+
- |
- Web Server (Externally Facing + VPC Subnet 1)
- |
- +---------------------+-----------------+
- | | |
- Data Services Server Database Server Compute Headnode
- (VPC Subnet 1) (VPC Subnet 1) (VPC Subnet 1 & 2)
- |
- +--------------+--------------+
- | | |
- Worker Node 01 Worker Node 02 Worker Node 03
- (VPC Subnet 2) (VPC Subnet 2) (VPC Subnet 2)
At the moment I have been able to configure the two subnets and set-up the required EC2 nodes.
I have set up the Network ACL within the two subnets to prevent the EC2 instances in subnet 1 from directly communicating with any IPs within subnet 2 by setting rules within the two subnets as follows:
Subnet 1:
99 ALL Traffic ALL ALL 10.81.82.0/24 DENY
100 ALL Traffic ALL ALL 0.0.0.0/0 ALLOW
* ALL Traffic ALL ALL 0.0.0.0/0 DENY
Subnet 2:
80 ALL Traffic ALL ALL 10.81.82.0/24 ALLOW
100 ALL Traffic ALL ALL 0.0.0.0/0 ALLOW
* ALL Traffic ALL ALL 0.0.0.0/0 DENY
The issue I seem to be having with this set-up is that I don't see any obvious way of allowing the compute node, which is attached to both subnet 1 and subnet 2, from not giving precedence to the 10.81.82.0/24 DENY
rule of subnet 1 over the 10.81.82.0/24 ALLOW
rule of subnet 2.
I have read most of the pages from Amazon's VPC networking documentation however I am still struggling to work out how to achieve this kind of hierarchical setup. Any help or pointers in the right direction would be much appreciated.