Configuring VPC for Google App Engine

This is the second post regarding VPC. In the previous post we saw how to create VPC and configure network in AWS. This one is about Google Cloud and App Engine.

Creating a network

If you have created an app Engine Flexible instance, you should automatically get a default VPC network. You can either use that default network, or create a new one, if you want only select app engine services to be under it.

In order to create a custom network, visit https://console.cloud.google.com/networking/networks/

Fill-in necessary details. If you select automatic for subnet creation, Google will go ahead and create subnets for each region it has. If you want more control, select custom. Custom will also allow you to have your own specified IP ranges.

Connecting a service to VPC.

Once you have created a network, for connecting our App Engine service to this VPC, add the following network configuration to your project's app.yaml file.

network:
  instance_tag: custom-tag // this can be used for firewall configuration
  name: custom-vpc // name of our vpc
  subnetwork_name: private // name of the subnet that we created.

Once this is done, deploy your changes.

All Set

Google doesn't give the same level of flexibility and control like Amazon does. It may feel like this is more easy, but you are creating a VPC to have a tighter control over your network, so Google's options are pretty limited to be honest.