tencent cloud

Serverless Cloud Function

Release Notes and Announcements
Release Notes
Announcements
User Guide
Product Introduction
Overview
Related Concepts
How It Works
Strengths
Scenarios
Related Products
Purchase Guide
Billing Overview
Billing Mode
Billable Items and Billing Modes
Function Computing Power Support
Free Tier
SCF Pricing
Billing Example
Payment Overdue
Getting Started
Creating Event Function in Console
User Guide
Quota Management
Managing Functions
Web Function Management
Log Management
Concurrence Management
Trigger Management
Function URL
A Custom Domain Name
Version Management
Alias Management
Permission Management
Running Instance Management
Plugin Management
Managing Monitors and Alarms
Network Configuration
Layer Management
Execution Configuration
Extended Storage Management
DNS Caching Configuration
Resource Managed Mode Management
Near-Offline Resource Hosting Model
Workflow
Triggers
Trigger Overview
Trigger Event Message Structure Summary
API Gateway Trigger
COS Trigger
CLS Trigger
Timer Trigger
CKafka Trigger
Apache Kafka Trigger
MQTT Trigger
Trigger Configuration Description
MPS Trigger
CLB Trigger Description
TencentCloud API Trigger
Development Guide
Basic Concepts
Testing a Function
Environment Variables
Dependency Installation
Using Container Image
Error Types and Retry Policies
Dead Letter Queue
Connecting SCF to Database
Automated Deployment
Cloud Function Status Code
Common Errors and Solutions
Developer Tools
Serverless Web IDE
Calling SDK Across Functions
Third-Party Tools
Code Development
Python
Node.js
Golang
PHP
Java
Custom Runtime
Deploying Image as Function
Web Framework Development
Deploying Framework on Command Line
Quickly Deploying Egg Framework
Quickly Deploying Express Framework
Quickly Deploying Flask Framework
Quickly Deploying Koa Framework
Quickly Deploying Laravel Framework
Quickly Deploying Nest.js Framework
Quickly Deploying Next.js Framework
Quickly Deploying Nuxt.js Framework
Quickly Deploying Django Framework
Use Cases
Overview
Solutions with Tencent Cloud Services
Business Development
TRTC Practices
COS Practices
CKafka Practice
CLS
CLB Practice
MPS
CDN
CDWPG
VOD
SMS
ES
Scheduled Task
Video Processing
Success Stories
Tencent Online Education
Online Video Industry
Tencent Online Education
Best Practice of Tencent IEG Going Global
API Documentation
History
Introduction
API Category
Making API Requests
Other APIs
Namespace APIs
Layer Management APIs
Async Event Management APIs
Trigger APIs
Function APIs
Function and Layer Status Description
Data Types
Error Codes
SDK Documentation
FAQs
General
Web Function
Billing FAQs
Network FAQs
Log FAQs
SCF utility class
Event Handling FAQs
API Gateway Trigger FAQs
Related Agreement
Service Level Agreement
Contact Us
Glossary
DocumentationServerless Cloud FunctionUse CasesCLB PracticeUsing SCF and CLB to Quickly Deploy Web Service

Using SCF and CLB to Quickly Deploy Web Service

PDF
Focus Mode
Font Size
Last updated: 2024-12-02 16:35:34

Overview

This document describes how to use CLB as the access entry of a serverless service and work with SCF to quickly deploy a web service. In this way, you can enjoy the strengths of Serverless services, such as low cost and OPS-free usage, and smoothly migrate your application to the cloud.

Directions

Creating VPC

Log in to the VPC console to create a VPC and subnet as instructed in Building Up an IPv4 VPC.
Note:
The VPC should be deployed in the same region as the CLB instance and SCF webpage. This document uses Shanghai as an example.

Creating CLB instance

1. Log in to the CLB console to create a CLB instance as instructed in Getting Started with CLB. This document uses Shanghai as an example. Select the VPC created in the previous step.
2. After successful creation, find the target CLB instance on the Instance Management page and configure a listener for it as instructed in Configuring an HTTP Listener. This document uses the listener clb-scf-web and listening protocol port number 81 as an example.

Creating SCF function

1. Log in to the SCF console and select Function Service on the left sidebar.
2. At the top of the Function Service page, select the Shanghai region and click Create to enter the function creating page. Set the following parameter information and click Next as shown below:
Creation Method: select Template.
Fuzzy Search: enter "Web static page hosting" and "Python3.6" and search. Click Learn More in the template to view relevant information in the Template Details pop-up window, which can be downloaded.
3. In Basic Configuration, enter the function name and select the function region.
Function Name: enter clb-scf-web for example.
Region: select the region of the CLB instance, such as Shanghai.
4. In Trigger Configuration, select Custom Creation and use the trigger to bind CLB to SCF.
Triggered Version: select Default Traffic.
Trigger Method: select CLB Trigger.
Instance ID: select the CLB instance created in the previous step, such as clb_serverless_web.
Listener: select the configured listener. In this example, the listener listens on port 81.
Domain Name/Host: select Create Rule.
Add Domain Name: enter the VIP of the CLB instance in the added domain name.
Note:
The VIP is the IP address through which CLB provides service to clients.
URL Path: enter the URL path of the website starting with /, such as /demo.
5. Click Complete to redirect to the Deployment Log page and view the function and trigger creation progress.

Testing CLB entry

1. Log in to the SCF console and select Function Service on the left sidebar.
2. At the top of the Function Service page, click the created function clb-scf-web.
3. On the function details page, select Trigger Management.
4. On the Trigger Management page, get the trigger access path and view the webpage.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback