A service account is a special type of account in Google Cloud that enables components
and applications of a system to interact with each other and with other APIs. For more information
about Google Cloud, see About Google Cloud services.
Apigee hybrid uses Google Cloud service accounts to perform a variety of tasks, including:
Send log and metrics data
Pull trace requests
Connect to API gateway for administrative API requests
Execute back ups
Download proxy bundles
While one service account could perform all of these operations, for production
environments Apigee recommends that you create multiple service accounts, each assigned to a
specific task and each with its own set of permissions. This enhances security by
compartmentalizing access and limiting each service account's scope and access privileges. As with
user accounts, these permissions are applied by assigning one or more roles to the service
account.
Service accounts and roles used by hybrid components
To operate properly, Apigee hybrid requires you to create several service accounts. Each
service account requires a specific role or roles that enable it to perform its function.
The following table describes the service accounts for the hybrid components. The names given for
each service account are the default names. You can use any names you want, but the names should be
easy to identify with each account's purpose.
Component*
Role
Required for basic install?
Description
apigee-cassandra
Storage Object Admin roles/storage.objectAdmin
Allows Cassandra backups to Cloud Storage, as
described in Backup and recovery.
apigee-logger
Logs Writer roles/logging.logWriter
Allows logging data collection, as described in Logging. Only required for non-GKE
cluster installations.
apigee-mart
Apigee Connect Agent roles/apigeeconnect.Agent
Allows MART service authentication. The Apigee Connect Agent role allows it to communicate
securely with the Apigee Connect process, as described in Using
Apigee Connect.
Allows the transfer of trace, analytics and deployment status data to the management
plane.
apigee-watcher
Apigee Runtime Agent roles/apigee.runtimeAgent
Apigee Watcher pulls virtual hosts related changes for an org from synchronizer and makes
necessary changes to configure istio ingress.
* This name is used in the downloaded service account
key's filename.
As an alternative, for nonproduction, test, and demo environments, you can use a single service
account with all the roles assigned to it. This is not recommended for production environments.
In addition to creating the service accounts listed in this table, you will use each accounts
private keys to generate access tokens so that you can access the Apigee APIs. The
create-service-account tool automaticallyl downloads the key files into a directory
on your local machine when it creates or updates the service accounts.
Create the service accounts
There are several ways to create service accounts, including:
Each of these is described in the following sections.
Use the create-service-account tool
The create-service-account tool is available after you
download and expand apigeectl in the
tools/ directory. It hybrid component-specific service accounts and assigns
the required roles for you. The tool also automatically downloads the service account keys and
stores them on your local machine.
For example, the following command will create all the separate individual service accounts for a
production environment, assign the appropriate IAM roles to each service account, and download
each accounts private key file to the ./service-accounts directory:
./tools/create-service-account --env prod
The following command creates a single service account named apigee-non-prod with all IAM
roles for all hybrid components,
suitable for demo and test environments, but not for production environments:
In the Service account name field, enter a name. The
Cloud console fills in the Service account ID field based on
this name.
Apigee recommends that you use a name that reflects the service account's role; you
can set the name of the service account to be the same name as the component that uses it.
For example, set the name of the Logs Writer service account apigee-logger.
Optional: In the Service account description field, enter a description for
the service account. Descriptions are helpful at reminding you what a particular service
account is used for.
For example, for the logging component, select the Logs Writer role.
If necessary, enter text to filter the list of roles by name. For example, to list only
the Apigee roles, enter Apigee in the filter field.
You can add more than one role to a service account, but Apigee recommends that
you only use one role for each of the recommended service accounts. To change the roles of
a service account after you have created it, use the IAM
page in the Cloud console.
Click Continue.
Google Cloud displays the Grant users access to this service account view:
Under Create key (optional), click Create Key.
Google Cloud gives you the option to download a JSON or P12 key:
Select JSON (the default) and click Create.
Google Cloud saves the key file in JSON format to your local machine and displays a confirmation when
it is successful, as the following example shows:
You will later use some of the service account keys to configure hybrid runtime services.
For example, when you configure the hybrid runtime, you will specify the location of the service
account keys using the SERVICE_NAME.serviceAccountPath properties.
These keys are used by the service accounts to get access tokens, which the service account
then uses to make requests against the Apigee APIs on your behalf. (But that's not for a while
yet; for now, just remember where you saved it.)
Repeat steps 4 through 11 for each service account listed in
Service accounts and roles used by hybrid components
(except the apigee-mart account—which has no role associated with it—so
do not assign it a role).
When you're finished, you should have the following service accounts (in addition to the
defaults, if any):
In the Google Cloud console, service accounts are indicated with the
icon.
After you create a service account, if you want to add or remove a role to it, you must use
the IAM & Admin view. You cannot manage roles for service accounts in the
Service accounts view.
Use the gcloud service account creation APIs
You can create and manage service accounts with the Cloud Identity and Access Management API.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-26 UTC."],[[["\u003cp\u003eApigee hybrid utilizes Google Cloud service accounts to carry out various operations, such as sending log and metrics data, pulling trace requests, connecting to the API gateway, executing backups, and downloading proxy bundles.\u003c/p\u003e\n"],["\u003cp\u003eFor enhanced security in production environments, it is recommended to create multiple service accounts, each dedicated to a specific task with its own set of permissions, rather than using a single account for all operations.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ecreate-service-account\u003c/code\u003e tool is recommended for creating hybrid component-specific service accounts, as it automatically assigns the necessary roles and downloads the service account keys.\u003c/p\u003e\n"],["\u003cp\u003eIn non-production, testing, and demo environments, a single service account with all required roles can be used, whereas in production you must utilize several service accounts, each with its own key, and specific role.\u003c/p\u003e\n"],["\u003cp\u003eReusing the name of a deleted service account can cause unexpected issues; if a service account is deleted, always recreate it with a unique name.\u003c/p\u003e\n"]]],[],null,["# About service accounts\n\n| You are currently viewing version 1.7 of the Apigee hybrid documentation. **This version is end of life.** You should upgrade to a newer version. For more information, see [Supported versions](/apigee/docs/hybrid/supported-platforms#supported-versions).\n\nA *service account* is a special type of account in Google Cloud that enables components\nand applications of a system to interact with each other and with other APIs. For more information\nabout Google Cloud, see [About Google Cloud services](/apigee/docs/hybrid/v1.7/what-is-hybrid#about-gcp).\n| **SERVICE ACCOUNT FACTOID** \n| Google Cloud projects have a limit of 100 service accounts---including the default service accounts (if any).\n\nApigee hybrid uses Google Cloud service accounts to perform a variety of tasks, including:\n\n- Send log and metrics data\n- Pull trace requests\n- Connect to API gateway for administrative API requests\n- Execute back ups\n- Download proxy bundles\n\nWhile one service account *could* perform all of these operations, for production\nenvironments Apigee recommends that you create multiple service accounts, each assigned to a\nspecific task and each with its own set of permissions. This enhances security by\ncompartmentalizing access and limiting each service account's scope and access privileges. As with\nuser accounts, these permissions are applied by assigning one or more roles to the service\naccount.\n\nService accounts and roles used by hybrid components\n----------------------------------------------------\n\nTo operate properly, Apigee hybrid requires you to create several service accounts. Each\nservice account requires a specific role or roles that enable it to perform its function.\n\nThe following table describes the service accounts for the hybrid components. The names given for\neach service account are the default names. You can use any names you want, but the names should be\neasy to identify with each account's purpose.\n\n\nAs an alternative, for nonproduction, test, and demo environments, you can use a single service\naccount with all the roles assigned to it. This is not recommended for production environments.\n\nIn addition to creating the service accounts listed in this table, you will use each accounts\nprivate keys to generate access tokens so that you can access the Apigee APIs. The\n`create-service-account` tool automaticallyl downloads the key files into a directory\non your local machine when it creates or updates the service accounts.\n\nCreate the service accounts\n---------------------------\n\n| **Deleting and recreating service accounts:** Note that reusing the name of a deleted service account may result in unexpected behavior. If you create a service account and delete it, always recreate it with a unique name. For details, see [Deleting and recreating service accounts](/iam/docs/service-account-overview#deleting-recreating).\n\nThere are several ways to create service accounts, including:\n\n- (*Recommended* ) [`create-service-account` tool](#tool)\n- [Google Cloud console](#gcp)\n- [gcloud SDK](#gcloud)\n\nEach of these is described in the following sections.\n\n### Use the `create-service-account` tool\n\nThe `create-service-account` tool is available after you\n[download and expand `apigeectl`](/apigee/docs/hybrid/v1.7/install-apigeectl) in the\n`tools/` directory. It hybrid component-specific service accounts and assigns\nthe required roles for you. The tool also automatically downloads the service account keys and\nstores them on your local machine.\n\nFor example, the following command will create all the separate individual service accounts for a\nproduction environment, assign the appropriate IAM roles to each service account, and download\neach accounts private key file to the `./service-accounts` directory: \n\n```\n./tools/create-service-account --env prod\n```\n\n\nThe following command creates a single service account named `apigee-non-prod` with all IAM\nroles for all hybrid components,\nsuitable for demo and test environments, but not for production environments: \n\n```\n./tools/create-service-account --env non-prod\n```\n\nFor more information on using `create-service-account`, see\n[create-service-account reference](/apigee/docs/hybrid/v1.7/create-service-account).\n\n### Use the Google Cloud console\n\nYou can create service accounts with the Google Cloud console.\n| **Note:** To create service accounts in the Google Cloud console, you must have the Google Cloud Service Account Admin role or greater.\n\n**To create a service account with the Google Cloud console and generate a key for the\nservice account, do the following:**\n\n1. Create a service account:\n\n 1. In the Cloud console, go to the **Service Accounts** page.\n\n [Go to\n Service Accounts](https://console.cloud.google.com/iam-admin/serviceaccounts)\n 2. Select your project.\n 3. Click add**Create Service Account**.\n 4.\n In the **Service account name** field, enter a name. The\n Cloud console fills in the **Service account ID** field based on\n this name.\n\n\n Apigee recommends that you use a name that reflects the service account's role; you\n can set the name of the service account to be the same name as the component that uses it.\n For example, set the name of the Logs Writer service account `apigee-logger`.\n\n\n For more information about the service accounts names and roles, see\n [Service accounts and roles used by hybrid components](#recommended-sas).\n 5. Optional: In the **Service account description** field, enter a description for the service account. Descriptions are helpful at reminding you what a particular service account is used for.\n 6. Click **Create and continue**.\n 7.\n Click the **Select a role** field and select a role, as described in\n [Service accounts and roles used by hybrid components](#recommended-sas). If\n the Apigee roles do not appear in the drop down list, refresh the page.\n\n For example, for the logging component, select the Logs Writer role.\n\n\n If necessary, enter text to filter the list of roles by name. For example, to list only\n the Apigee roles, enter `Apigee` in the filter field.\n\n\n You can add more than one role to a service account, but Apigee recommends that\n you only use one role for each of the recommended service accounts. To change the roles of\n a service account after you have created it, use the **IAM**\n page in the Cloud console.\n | **Note:** If you do not see the roles listed in [Recommended service accounts](#recommended-sas), check with your Apigee account representative to be sure that your account was properly configured and that your organization was provisioned.\n 8. Click **Continue** .\n\n Google Cloud displays the **Grant users access to this service account** view:\n\n 9. Under **Create key (optional)** , click **Create Key** .\n\n Google Cloud gives you the option to download a JSON or P12 key:\n\n 10. Select JSON (the default) and click **Create** .\n\n Google Cloud saves the key file in JSON format to your local machine and displays a confirmation when\n it is successful, as the following example shows:\n\n You will later use some of the service account keys to configure hybrid runtime services.\n For example, when you configure the hybrid runtime, you will specify the location of the service\n account keys using the \u003cvar translate=\"no\"\u003eSERVICE_NAME\u003c/var\u003e`.serviceAccountPath` properties.\n\n These keys are used by the service accounts to get access tokens, which the service account\n then uses to make requests against the Apigee APIs on your behalf. (But that's not for a while\n yet; for now, just remember where you saved it.)\n 11. Repeat steps 4 through 11 for each service account listed in [Service accounts and roles used by hybrid components](#recommended-sas) (except the `apigee-mart` account---which has no role associated with it---so do not assign it a role).\n\n When you're finished, you should have the following service accounts (in addition to the\n defaults, if any):\n\n\n In the Google Cloud console, service accounts are indicated with the\n icon.\n\n After you create a service account, if you want to add or remove a role to it, you must use\n the **IAM \\& Admin** view. You cannot manage roles for service accounts in the\n **Service accounts** view.\n | **Tip:** Apigee hybrid includes a validator that checks your service accounts' key files and permissions when [apigeectl](/apigee/docs/hybrid/v1.7/cli-reference) applies the Apigee hybrid runtime components to your cluster. This validation is enabled by default. For more information, see [Service account\n | validation](/apigee/docs/hybrid/v1.7/sa-validation).\n\n ### Use the gcloud service account creation APIs\n\n You can create and manage service accounts with the Cloud Identity and Access Management API.\n\n For more information, see\n [Creating\n and managing service accounts](/iam/docs/creating-managing-service-accounts).\n\n Troubleshooting\n ---------------\n\n | **Deleting and recreating service accounts:** Note that reusing the name of a deleted service account, may result in unexpected behavior. If you create a service account and delete it, always recreate it with a unique name. For details, see [Deleting and recreating service accounts](/iam/docs/service-account-overview#deleting-recreating)."]]