- Create GCP account
- Create Project - in mycase it is
Country
- Install terraform
- In GCP, create service account under
IAM & Admin
, giving Compute Admin role - Once the service account is created, click on it > KEYS > ADD KEY > CREATE NEW KEY > download the json (it'll be like country-xxxxx-xxxxx.json)
- Enable Cloud Compute Engine API from
APIs & Services
In yout terminal, export the path of service account key, in my case
export GOOGLE_APPLICATION_CREDENTIALS=/home/deamonkiller/country-xxxx-xxxxxxx.json
Make changes to terraform.tfvars file accordinly
terraform init
terraform plan
terraform apply -auto-approve
Goto VPC and verify the vpc and subnets 👍 There you go!!!