# VPC

It is a Amazon Virtual Private Cloud which provides you a full control over your virtual netowrking environment. It enables us to connect our on-premises resources to AWS infrastructure through a virtual private network. For more informations: <https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html>

**Following this need while setting up VPC**&#x20;

```
1. Create VPC -> Name, IP, 
2. Create Public subnet --> VPC_name, Name, IP
3. Create Private subnet --> VPC_name, Name, IP 
4. Create Internet Gateway -> Name
5. Create Route Table --> Name, Link_VPC, 
6. Go to route table--> edit_subnet_association, select both subnets
7. Create EC2 and link that network to new instances

Things to remember before we connect instances:
	1. Attached IGW to VPC
	2. Linked Instances subnet to Route Tables
	3. Add additional route on route table, Click on edit routes, add route set destination to 0.0.0.0/0 and set target to IGW


```

<figure><img src="https://1186894440-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9wnMXVEmEJ7k6VEhLJYN%2Fuploads%2FuW3podKuxeRAem5aZmoK%2FScreen%20Shot%202022-11-06%20at%204.35.32%20PM.png?alt=media&#x26;token=e9c6caa8-c493-46a0-8143-c142134f4e00" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1186894440-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9wnMXVEmEJ7k6VEhLJYN%2Fuploads%2FPiDPFT9oiONNE0j98k0D%2FScreen%20Shot%202022-11-06%20at%2010.51.01%20AM.png?alt=media&#x26;token=ec116588-7954-4703-bd79-1e9b5f87ea7d" alt=""><figcaption></figcaption></figure>
