Making a function private
Written by
Updated at September 23, 2024
For a function to be invoked only by users with rights to invoke it, make the function private.
Note
If all unauthorized users (the All users public group) of a cloud or folder are granted permissions to invoke a function, the function will be public regardless of its settings. How to revoke a role.
Management console
CLI
- In the management console
, select the folder containing the function. - Select Cloud Functions.
- Select the function you want to make private.
- On the Overview page, disable Public function.
If you do not 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)