How to Quickly Migrate Traditional Load Balancer Public Services to Serverless
By creating a Cloud Function, provisioning a public Classic Load Balancer, configuring a layer‑7 listener, and binding the function to the CLB, developers can quickly expose serverless services through a low‑cost, zero‑maintenance entry point, enabling fast migration of traditional public load‑balanced applications to the cloud.
The article introduces the advantages, applicable scenarios, and configuration guidance for integrating a Classic Load Balancer (CLB) trigger with Serverless functions.
It demonstrates how to use CLB as the access entry for Serverless services, leveraging low cost and zero‑operation‑maintenance benefits to help developers smoothly migrate applications to the cloud.
1. Create a Cloud Function (SCF)
• Open the Cloud Function console and click “New”. • Choose a custom template, set the runtime to Python 3.6, and select “Upload local folder”. • Download the demo package from https://scfdemo-1253970226.cos.ap-chengdu.myqcloud.com/21_3_17_daxigua.zip , unzip it, and upload the entire folder as the function code. • Set the entry point to index.main_handler .
2. Create a CLB resource
• In the CLB console, click “New” to create a load balancer. • Bind the CLB instance to the SCF function. Currently, SCF supports binding to CLB instances of network type “Public” or “Private Network” within the same region. Listeners must be layer‑7; layer‑4 listeners are not supported.
3. Create a listener
Configure a layer‑7 listener for the CLB and associate it with the SCF instance.
4. Bind SCF to the CLB
Bind the SCF instance to the CLB either from the CLB console or the SCF console.
5. Test the setup
Access the CLB monitor path (e.g., http://129.226.10.72:81/daxigua ) to verify that the Serverless application is reachable.
Summary
Using a CLB listener to expose Serverless applications provides a fast way to expand access scenarios and offers high‑availability service for developers.
Usage notes
CLB triggers are officially released and can be used directly in the console.
CLB accounts come in Standard and Traditional types; Traditional accounts do not support binding to SCF. Upgrade to a Standard account if needed.
For more details, refer to the account upgrade guide ( https://cloud.tencent.com/document/product/1199/49090 ) and the product pages for SCF ( https://cloud.tencent.com/product/scf?from=15939 ) and EventBridge ( https://cloud.tencent.com/product/eb?from=15940 ).
Tencent Cloud Developer
Official Tencent Cloud community account that brings together developers, shares practical tech insights, and fosters an influential tech exchange community.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.