Assigning roles to a container
Written by
Updated at October 17, 2024
CLI
API
To assign a role to a container, run this command:
- User:
yc serverless container add-access-binding \ --name <container_name> \ --user-account-id <user_ID> \ --role <role>
done (1s)
- Service account:
yc serverless container add-access-binding \ --name <container_name> \ --service-account-id <service_account_ID> \ --role <role>
done (1s)
- All authorized users (the
All authenticated users
public group):yc serverless container add-access-binding \ --name <container_name> \ --all-authenticated-users \ --role <role>
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.