
Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Enable the Secret Manager API
/ 10
Create a secret
/ 30
Create and use a new secret version
/ 30
Create a new secret version (and invalidate previous versions)
/ 30
In this lab, you use Secret Manager from Cloud Console and the Command Line Interface (CLI) to create and use a secret, replace a secret, and finally, reinstate an older version of a secret.
Secret Manager is available in Cloud Console. It is also available from the command line using the CLI or from a program, using the REST API or one of the supported Software Development Kits (SDKs). Supported SDKs include C#, Go, Node.js, Java, etc. A complete list of available SDKs. Information regarding the REST API.
In this lab, you learn to:
For each lab, you get a new Google Cloud project and set of resources for a fixed time at no cost.
Sign in to Qwiklabs using an incognito window.
Note the lab's access time (for example, 1:15:00
), and make sure you can finish within that time.
There is no pause feature. You can restart if needed, but you have to start at the beginning.
When ready, click Start lab.
Note your lab credentials (Username and Password). You will use them to sign in to the Google Cloud Console.
Click Open Google Console.
Click Use another account and copy/paste credentials for this lab into the prompts.
If you use other credentials, you'll receive errors or incur charges.
Accept the terms and skip the recovery resource page.
In this task, you enable the Secret Manager API.
Before you access Secret Manager, you must first enable its API. If you fail to do so, when you attempt to access its features, you will receive an error.
Secret Manager
. You should see one result - the Secret Manager API.Click Check my progress to verify the objective.
In this task, you create a secret and add the secret value to the password.
password
.xyzpdq
.team
.acme
.Click Check my progress to verify the objective.
In this task, you use the secrets command to verify the value of the password secret.
If successful, you should see that the value of the password secret (xyzpdq
) is returned at the beginning of the next line, immediately before the command line prompt, similar to what is shown below:
In this task, you create a new version 2 secret and use the secrets command to verify the version 2 value of the password secret.
abc123
.Now, let's use the new secret.
abc123
) is returned at the beginning of the next line, immediately before the command line prompt, similar to what is shown in the screenshot below:If successful, you should see that the version 2 value of the password secret (abc123
) is returned at the beginning of the next line, immediately before the command line prompt, similar to what is shown in the screenshot below:
Click Check my progress to verify the objective.
In this task, you create a new secret version and disable all the past versions. You also verify that only the latest version is accessible.
def123
.def123
) is returned at the beginning of the next line, immediately before the command line prompt, similar to what is shown in the screenshot below:This should produce a FAILED PRECONDITION error, informing you that version 2 is in the DISABLED state. (If you tried to access version 1, the same error would be produced.)
Click Check my progress to verify the objective.
In this task, you re-enable the version 2 password secret and verify that the version 2 password secret is accessible.
If successful, you should see that the version 2 value of the password secret (abc123
) is returned at the beginning of the next line, immediately before the command line prompt, similar to what is shown below:
In this lab you did the following:
Enabled the Secret Manager API.
Created and used a new secret.
Created a new version of a secret.
Disabled the older version(s).
Reinstated and verified the older version of a secret.
When you have completed your lab, click End Lab. Google Cloud Skills Boost removes the resources you’ve used and cleans the account for you.
You will be given an opportunity to rate the lab experience. Select the applicable number of stars, type a comment, and then click Submit.
The number of stars indicates the following:
You can close the dialog box if you don't want to provide feedback.
For feedback, suggestions, or corrections, please use the Support tab.
Copyright 2022 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one