How to create Service Accounts in GCP

In this article, we will go over how to set up a GCP Service account, provide access, and generate keys for the GCP service account.

Service account in GCP

A service account is a special type of Google account that is used to authenticate and be authorized to access data in Google APIs. Below are the steps to create service account in Google Cloud Platform. With the service account we will authenticate access to GCP apis, by using service account we can use client libraries to work with Google Cloud APIs.

Steps to create service account

1. Login to Google Cloud Console https://console.cloud.google.com/.

2. Navigate to IAM & Admin and click on Service Accounts.

gcp-service-account

3. Click on CREATE SERVICE ACCOUNT.

gcp-service-account

4. Enter service account details and click on CREATE AND CONTINUE.

gcp-service-account

5. In the Select a role dropdown, choose the required role.

Note: For the demo purpose Cloud Datastore Owner is selected which provides full access to "Cloud Datastore", you need to choose the managed/custom role as per your requirement based on least required privilege principle.

gcp-service-account

6. Click on CONTINUE.

gcp-service-account

7. Click on DONE.

gcp-service-account

Create GCP service account key

8. Select the created service account and click on Action.

gcp-service-account

9. In the Action click on Manage Keys.

gcp-service-account

10. In the Keys section click on ADD KEY.

gcp-service-account

11. Click on Create new key.

gcp-service-account

12. Choose the Key type as JSON and click on CREATE to save the key to your computer.

gcp-service-account


Category: GCP