In this Article We will learn the following:
- Introduction to Vpc
- Difference Between VPC, VPN and VPC
- Advantages of Using a VPC
- How to create a Virtual private Cloud in GCP
- How to create a Virtual private cloud in AWS
INTRODUCTION TO VPCs
![vpc](https://codingfalcon.com/wp-content/uploads/2021/10/Vpc.png)
A VPC – virtual private cloud is a logically isolated , secure and complete cloud computing environment that resides within a large public cloud. A VPC shares the same resources with the Public cloud but provides a high level isolation using Private IP subnet or Virtual local area network(VLAN).
A public cloud is a type of IT service where a third party vendor provides computing resources and infrastructure such as virtual machines, storage, networking, etc to the public through the internet. It is available either through on-demand pricing schemes or through subscriptions. It saves companies the need to have on-premises infrastructure and instead use scalable infrastructure provided by a third party through the internet.
A virtual private cloud enables an organization to provision on-demand computing resources, privately but on a public cloud.
Think of a virtual private cloud as as event where several people are attending, all the attendees are using the same chairs and seated under the same tent, but inside the tent there are few chairs reserved for special guests. The whole tent represents the public cloud with the chairs representing the public cloud infrastructure. Within this tent there is a special place with same chairs reserved for the specials guests and other normal attendees are not allowed to sit on those chairs. This space reserved for special guests can be assumed to represent our VPC – Virtual private network.
DIFFERENCE BETWEEN VPC, VPN AND VPS
A VPC virtual private cloud as explained earlier is a logically isolated , secure and complete cloud computing environment that resides within a large public cloud.
A VPN (Virtual Private Network) is an encrypted connection between 2 networks or between a machine and a network and generally happens over the internet.
A VPS (Virtual Private Server) is a Virtual Machine running with dedicated resources that is made available to the end users over the internet and is mainly rented.
ADVANTAGES OF USING A VIRTUAL PRIVATE CLOUD
VPCs come with many advantages that organizations can leverage by combining all the benefits of a private cloud and the advantages of a public cloud.
Security.
VPCs allow you take control of who can access your data, resources and workloads by providing a logical separation from other clients belonging to the same provider and using the same resources. With a VPC you can control access to the VPC using ACLs(Access Control Lists which are rules that you define that limit who can access a particular subnet within a VPC) and security groups which can be used to group resources together and assign them uniform rules controlling their access.
Agility.
VPCs are very flexible since they can scale resources in real time to fit your business needs, they allow you to provision cloud resources whenever your business needs them.
They provide high Availability.
VPC’s provide very high availability for your applications and workloads using availability zones. An availability zone is a discrete data center with very high redundancy in terms of power, networking and other resources.
Relatively Cheap.
With a VPC residing within the public cloud, customers can leverage the cost effective nature of public cloud by saving on costs that would otherwise be spent on purchasing hardware, power and labor to operate the traditional data center.
High performance.
Workloads and applications deployed to a virtual private cloud generally perform better compared to running the same applications on on-premise infrastructure.
DISADVANTAGES OF USING A VIRTUAL PRIVATE CLOUD
Despite Virtual Private Clouds being packed with several advantages they also have their own downside. VPCs can cost an organization very high operational costs and in some cases even higher than on-premise operational costs. The cost of private connection to the VPC which is normally charged on per hour basis can sometimes be very high.
HOW TO CREATE A VIRTUAL PRIVATE CLOUD IN GCP(Google cloud platform)
Google cloud is one of the providers of virtual private clouds as an Infrastructure as a service(IaaS). GCP’s virtual private Cloud provides data encryption both at rest and in transit. It also allows you to use your own private IPs within the Virtual private cloud Network. Google runs Virtual Private Clouds as Global services spanning across all the regions.
GCP offers a free trial with $300 credit once you sign up for an account. You can use this free learn and practice on the google cloud platform.
To create a Virtual Private Cloud in GCP, follow the following steps:
1. Head over to gcp and sign up for a free trial in case you don’t have an account.
2. Once you have your account set, Navigate to the VPC networks page
3. Click Create a VPC network.
![gcp](https://codingfalcon.com/wp-content/uploads/2021/10/gcp-1024x691.png)
4. Type in the name for your virtual private cloud network.
5. Set the subnet creation mode to Automatic.
6. In the firewalls section you can choose on of the already defined firewall rules or create your own firewall rules.
7. Select dynamic routing mode for your VPC network.
8. Choose the maximum transmission unit for your VPC.
9. Click create.
Congratulations you just created your first Virtual private Cloud in the Google Cloud platform, you can now start provisioning resources such as Virtual machines in this VPC.
HOW TO CREATE A VIRTUAL PRIVATE CLOUD IN AWS
Amazon Web Services, just as GCP provides virtual private cloud as an Infrastructure as a service(Iaas). Amazon Virtual private Clouds strictly reside within a specific region, this directly implies that you will be able to provision networking resources in regions where they are needed and only on demand.
Sign up for an AWS free tier account, you can use the account to practice and learn about AWS.
We will create an Amazon VPC using the VPC wizard:
1. Head over to the Amazon virtual private cloud console
2. On the top navigation menu, click Launch VPC network
3. In the configuration screen popup, choose a virtual private cloud with a single public subnet, then select.
4. Fill in your VPC details.
IPv4 CIDR block::10.0.0.0/16
- IPv6 CIDR block: No IPv6 CIDR Block
- VPC name
: codingfalconvpc
- Public subnet’s IPv4 CIDR
:10.0.0.0/24
- Availability Zone:No Preference
- Subnet name
: codingfalcon Subnet 1
- Enable DNS hostnames:Leave default selection
- Hardware tenancy: Leave default selection
![AWS](https://codingfalcon.com/wp-content/uploads/2021/10/AWS-1024x468.png)
5. Click create VPC, this might take several minutes before the VPC is fully created.
After your VPC has been created, you now have to create another subnet as per the requirements of AWS directory Service and the subnet must be within a different availability zone from the one we just created using the setup wizard.
You can create the second subnet by following the following steps:
- Navigate to the vpc console
2. Select subnets from the navigation pane, and choose the subnet with the name that you chose in the above steps when using the setup wizard. Note down the availability zone of this subnet so that we avoid creating another subnet in the same availability zone.
3. Click create subnet and fill in the subnet details in the dialog box that shows up. Take not to choose an availability zone other than the one that you just noted down.
4. Choose the VPC that you just created.
5. In the CIDR block enter: 10.0.1.0/24
6. Click create subnet.
Congratulations your AWS virtual private cloud is all set! You can now start provisioning resources such as EC2 instances in you VPC.