GCP projects
Give learners access to GCP projects.
This guide explains how to access a Google Cloud Platform (GCP) project from Instruqt.
A GCP project is a set of configuration settings that define how your app interacts with Google services and what resources it uses.
Before you begin
You must have already created a track or sandbox preset to which you can add access to a GCP project.
Access GCP projects
It is best to add the Instruqt Cloud Client container to your sandbox to give a learner access to a GCP project. Because the Instruqt Cloud Client container:
Exposes links to GCP Cloud Consoles for the resources configured in the
config.ymlfile, with the credentials required to log in.Includes the
gcloudCLI, pre-configured with the required credentials.
The GCP Cloud Console and the gcloud CLI make it easy for content developers and learners to access Google Cloud resources from the sandbox.
It takes the following steps to give learners access to a GCP project:
Add an Instruqt Cloud Client container to your sandbox
Add a GCP project to your sandbox.
Add tabs to your challenges where you want to expose the GCP console or
gcloudCLI.
Additionally, you can use:
A set of environment variables that are available in the
gcloudCLI.Google Cloud APIs that you set through IAM permissions.
Step 1: Add an Instruqt Cloud Client container to your sandbox
More information can be found in the cloud client section.
Step 2: Review the security best practices
Step 3: Add a GCP project to your sandbox
Click + Add a cloud account on the Sandbox page. ↳ The Add cloud account pop-up opens.
Select the Google provider.
In the Name field, enter
example-project.In the Services field, select the services that are going to be enabled.
In the Regions field, select the regions that are going to be enabled.
In the User Roles field, enter the desired roles for the end user.
In the Admin Roles field, enter the desired roles for the admin user.
Click Save to add the GCP project.
Click Back to track to return to the Track dashboard page.
Copy and paste the following code into
config.yml:↳ Your
config.ymlfile should be similar to this now:
Step 4: Add tabs to expose the GCP console and gcloud CLI
In the Challenges section, click Add new, and select Assignment from the dropdown.
On the new challenge page, input these values:
FieldValueName
GCP projectURL
gcp-projectDescription
Learn to work with a GCP projectClick Save.
Click Tabs followed by Add new tab.
Select the Your applications tab type.
Input these values to set the GCP console:
FieldValueTab name
CGP project consoleSelect your host
cloud-clientPath
/Port
80Click Save to add the tab.
Click Add new tab again.
Select the Terminal tab type.
Input these values to set the
gcloudCLI:FieldValueTab name
gcloud CLIHost
cloud-clientClick Save to add the tab.
Click Back to track.
Click Play track and test your GCP project track.
Open a terminal and change to your track directory.
Enter the following command to create a new challenge:
Open the
assignment.mdfile in your code editor.Copy and paste the following code into
assignment.mdto set the GCP console andgcloudCLI:Save file
assignment.md.Push the track to the Instruqt platform:
Play and test the track:
↳ Your browser opens, showing the Track overview page, select Play.
Last updated
Was this helpful?