DEV Community

Cover image for Creating a Service Account and Generating a Key in Google Cloud: A Comprehensive Guide
kelvin maingi
kelvin maingi

Posted on

Creating a Service Account and Generating a Key in Google Cloud: A Comprehensive Guide

Image by Freepik

INTRODUCTION

In Google Cloud, there are several steps involved in creating a service account and generating a key. Service accounts are used to authenticate Google Cloud projects' applications and services. Here's a step-by-step guide to creating a service account and generating a key:

Section 1: Creating a Service Account

Log In: Ensure you are logged in to your Google Cloud Console (https://console.cloud.google.com/).
Navigate to the "IAM & Admin" section in the Google Cloud Console by clicking on the menu icon (three horizontal lines) in the upper left-hand corner, then selecting "IAM & Admin" > "Service accounts."
Step 1:Select "Create Service Account" from the menu.

Google cloud service account

STEP 2:
Name of the service account: Select a distinct name for your service account.
Optional description: Give the service account a description.

google cloud service account
STEP 3:
Role: Select the appropriate role(s) that define the service account's permissions.

google cloud service account

STEP 4:

google cloud service account

STEP5: Select "Done."

google cloud service account

STEP 6:All the service accounts will be listed here.

google cloud service account

Section 2: Generating a Key for the Service Account

STEP 1: click on the 3 dots located on actions column on the service account you want to create a key for.

google cloud service account key

STEP 2:select “Manage keys” to view and create keys for the service account.

google cloud service account key
STEP 3:Add a key
Click the "Add Key" button menu

google cloud service account key

STEP 4:Generate new key
then select "Create new key" from the dropdown

google cloud service account key

STEP 5:Choose Key Type
Choose the key type you want to create. The options are JSON and P12.
• JSON: This is recommended for most use cases.
• P12: Choose this option if your application requires a P12 key.

google cloud service account key

STEP 6:The key will be downloaded to the your computer automatically.

google cloud service account key

Conclusion

In conclusion, this comprehensive guide has equipped you with the essential knowledge and practical steps for creating a service account and generating a key in Google Cloud. By following these steps, you’ve gained the ability to securely manage access and permissions within your Google Cloud projects, which is crucial for the effective and safe deployment of applications and services. The key takeaways from this guide include service account creation, permission management, key generation, and project organization. By mastering these skills, you are better prepared to leverage the power of Google Cloud Platform while maintaining a robust security posture. Remember that effective service account and key management is a fundamental aspect of any cloud-based application or service, and the knowledge you’ve gained here will serve you well in your journey with Google Cloud.

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay