Use the following instructions to set up Cloud Scheduler. You may already have some of these tools installed.
Install and configure the gcloud CLI:
-
Add the
gcloud
components for products:gcloud components install
Update all components:
gcloud components update
Use gcloud
to create a project
Or you can use an existing project, if you have one.
Open a terminal on the machine where you installed the gcloud CLI and create a Google Cloud project:
gcloud projects create PROJECT_ID
where PROJECT_ID is the ID for the project you want to create. Project IDs must start with a lowercase letter and can have lowercase ASCII letters, digits or hyphens. They must be between 6 and 30 characters.
Configure
gcloud
to use the project you have chosen:gcloud config set project PROJECT_ID
where PROJECT_ID is the ID you set previously.
Use gcloud
to create an App Engine app, when appropriate
If you are going to use an App Engine HTTP target, your project must have an App Engine app. This app serves as both the location of the Cloud Scheduler service and of the handler itself. If you wish to have an App Engine handler that is not in your project, you should select an HTTP target instead. In this case you do not need an App Engine app in your project.
To create the app:
gcloud app create [--region=REGION]
where REGION is the location in which the app runs. Note that two locations, called
europe-west
andus-central
in App Engine commands, are called, respectively,europe-west1
andus-central1
in Cloud Scheduler commands.You can check the region of an existing app with the command:
gcloud app describe
The region is listed by
locationId
. Your location, for example, might be shown aslocationId: us-central
.Once you set a region for the App Engine app, you cannot change it.
Use the Google Cloud console to enable features:
Your project now supports Cloud Scheduler.