Assigning roles to a container
Written by
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>
done (1s)
- To a service account:
yc serverless container add-access-binding \ --name <container_name> \ --service-account-id <service_account_ID> \ --role <role>
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>
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.