Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex Managed Service for Valkey™
  • Getting started
    • All guides
      • Getting user info
      • Creating a user
      • Updating user settings
      • Deleting a user
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes
  • FAQ
  1. Step-by-step guides
  2. Users
  3. Deleting a user

Deleting a user

Written by
Yandex Cloud
Updated at October 30, 2025
CLI
Terraform
REST API
gRPC API

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

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

To delete a Valkey™ user:

  1. See the description of the CLI command for deleting a user:

    yc managed-redis user delete --help
    
  2. To delete a user, run this command:

    yc managed-redis user delete <username> \
      --cluster-id=<cluster_ID>
    

    Where --cluster-id is the cluster ID. You can get the cluster ID with the list of clusters in the folder.

    You can get the username with the list of users in the cluster.

  1. Open the current Terraform configuration file describing your infrastructure.

    For more information about creating this file, see this guide.

  2. Delete the yandex_mdb_redis_user resource with the user description.

  3. Validate your configuration.

    1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.

    2. Run this command:

      terraform validate
      

      Terraform will show any errors found in your configuration files.

  4. Confirm resource changes.

    1. Run this command to view the planned changes:

      terraform plan
      

      If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

  5. Run this CLI command to make sure the user was deleted:

    yc managed-redis user list \
      --cluster-id=<cluster_ID>
    

    Learn more on how to get a list of users here.

Time limits

A Terraform provider sets the timeout for Yandex Managed Service for Valkey™ cluster operations:

  • Creating a cluster, including by restoring one from a backup: 15 minutes.
  • Editing a cluster: 60 minutes.
  • Deleting a cluster: 15 minutes.

Operations exceeding the set timeout are interrupted.

How do I change these limits?

Add the timeouts block to the cluster description, for example:

resource "yandex_mdb_redis_cluster" "<cluster_name>" {
  ...
  timeouts {
    create = "1h30m" # 1 hour 30 minutes
    update = "2h"    # 2 hours
    delete = "30m"   # 30 minutes
  }
}
  1. Get an IAM token for API authentication and place it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Use the User.Delete method and send the following request, e.g., via cURL:

    curl \
      --request DELETE \
      --header "Authorization: Bearer $IAM_TOKEN" \
      --url 'https://mdb.api.cloud.yandex.net/managed-redis/v1/clusters/<cluster_ID>/users/<username>'
    

    You can get the cluster ID with the list of clusters in the folder.

    You can get the username with the list of users in the cluster.

  3. Check the server response to make sure your request was successful.

  1. Get an IAM token for API authentication and place it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume the repository contents are stored in the ~/cloudapi/ directory.

  3. Use the UserService.Delete call to execute the following request, e.g., via gRPCurl:

    grpcurl \
      -format json \
      -import-path ~/cloudapi/ \
      -import-path ~/cloudapi/third_party/googleapis/ \
      -proto ~/cloudapi/yandex/cloud/mdb/redis/v1/user_service.proto \
      -rpc-header "Authorization: Bearer $IAM_TOKEN" \
      -d '{
        "cluster_id": "<cluster_ID>",
        "user_name": "<username>"
      }' \
      mdb.api.cloud.yandex.net:443 \
      yandex.cloud.mdb.redis.v1.UserService.Delete
    

    Where:

    • cluster_id: Cluster ID.

      You can get the cluster ID with the list of clusters in the folder.

    • user_name: Username.

      You can get the username with the list of users in the cluster.

  4. Check the server response to make sure your request was successful.

Was the article helpful?

Previous
Updating user settings
Next
Managing shards
© 2025 Direct Cursus Technology L.L.C.