> For the complete documentation index, see [llms.txt](https://asafahmadov.gitbook.io/cloud-and-devops/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://asafahmadov.gitbook.io/cloud-and-devops/devops-bootcamp/all-about-aws-services/vpc-manage-private-network-on-aws.md).

# VPC - Manage Private Network on AWS

VPC is our own isolated network in the cloud.

![](https://2601183865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8QpIzz6VwCOTMwaqKYa3%2Fuploads%2Fb7BqMfVD9FcPU6sozURz%2Fimage.png?alt=media\&token=c5961b23-f7d5-48b0-bee4-44a8613dedb2)

{% hint style="success" %}
Your resources always have to run in a VPC!
{% endhint %}

&#x20;  ▪ We have a VPC for each Region&#x20;

&#x20;  ▪ VPC spans all the AZ (Subnet) in that Region&#x20;

&#x20;  ▪ Multiple VPCs in different Regions

&#x20;  ▪ VPC is like a virtual representation of network infrastructure: Server setup, network configuration (router, firewall, DHCP etc.) moved to cloud

### SUBNET

Subnet is a range of IP addresses in your VPC&#x20;

It's like a private network inside a network:

![](https://2601183865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8QpIzz6VwCOTMwaqKYa3%2Fuploads%2FUUV7Vf0trmyHshfbS6gG%2Fimage.png?alt=media\&token=76c4b81f-7ae4-4c20-8dfb-0ce034d079f1)

We have a subnet for each Availability Zone:

![](https://2601183865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8QpIzz6VwCOTMwaqKYa3%2Fuploads%2FNTlk65psSY3xOHhwZI34%2Fimage.png?alt=media\&token=18dc150b-c178-4ef1-bf26-b9113f9e210a)

#### Private and Public Subnets

&#x20;  ▪ Based on firewall configuration we can have a private and/or public subnet:

![](https://2601183865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8QpIzz6VwCOTMwaqKYa3%2Fuploads%2F6N59t0GFWu6qSS5wihy9%2Fimage.png?alt=media\&token=4fad26f5-96c4-4552-8dac-456284875fc4)

&#x20;  ▪ A subnet has a default range of internal(private) IP addresses&#x20;

&#x20;  ▪ When you create a new resource like EC2 instance then an IP address is assigned within this subnet's IP range&#x20;

&#x20;  ▪ For communication inside the VPC

![](https://2601183865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8QpIzz6VwCOTMwaqKYa3%2Fuploads%2Fq8Ivt4DnBk7V9OVzdHuc%2Fimage.png?alt=media\&token=6cb1620d-10a5-4032-afb1-c4d360c3d47f)

### Internet Gateway

&#x20;  ▪ Using an internet gateway you can connect the VPC or its subnets to the outside internet

### Security - Controlling Access

Of course, we need to secure our resources:&#x20;

&#x20;  ▪ Control access to your VPC&#x20;

&#x20;  ▪ Control access to your individual server instances

![](https://2601183865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8QpIzz6VwCOTMwaqKYa3%2Fuploads%2F59iCkxqsCcipft4CXFwo%2Fimage.png?alt=media\&token=a659e37f-dc84-4b7a-aa2a-1fd445e5f741)
