Making a function private
For a function to be invoked only by users with rights to invoke it, make the function private.
If all unauthorized users (
allUsers system group) of a cloud or folder are granted rights to invoke a function, the function will be public regardless of the settings. How to revoke a role.
- In the management console, select the folder containing your function.
- Select Cloud Functions.
- Select the function you want to make private.
- On the Overview page, under General information, turn the Public function option off.
If you don't have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the
To make a function private, run the command:
yc serverless function deny-unauthenticated-invoke <function name>