Specifying a cloud network where the function will be executed
Written by
Updated at April 24, 2025
You can specify a cloud network where the function will be executed.
A cloud network must meet the following conditions:
- Has subnets in all availability zones.
- Has at least one resource with an IP address in the specified cloud network.
Note
If the network does not meet the conditions above, the service does not guarantee its operation.
Management console
CLI
API
- In the management console
, select the folder containing the function. - Select Cloud Functions.
- Select a function.
- Go to the Editor tab.
- Under Parameters, in the Network field, choose a network for function execution.
- Click Save changes.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID>
command. You can also specify a different folder for any command using the --folder-name
or --folder-id
parameter.
To specify a cloud network, run the command:
yc serverless function version create \
--function-name=<function_name> \
--runtime <runtime_environment> \
--entrypoint <entry_point> \
--memory 128m \
--execution-timeout 5s \
--source-version-id <version_ID> \
--network-id <network_ID>
Where:
--function-name
: Function name.--runtime
: Runtime environment.--entrypoint
: Entry point in<function_file_name>.<handler_name>
format.--memory
: Amount of RAM.--execution-timeout
: Maximum function running time before the timeout is reached.--source-version-id
: ID of the function version from which you want to copy the code.--network-id
: ID of a cloud network where the function will be executed.
To specify a cloud network, use the createVersion REST API method for the Function resource or the FunctionService/CreateVersion gRPC API call.