AI-generated Key Takeaways
- 
          This guide explains how to set up a Google Cloud project for Fleet Engine, including enabling billing and necessary APIs. 
- 
          It details the process of creating service accounts with specific roles using both the Google Cloud Console and the command-line interface. 
- 
          You'll learn how to assign roles such as fleetengine.ondemandAdminandfleetengine.driverSdkUserto these service accounts.
- 
          The guide provides instructions for authenticating the Cloud CLI to your project for command-line operations. 
- 
          It also offers guidance on using Cloud Shell for a pre-configured environment. 
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 loginYou 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.comIf 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:
- Go to the Google Cloud console.
- Find and click the IAM & Admin card.
- In the left-hand navigation, select Service Accounts.
- At the top of the page, click Create Service Account.
- 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.
- From the Role drop-down, select Fleet Engine and assign one of the roles to the service account.
- Skip the Grant users access to this service account section.
- 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