Manage service accounts
Temporal Cloud provides Account Owner and Global Admin roles with the option to create machine identities named Service Accounts.
Service Accounts are a type of identity in Temporal Cloud. Temporal Cloud supports User identities as a representation of a human user who uses Temporal Cloud. Service Accounts afford Temporal Cloud Account Owner and Global Admin roles the ability to create an identity for machine authentication, an identity not associated with a human user.
With the addition of Service Accounts, Temporal Cloud now supports 2 identity types:
- Users (tied to a human, identified by email address or ID)
- Service Accounts (not tied to a human, email address optional, identified by name or ID)
Service Accounts use API Keys as the authentication mechanism to connect to Temporal Cloud. You should use Service Accounts to represent a non-human identity when authenticating to Temporal Cloud for operations automation or the Temporal SDKs and the Temporal CLI for Workflow Execution and management.
Get started
To get started with Service Accounts, ensure you are Temporal Cloud user.
Prerequisites:
- A Cloud user account with Account Owner or Global Admin role permissions
- Access to the Temporal Cloud UI or Temporal Cloud CLI (tcld)
- Enable access to API Keys for your Account
- To manage Service Accounts using the Temporal Cloud CLI (tcld), upgrade to the latest version of tcld (v0.18.0 or higher) using
brew upgrade tcld
.- If using a version of tcld less than v0.31.0, enable Service Account commands with
tcld feature toggle-service-account
.
- If using a version of tcld less than v0.31.0, enable Service Account commands with
Managing Service Accounts
Account Owner and Global Admin roles can manage Service Accounts by creating, viewing, updating, deleting Service Accounts using the following tools:
- Temporal Cloud UI
- Temporal Cloud CLI (tcld)
- Use
tcld service-account --help
for a list of all service-account commands
- Use
Account Owner and Global Admin roles also have the ability to manage API Keys for Service Accounts.
Create a Service Account
Create a Service Account using the Temporal Cloud UI or tcld. While User identities are invited to Temporal Cloud, Service Accounts are created in Temporal Cloud.
Using the Cloud UI
- Navigate to https://cloud.temporal.io/settings/identities
- Click the
Create Service Account
button located near the top right of theIdentities
page - Provide the following information:
- Name (required)
- Description (optional)
- Account Level Role (required)
- Namespace Permissions (optional)
- Use this section of the Create Service Account page to grant the Service Account access to individual Namespaces
- Click
Create Service Account
at the bottom of the page- A status message is displayed at the bottom right corner of the screen and on the next screen
- You will be prompted to create an API Key for the Service Account (optional)
- (Optional) Create API Key
- It is recommended to create an API Key for the Service Account right after you create the Service Account, though you can create/manage API Keys for Service Accounts at any time
- See the API Key documentation for more information on creating and managing API Keys
Using tcld
To create a Service Account using tcld, use the tcld service-account create
command:
tcld service-account create -n "sa_test" -d "this is a test SA" --ar "Read"
This example creates a Service Account with the name "sa_test"
, description "this is a test SA"
, and a Read
Account Role.
Creating a Service Account requires the following attributes: name
and account-role
(as above).
You can also provide the Namespace Permissions for the Service Account using the —-np
flag.
Creating a Service Account returns the ServiceAccountId
which is used to retrieve, update, or delete a Service Account.
View Service Accounts
View a single or all Service Account(s) using the Temporal Cloud UI or tcld.
Using the Cloud UI
Service Accounts are listed on the Identities
section of the Settings
page, along with Users.
To locate a Service Account:
- Navigate to https://cloud.temporal.io/settings/identities
- Select the
Service Accounts
filter
Using tcld
To view all Service Accounts in your account using tcld, use the tcld service-account list
command:
tcld service-account list
Delete a Service Account
Delete a Service Account using the Temporal Cloud UI or tcld.