Specifying a cloud network where the function will be executed
Written by
Note
This feature is in the Preview stage. For access, contact technical support.
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 given cloud network.
Management console
CLI
API
- In the management console, select the folder containing your 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 Create version.
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 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
: The function name.--runtime
: The runtime environment.--entrypoint
: The entry point specified in the. format. --memory
: The amount of RAM.--execution-timeout
: The maximum function execution time before the timeout is reached.--source-version-id
: The ID of the function version to copy the code of.--network-id
: ID of a cloud network where the function will be executed.
You can specify a cloud network using the createVersion API method.