Setup GCP Account

Steps to setup the GCP account before provisioning Infrastructure

Overview

Follow the steps below to set up your GCP account before you proceed with the DIGIT deployment.

Setup

  • Sign up for the GCP account if you do not already have one. Use this link to get started.

  • Create a new project & assign billing to it.

  • Assign Administrator/Owner Access to the user for the necessary permissions.

  • Request CPU quotas (if not already available). You can check available quotas here.

  • Open the terminal. Run the following command you have installed on the AWS CLI, and use the credentials.

    • Initialise GCloud CLI - gcloud init

    • You will be prompted to log in and grant access in a web browser or to select an existing account. Complete the authorisation step when prompted.

    • Choose a current Google Cloud project if prompted.

This account has a lot of projects! Listing them all can take a while.
 [1] Enter a project ID
 [2] Create a new project
 [3] List projects
Please enter your numeric choice:

Note: If you only have access to one project, including the default project for your user account, gcloud init selects it for you. Otherwise, you can select a project from a list of projects for which you have Owner, Editor or Viewer permissions.

  • Choose a default Compute Engine zone if prompted. (example: asia-south1-a for a zone in the Mumbai region)

  • To view the properties set through the gcloud init command, use the gcloud config list command.

[compute]
region = GCP_REGION
zone = GCP_AVAILABILITY_ZONE
[core]
account = demo@example.com
disable_usage_reporting = False
project = GCP_PROJECT_ID
  • Run the below cmd and provide the prompted permissions. This enables Terraform to use the default credentials available.

gcloud auth application-default login
  • Install gke-gcloud-auth-plugin for kubectl authentication.

gcloud components install gke-gcloud-auth-plugin
  • Enable the necessary Google APIs

gcloud services enable compute.googleapis.com \
                       container.googleapis.com \
                       servicenetworking.googleapis.com \
                       sqladmin.googleapis.com \
                       cloudkms.googleapis.com \
                       --project=<GCP_PROJECT_ID>        # update project-id

# in-case above cmd fails
# try below one-liner cmd, update project-id at the end
gcloud services enable compute.googleapis.com container.googleapis.com servicenetworking.googleapis.com sqladmin.googleapis.com cloudkms.googleapis.com --project=<GCP_PROJECT_ID>
  • Use the project-id, region & zone in Terraform to connect with your GCP account & provision cloud resources.

Last updated

Was this helpful?