Making a function private
Written by
For a function to be invoked only by users with rights to invoke it, make the function private.
Note
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.
Management console
CLI
- 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 --folder-name
or --folder-id
parameter.
To make a function private, run the command:
yc serverless function deny-unauthenticated-invoke <function name>
Result:
done (1s)