Virtual Private Cloud (VPC) in Google Cloud
VPC enables you to launch GCP resources into a virtual network that you’ve defined. This virtual network closely resembles a traditional network that you’d operate in your own data center, with the benefits of using the scalable infrastructure in cloud.
In our scenario project name is (IT-EAST-US).Under the Project(IT-EAST-US) we will create VPC (VPC-it-eastus) and subnets as below.
Project :-
Projects contains GCP resources + linked billing account.We will create a project called (IT-EAST-US) , I will show you how to create a project.
Beside Google Cloud Platform in blue colour row,click on card drop down box. Once after we click it will show an option to create NEW PROJECT.
Click on NEWPROJECT.Type Project name. In our scenario project name is (IT-East-US).
Enter the parent organization or folder in the Location box, if any. That resource will be the hierarchical parent of the new project.
Once Project get created, The project ID and project number are displayed on the project Dashboard Project info card, It also shows Billing card ,Resources card, Status card, cpu card details.
Lets start creating Virtual Private Cloud
VPC Network
- Select a project (IT-East-US),under project create a VPC(vpc-it-eastus).
- NETWORKING -> VPC Network -> VPC Network > Create VPC Network.
Add Region (us-east1), add Subnet (core-vpc-it-eastus) and range under VPC(vpc-it-eastus).
Add another subnet (vpn-vpc-it-eastus) in a same way and click create.
- Once after creating VPC and subnets it looks like below.
Compute Engine
Compute Engine lets you create and run virtual machines on Google infrastructure. Compute Engine offers scale, performance, and value that lets you easily launch large compute clusters on Google’s infrastructure.
While creating VM instance you have to provide Region and zone location where you want to deploy this VM and then configure a Machine type.
- Under Machine configuration, select General-purpose.
- From the Series drop-down, select First for N1 custom machine types or Second for N2 or N2D custom machine types.
- From the Machine type drop down, select Custom.
- Select the amount of memory you want. To add extended memory, check the Extend memory option and numbers of CPU required.
5. Select the Boot Disk Image and Access Scopes and also enable Firewall option(below I will discuss about Firewall).
6. Click on ‘Management, security, disks, networking, sole tenancy’, create network interface and add required vm network adapter details.
Network : vpc-it-eastus,
subnetwork: core-vpc-it-eastus
For this VM machine either you could create a custom Internal and Public IP or you can create it as Automatic. After selecting Automatic option it picks any random internal IP address from Network. Similarly you could do for External IP’s.
Firewall Rule
NETWORKING -> VPC Network -> VPC Network > Firewall.
There are few default routes available for default network and also http and https rule will be created at time of crating instance under vpc-it-eastus network.
Allowing Http and Https means, the instance created in VPC network only accessible via http and https traffic.You could add other firewall route in vpc network to allow specifc traffic to your instance.
Now you are ready to use your custom VPC and instance under that VPC.