Enable Cloud APIs with Cloud Shell
This section requires a Google Cloud account. You can create one and get $300 in free credits here. Alternatively, you can use this Google Cloud Skills Boost lab — MongoDB Atlas with Natural Language API and Cloud Run. When you start the lab, you will get access to a temporary Google Cloud account that you can use for the duration of the lab.
Cloud Shell is a command-line environment running Google Cloud. You will be using Cloud Shell to enable Cloud APIs you need for the application deployment.
Cloud Shell is a powerful tool that will help you greatly in your Google Cloud journey. It’s a Debian-based virtual machine, preloaded with all the tools you need for Cloud development.
Configure Cloud Shell
Activate Cloud Shell by clicking on the Activate Cloud Shell icon.
Find your project ID in the Cloud Console dashboard.
Set your project using the
PROJECT_ID
.gcloud config set project <PROJECT_ID>
Enable the Cloud Run and Cloud Build APIs
From Cloud Shell, enable the Cloud Run and Cloud Build APIs
gcloud services enable run.googleapis.com
gcloud services enable cloudbuild.googleapis.comIf prompted, authorize Cloud Shell to make API calls.
You should see a success message similar to this one:
Operation "operations/acf.cc11252d-30af-47ad-9d59-477a12847c9e" finished successfully.
To see all enabled APIs, you can run:
gcloud services list
Fetch the source code
You need the source code of the app in order to deploy it to Cloud Run. Run git clone
in the Cloud Shell to fetch the public Github repository.
git clone https://github.com/mongodb-developer/Google-Cloud-MongoDB-Atlas-Workshop.git