A function is a scheduling and operational unit in Function Compute. A function must belong to a service. All functions in a service share some settings, such as service authorization and log configuration.

Function parameters

When you create a function, you must specify the parameters described in the following table.
Parameter Required Description
FunctionName Yes The name of the function. The name must be unique within the corresponding service and meet the following requirements:
  • The name can contain letters, digits, underscores (_), and hyphens (-).
  • The name must start with a letter or an underscore (_).
  • The name is case-sensitive.
  • The name must be 1 to 128 characters in length.
Runtime Yes The runtime environment of the function.
Code Yes The code package for the function. If you are using Java, you must upload a JAR package. If you are using other languages, you must upload a ZIP package. The package can be stored in Object Storage Service (OSS) or directly uploaded.
Handler Yes The handler used by the Function Compute system to invoke your function.
Description No The description of the function. The Function Compute system does not use the value of this parameter. However, we recommend that you set a simple and clear description for your service.
Timeout No The maximum execution time for the function. Unit: seconds.
InstanceType No The type of the function instance. Valid values:
  • ElasticInstance: flexible instance
  • EnhancedInstance: performance instance
MemorySize No The memory that is required to execute the function. Unit: MB. Value range: 128 to 3072. The value increases at a step size of 64 MB.
Initializer No The handler used by Function Compute to invoke your initializer function.
InitializationTimeout No The maximum execution time for the initializer function. Unit: seconds.

You can modify all parameters later except FunctionName.

Supported runtime environments

Runtime environment Description Reference
nodejs6 Node.js 6.10.3 Node.js runtime environment
nodejs8 Node.js 8.9.0
nodejs10 Node.js 10.15.3
nodejs12 Node.js 12.16.1
python2.7 Python 2.7 Python runtime environment
python3 Python 3.6
php7.2 PHP 7.2.7 PHP runtime
java8 Java 8 Java runtime
dotnetcore2.1 .NET Core 2.1 .NET Core runtime
custom None Custom Runtime
custom-container None Custom Container


Function operations