Assignment-VPC
Assignment-VPC
You work for XYZ Corporation and based on the expansion requirements of your
corporation you have been asked to create and set up a distinct Amazon VPC for the
production and development team. You are expected to perform the following tasks
for the respective VPCs.
Production Network:
1. Design and build a 4-tier architecture.
2. Create 5 subnets out of which 4 should be private named app1, app2,
dbcache and db and one should be public, named web.
3. Launch instances in all subnets and name them as per the subnet that they
have been launched in.
4. Allow dbcache instance and app1 subnet to send internet requests.
5. Manage security groups and NACLs.
Development Network:
1. Design and build 2-tier architecture with two subnets named web and db and
launch instances in both subnets and name them as per the subnet names.
2. Make sure only the web subnet can send internet requests.
3. Create peering connection between production network and development
network.
4. Setup connection between db subnets of both production network and
development network respectively.
o Subnets
o Internet Gateway
2. Create Subnets:
o Public Subnet (Web): CIDR 10.0.1.0/24.
o Private Subnets:
3. Launch Instances
Launch EC2 instances in each subnet and name them:
o Web: web-instance.
o App1: app1-instance.
o App2: app2-instance.
o DB Cache: dbcache-instance.
o DB: db-instance.
Allow inbound HTTP (80), HTTPS (443), and SSH (22) from the
internet.
o App Instances:
Allow inbound traffic from the Web instance (port 8080 or app-
specific).
Deny all other inbound traffic except necessary ports.
o DB Cache and DB Instances:
Allow inbound traffic only from App instances and DB Cache for
specific ports (e.g., 3306 for MySQL).
2. NACLs:
o Public Subnet: Allow inbound/outbound HTTP/HTTPS and SSH traffic.
2. Create Subnets
1. Create a VPC:
o CIDR block: 10.1.0.0/16.
2. Create Subnets:
o Web Subnet: CIDR 10.1.1.0/24 (public).
o DB: dev-db-instance.
2. DB Subnet:
o No internet access is configured for this subnet.
o Verify that App1 and DB Cache instances in Production VPC can send
outbound requests.
2. Peering Connection:
o Ensure instances in the DB subnets of both VPCs can communicate.
3. Security Rules:
o Test security groups and NACLs to ensure proper access restrictions.