Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Identity and Access Management
    • All guides
    • Handling secrets that are available in the public domain
      • Creating a service account
      • Updating a service account
      • Assigning roles to a service account
      • Setting up service account access permissions
      • Getting information about a service account
      • Getting an ID token for a service account
      • Deleting a service account
  • Secure use of Yandex Cloud
  • Access management
  • Pricing policy
  • Role reference
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  1. Step-by-step guides
  2. Service accounts
  3. Updating a service account

Updating a service account

Written by
Yandex Cloud
Improved by
Danila N.
Updated at April 22, 2025

You can change a service account's name and description. Using the Yandex Cloud API you can also label a service account.

To change a service account's roles, follow this guide.

Management console
CLI
Terraform
API

To update a service account:

  1. In the management console, navigate to the folder the service account belongs to.

  2. In the list of services, select Identity and Access Management.

  3. In the left-hand panel, select Service accounts.

  4. In the line with the service account you need, click and select **Edit **.

  5. Change the name of your service account.

    The name format requirements are as follows:

    • It must be from 2 to 63 characters long.
    • It may contain lowercase Latin letters, numbers, and hyphens.
    • It must start with a letter and cannot end with a hyphen.
  6. Change the description of your service account.

  7. Click Save.

If you do not have the Yandex Cloud CLI yet, install and initialize it.

To update a service account:

  1. See the description of the update service account command:

    yc iam service-account update --help
    
  2. Select a service account, e.g., my-robot:

    yc iam service-account list
    

    Result:

    +----------------------+------------------+-------------------------------+
    |          ID          |       NAME       |          DESCRIPTION          |
    +----------------------+------------------+-------------------------------+
    | aje6o61dvog2******** | my-robot         |                               |
    | aje9sda1ufvq******** | account_name     | account_description           |
    +----------------------+------------------+-------------------------------+
    
  3. Change the service account parameters, such as name and description:

    yc iam service-account update my-robot \
      --new-name my-service-account \
      --description "this is my service account"
    

    The name format requirements are as follows:

    • It must be from 2 to 63 characters long.
    • It may contain lowercase Latin letters, numbers, and hyphens.
    • It must start with a letter and cannot end with a hyphen.

If you do not have Terraform yet, install it and configure its Yandex Cloud provider.

To update a service account:

  1. Open the Terraform configuration file and edit the fragment with the service account description.
    Example of the service account description in the Terraform configuration:

    ...
    resource "yandex_iam_service_account" "sa" {
      name        = "my-robot"
      description = "this is new description"
     }
    ...
    
  2. Check the configuration using this command:

    terraform validate
    

    If the configuration is correct, you will get this message:

    Success! The configuration is valid.
    
  3. Run this command:

    terraform plan
    

    The terminal will display a list of resources with parameters. No changes will be made at this step. If the configuration contains any errors, Terraform will point them out.

  4. Apply the configuration changes:

    terraform apply
    
  5. Confirm the changes: type yes into the terminal and press Enter.

    You can check whether the service account has been updated in the management console or using the CLI command:

    yc iam service-account list
    

To update a service account, use the update REST API method for the ServiceAccount resource or the ServiceAccountService/Update gRPC API call.

Was the article helpful?

Previous
Creating a service account
Next
Assigning roles to a service account
© 2025 Direct Cursus Technology L.L.C.