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
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Serverless Containers
  • Comparison with other Yandex Cloud services
    • All guides
    • Getting an IAM token for a service account using a container
      • Making a container public
      • Making a container private
      • Viewing roles assigned to a container
      • Assigning roles to a container
      • Revoking roles assigned to a container
    • Viewing operations with service resources
  • Access management
  • Pricing policy
  • Terraform reference
  • Audit Trails events
  • Release notes
  • FAQ
  1. Step-by-step guides
  2. Managing rights to access a container
  3. Assigning roles to a container

Assigning roles to a container

Written by
Yandex Cloud
Updated at November 14, 2024
CLI
API

To assign a role to a container, run this command:

  • To a user:
    yc serverless container add-access-binding \
      --name <container_name> \
      --user-account-id <user_ID> \
      --role <role>
    
    Result:
    done (1s)
    
  • To a service account:
    yc serverless container add-access-binding \
      --name <container_name> \
      --service-account-id <service_account_ID> \
      --role <role>
    
    Result:
    done (1s)
    
  • To all authenticated users (the All authenticated users public group):
    yc serverless container add-access-binding \
      --name <container_name> \
      --all-authenticated-users \
      --role <role>
    
    Result:
    done (1s)
    

To assign roles for a container, use the setAccessBindings REST API method for the Container resource or the ContainerService/SetAccessBindings gRPC API call.

Was the article helpful?

Previous
Viewing roles assigned to a container
Next
Revoking roles assigned to a container
Yandex project
© 2025 Yandex.Cloud LLC