How to create VPC in GCP using terraform
Is it possible to create multiple VPC using Terraform ?
Yes, you can create multiple VPCs using Terraform. You have to define the configurations for each VPC in different resource block.
How to get existing resources in Terraform ?
Use terraform import command to get existing resources to your Terraform configuration. You can manage the resources along with other resources like VPC networks.
Can I modify the VPC after creation using Terraform ?
Yes, you can modify VPC after creating it using Terraform. Make the required changes in main.tf file and run terraform apply to register the changes.
Do I have to enable Billing for VPC ?
Yes, you should enable billing for your GCP account before creating VPC. Otherwise, you won’t be able to use any service or resource in GCP including VPC network.
How To Create VPC In GCP Using Terraform ?
When we are building an application to be hosted on a Cloud Platform we must configure networks and take security measures. If you are building an application that is open to users over the internet, you might want to control who gets access or not, and how users interact with each other. This is essentially where you will need a VPC Network. A VPC network is like your own private or isolated internet within the Cloud Platform. Google Cloud Platform being one of the leading cloud providers offers various Network services and VPC is one of them. Using a VPC network in GCP you can isolate various resources and infrastructure to confirm better security and performance. Now, Terraform acts as a Infrastructure tool that allows to create and manage Cloud infrastructure with simple code. In this article, we will be learning about how we can create a VPC using Terraform in Google Cloud Platform (GCP).