Create your Fleet Engine project

This guide covers how to set up your Google Cloud project and create service account roles from the command-line utility.

For more details, see Service account roles.

Set up the Cloud project

  • Create a Google Cloud Project using the Google Cloud Console. Follow the basic instructions on the Getting Started with Google Maps Platform

  • Work with your Google sales representative to enable billing and the APIs for your specific service.

  • Install the Cloud CLI tool to complete the service configuration you started with your sales representative.

  • Authenticate the CLI to your project.

Note: Consider using the Cloud Shell interactive environment where Cloud SDK and other dependencies such as **curl** are already installed. See Using Cloud Shell.

shell

gcloud auth login

You should see a success message such as:

You are now logged in as [my-user@example.com].
Your current project is [project-id].  You ...

Check that Fleet Engine APIs are configured appropriately.

shell

gcloud --project=project-id services enable fleetengine.googleapis.com

If this command results in an error, check with your project administrator and your Google support representative to get access.

Create service accounts in the console

To create a service account, do the following:

  1. Go to the Google Cloud console.
  2. Find and click the IAM & Admin card.
  3. In the left-hand navigation, select Service Accounts.
  4. At the top of the page, click Create Service Account.
  5. Enter a service account name to display in the Google Cloud console. The Google Cloud console then generates a service account ID based on this name. For example, enter fleet-engine-driver-sdk for your Driver SDK User Service Account.
  6. From the Role drop-down, select Fleet Engine and assign one of the roles to the service account.
  7. Skip the Grant users access to this service account section.
  8. Click Done to finish creating the service account.

See also Create a service account .

Create service accounts using the Google Cloud Command line utility

For example, create a service account for each of the three roles and assign them their respective roles.

On-demand trips roles

gcloud --project=project-id iam service-accounts create fleet-engine-admin
gcloud projects add-iam-policy-binding project-id \
       --member=serviceAccount:fleet-engine-admin@project-id.iam.gserviceaccount.com \
       --role=roles/fleetengine.ondemandAdmin

gcloud --project=project-id iam service-accounts create fleet-engine-driver-sdk
gcloud projects add-iam-policy-binding project-id \
       --member=serviceAccount:fleet-engine-driver-sdk@project-id.iam.gserviceaccount.com \
       --role=roles/fleetengine.driverSdkUser

gcloud --project=project-id iam service-accounts create fleet-engine-consumer-sdk
gcloud projects add-iam-policy-binding project-id \
       --member=serviceAccount:fleet-engine-consumer-sdk@project-id.iam.gserviceaccount.com \
       --role=roles/fleetengine.consumerSdkUser

Scheduled tasks roles

gcloud --project=project-id iam service-accounts create fleet-engine-admin
gcloud projects add-iam-policy-binding project-id \
       --member=serviceAccount:fleet-engine-admin@project-id.iam.gserviceaccount.com \
       --role=roles/fleetengine.deliveryAdmin

gcloud --project=project-id iam service-accounts create fleet-engine-driver-sdk
gcloud projects add-iam-policy-binding project-id \
       --member=serviceAccount:fleet-engine-driver-sdk@project-id.iam.gserviceaccount.com \
       --role=roles/fleetengine.deliveryUntrustedDriver

gcloud --project=project-id iam service-accounts create fleet-engine-consumer-sdk
gcloud projects add-iam-policy-binding project-id \
       --member=serviceAccount:fleet-engine-consumer-sdk@project-id.iam.gserviceaccount.com \
       --role=roles/fleetengine.deliveryConsumer

What's next