Parameter | Type | Description | Example |
---|---|---|---|
object | The information about request parameters to create the function. | ||
code | InputCodeLocation | The code of the function. The code must be packaged into a .zip file. You must configure either the code parameter or the customContainerConfig parameter. | |
cpu | float | The number of vCPUs of the function. The value is a multiple of 0.05. | 1 |
customContainerConfig | CustomContainerConfig | The configuration of the Custom Container runtime. After you configure the Custom Container runtime, Function Compute can execute the function in a Custom Container image. You must configure either the code parameter or the customContainerConfig parameter. | |
customDNS | CustomDNS | The custom Domain Name System (DNS) settings. | |
customRuntimeConfig | CustomRuntimeConfig | The configuration of the custom runtime. | |
description | string | The description of the function. | my function |
diskSize | integer | The disk size of the function. Unit: MB. Valid values: 512 and 10240. | 512 |
environmentVariables | object | The environment variables of the function. You can access the environment variables configured in the runtime. | |
string | value1 | ||
functionName | string | The name of the function. The name can contain only letters, digits, underscores (_), and hyphens (-). The name cannot start with a digit or a hyphen (-). The name must be 1 to 64 characters in length. | my-function-1 |
gpuConfig | GPUConfig | The GPU configuration of the function. | |
handler | string | The handler of the function. The handler format is related to the runtime you use. | index.handler |
instanceConcurrency | integer | The number of requests that can be concurrently processed by the instance. | 1 |
instanceLifecycleConfig | InstanceLifecycleConfig | The configuration of the lifecycle hook for the function instance. | |
internetAccess | boolean | service config | true |
layers | array | The layers. Multiple layers are merged based on the order of array subscripts. The content of a layer with a smaller subscript overwrites the file that has the same name as a layer with a larger subscript. | |
string | The Alibaba Cloud Resource Name (ARN) of the layer. | acs:fc:cn-beijing:186824xxxxxx:layers/fc_layer/versions/1 | |
logConfig | LogConfig | The log configuration. Function Compute writes function execution logs to the specified Logstore. | |
memorySize | integer | The memory size of the function. Unit: MB. The value must be a multiple of 64. The memory size varies based on the function instance type you use. | 512 |
nasConfig | NASConfig | The configuration of the File Storage NAS (NAS) file system. This allows functions in the specified service to access the NAS file system. | |
ossMountConfig | OSSMountConfig | The mount configuration of Object Storage Service (OSS). | |
role | string | The Resource Access Management (RAM) role that is used to grant the required permissions to Function Compute. You can use the RAM role in the following scenarios: 1. Send the logs that the function generates to your Logstore. 2. Generate temporary tokens that are used to access other cloud resources during function execution. | acs:ram::188077086902****:role/fc-test |
runtime | string | The runtime of the function. | python3.10 |
timeout | integer | The timeout period for the execution of the function. Unit: seconds. Default value: 3. Minimum value: 1. When this period is elapsed, the function execution is terminated. | 60 |
tracingConfig | TracingConfig | The configuration of Managed Service for OpenTelemetry. After Function Compute is integrated with Managed Service for OpenTelemetry, you can record the duration of a request in Function Compute, view the cold start duration of a function, and record the execution duration of a function. | |
vpcConfig | VPCConfig | The VPC configuration. This allows functions in the specified service to access the specified VPC. |