Overview
Introduction
Cloud Functions is a cloud function service provided by Makers. It is suitable for complex backend scenarios that require accessing external services, operating databases, or handling compute-intensive tasks.
Supported runtime
Cloud Functions supports various mainstream programming languages and runtime environments. You can select the appropriate runtime based on your business needs.
Node.js
Supports JavaScript or TypeScript development. You can access the complete npm ecosystem directly and leverage the mature Node.js toolchain to build applications.
Python
Supports development using Python and integrates third-party libraries via pip. Offers native support for mainstream Web frameworks such as Flask, FastAPI, Django, and Sanic.
Go
Leverage the excellent concurrency capability and execution performance of Golang to build high-performance backend services, and support project dependency management through Go Modules.
Note:
Multi-Region Deployment
Cloud Functions supports deployment in multiple regions. You can choose the region for function execution and deploy functions closer to the data source, thereby reducing network latency and improving response speed.
Note:
Multi-region deployment is applicable only to Cloud Functions.
Region Selection
The region of Cloud Functions corresponds to the Acceleration Region of the project. Only one function region can be selected for each acceleration region:
Acceleration region | Configurable Function Region |
Global AZ (including Chinese mainland) | One region in the Chinese mainland and one region outside the Chinese mainland |
Chinese mainland AZ | One region in the Chinese mainland |
Global AZ (excluding Chinese mainland) | One region outside the Chinese mainland |
By default, the Chinese mainland region is
ap-guangzhou (Guangzhou), and regions outside the Chinese mainland are ap-singapore (Singapore).The support for function regions by each plan is as follows:
Package | Function Region |
Free | Uses the default region and does not support modification. |
Pro | Can be modified in selectable regions. |
Commercial |
Optional Region List
Section | Region name | Region ID |
Chinese mainland | Guangzhou | ap-guangzhou |
| Beijing | ap-beijing |
| Nanjing | ap-nanjing |
Outside the Chinese mainland - Asia Pacific | Singapore | ap-singapore |
| Hong Kong (China) | ap-hongkong |
Outside the Chinese mainland - North America | Silicon Valley | na-siliconvalley |
Outside the Chinese mainland - Europe | Frankfurt | eu-frankfurt |
Configuration Method
Configure in the console
Select the deployment region in Function Management under Project Settings in the Makers console. The change will take effect upon the next deployment.
Configure in edgeone.json
In the
edgeone.json file, specify the function deployment region through the mainlandRegions and overseasRegions fields, and configure as needed based on the acceleration region of the project.{"mainlandRegions": ["ap-beijing"],"overseasRegions": ["ap-hongkong"]}
Note:
Each field in the array can only be configured with one region.
edgeone.json: The region configuration priority in edgeone.json is higher than the console configuration.The free edition does not support modifying the function region.
Use Limits
The following are the general restrictions and runtime version info for Cloud Functions:
Content | Limitation | Note |
Code package size | Free edition 128 MB, Pro edition 250 MB | Maximum supported size of a single function code package (including dependencies). Customizable in the commercial edition. |
Request/response body size | 6 MB | The request/response body in client requests supports up to 6 MB. |
maximum execution time | The maximum allowed time from the start to the response of a single request (Maximum Duration) is 30s by default. For configuration, refer to the document. | |
Node.js version | v20.x | Default Node.js runtime version |
Python version | 3.10 | The server runtime environment is Python 3.10. We recommend using the same version for local development. |
Go version | 1.26 | Runtime environment version 1.26 (backward compatibility) |
Note:
When involved in file transfer, it is not recommended to store data that needs long-term retention. We recommend using Tencent Cloud COS to handle persistence needs.