- Lab
- A Cloud Guru
Creating and Managing GCP Service Accounts
Unlike standard IAM member accounts, service accounts are used by applications, services, or VM instances and not people. Nonetheless, the two types of accounts share many of the same features, including the ability to be assigned pre-defined or custom roles. But, of course, there are differences such as the technique for associating a VM instance with a service account. In this hands-on lab, you'll work with service accounts in a variety of ways: creating, editing, disabling, enabling, assigning IAM roles, and attaching a service account to a VM instance.
Path Info
Table of Contents
-
Challenge
Create a service account.
- From the Google Cloud console's main navigation, choose IAM & admin > Service accounts.
- Click Create Service Account.
- On the Create Service Account page, enter a name such as App Team Service Account.
- Click Create.
- On the next page, leave the Service account permissions as their default settings and click Continue.
- On the next page, leave the Users access fields blank.
- Click Create Key.
- On the Create Key panel, set the Key Type to JSON and click Create.
- Save the generated key to the desired location on your local system and, in the dialog, click Close.
- Click Done.
-
Challenge
Edit the service account.
- From the Service Accounts page, review the created account entry.
- Select the associated Actions icon and choose Edit.
- In the Description field, enter the following:
For development only
. - Click Save.
-
Challenge
Disable and enable service account.
- From the Service Accounts page, review the revised account entry.
- Select the associated Actions icon and choose Disable.
- In the dialog that appears, click Disable.
- Note the revised Status icon.
- Select the associated Actions icon and choose Enable.
- In the dialog that appears, click Enable.
- Note the revised Status icon.
-
Challenge
Assign IAM roles to service account.
- From the Service Accounts page, copy the email address for the new service account.
- From the IAM navigation, choose IAM.
- Click Add Member.
- In the Add Members panel, paste the copied email address into the New Members field.
- In the Select a role field, choose Viewer.
- Click Save.
-
Challenge
Attach the service account to a VM instance.
- From the main Google Cloud navigation, choose Compute Engine > VM Instances.
- Choose Create Instance.
- Leave all the values at their defaults.
- In the Identity and API Access section, select the Service account list and choose the App Team Service Account entry.
- Click Create.
-
Challenge
Delete the service account.
- From the Google Cloud console's main navigation, choose IAM & admin > Service accounts.
- Select the associated Actions icon and choose Delete.
- In the dialog that appears, click Delete.
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.