All Projects → serverless-components → tencent-scf

serverless-components / tencent-scf

Licence: MIT license
Deploy Tencent Cloud Serverless Cloud Function in seconds with Serverless Components.

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to tencent-scf

serverless-tencent-scf
Add support for Tencent Cloud's serverless infrastructure to the Serverless Framework via this plugin
Stars: ✭ 53 (-38.37%)
Mutual labels:  serverless-framework, tencent, cloud-function, tencent-cloud
tencent-tensorflow-scf
A template project for serverless functions for Tensorflow inference on Tencent Cloud.
Stars: ✭ 38 (-55.81%)
Mutual labels:  serverless-framework, tencent, tencent-cloud
tencent-apigateway
Easily provision Tencent API Gateway using Serverless Components
Stars: ✭ 33 (-61.63%)
Mutual labels:  serverless-framework, tencent, tencent-cloud
tencent-cam-policy
Easily create an Tencent CAM Policy with Serverless Components
Stars: ✭ 20 (-76.74%)
Mutual labels:  serverless-framework, tencent, tencent-cloud
tencent-cam-role
Easily provision Tencent CAM roles using Serverless Components
Stars: ✭ 19 (-77.91%)
Mutual labels:  serverless-framework, tencent, tencent-cloud
Tencent Express
Easily deploy serverless Express.js applications to Tencent Cloud with the Serverless Framework
Stars: ✭ 96 (+11.63%)
Mutual labels:  serverless-framework, tencent
flutter superplayer
适用于 Flutter 的腾讯云超级播放器插件
Stars: ✭ 13 (-84.88%)
Mutual labels:  tencent, tencent-cloud
JD tencent scf
自用脚本,随缘更新
Stars: ✭ 440 (+411.63%)
Mutual labels:  tencent
serverless-api-gateway-throttling
A plugin for the Serverless framework which configures throttling for API Gateway endpoints.
Stars: ✭ 54 (-37.21%)
Mutual labels:  serverless-framework
aws-serverless-swift-api-template
A Serverless REST API template, implemented in Swift with swift-aws-lambda-runtime.
Stars: ✭ 42 (-51.16%)
Mutual labels:  serverless-framework
laravel-filesystem-cos
Tencent Cloud COS storage for Laravel based on overtrue/flysystem-cos.
Stars: ✭ 56 (-34.88%)
Mutual labels:  tencent-cloud
serverless-vscode
Serverless framework integration for VSCode
Stars: ✭ 26 (-69.77%)
Mutual labels:  serverless-framework
serverless-cloud-vision
Serverless API around Google Cloud Vision
Stars: ✭ 31 (-63.95%)
Mutual labels:  serverless-framework
express-sls-app
How to deploy a Node.js application to AWS Lambda using Serverless, a quick start.
Stars: ✭ 20 (-76.74%)
Mutual labels:  serverless-framework
docker-serverless
Docker image containing NodeJS, Serverless Framework and Yarn.
Stars: ✭ 74 (-13.95%)
Mutual labels:  serverless-framework
APIJSON-Demo
腾讯 APIJSON 各种语言、各种框架 的 使用示例项目、上手文档、测试数据 SQL 文件 等。Demo projects with document and SQL files for Tencent APIJSON with different programming languages and different frameworks.
Stars: ✭ 230 (+167.44%)
Mutual labels:  tencent
serverless-chat
A chat app with a serverless backend and Django front-end.
Stars: ✭ 34 (-60.47%)
Mutual labels:  serverless-framework
serverless-cloudformation-sub-variables
Serverless framework plugin for easily supporting AWS CloudFormation Sub intrinsic function variables
Stars: ✭ 25 (-70.93%)
Mutual labels:  serverless-framework
serverless-aws-static-file-handler
Easily serve static files with the Serverless Framework on AWS Lambda.
Stars: ✭ 43 (-50%)
Mutual labels:  serverless-framework
serverless-package-external
Add external folders to the deploy package 📦
Stars: ✭ 53 (-38.37%)
Mutual labels:  serverless-framework

Serverless Components


组件概述

腾讯云 SCF 云函数组件通过使用 Tencent Serverless Framework,基于云上 Serverless 服务(云函数及触发器等),实现“0”配置,便捷开发,极速部署您的第一个云函数,该组件支持丰富的配置扩展,提供了目前最易用、低成本并且弹性伸缩的云函数的开发、配置及部署能力。

快速入门

前提条件

操作步骤

创建

  • 方式一:按照 快速部署 操作,选择 SCF 项目模板进行创建。
  • 方式二:直接使用 serverless init 命令创建。快速创建一个 nodejs 的 SCF 示例:
$ serverless init scf-starter --name example
$ cd example

说明:命令中的 scf-starter 可以更换成其他语言模板。目前 SCF 组件支持的模板有:scf-golangscf-nodejsscf-phpscf-python

部署

serverless.yml 文件所在的项目根目录,运行以下指令,将会弹出二维码,直接扫码授权进行部署:

serverless deploy

可以通过添加 inputs 参数设置预置并发,例如:为版本 1 设置 4 个预置并发(如果不指定版本会新发布一个版本,并为新版本设置并发)

serverless deploy --inputs provisionedNum=4 qualifier=1

说明:如果鉴权失败,请参考 权限配置 进行授权。

查看

执行以下命令,查看您部署的项目信息:

serverless info

移除

执行以下命令,移除您已经部署的项目:

serverless remove

进阶指导

serverless.yml

执行 serverless deploy 时,根据 serverless.yml 文件中的配置对云函数资源进行创建或更新。一份简单的 serverlesss.yml 文件如下:

说明:配置详情请参考 全量配置文档

component: scf # (必填) 引用 component 的名称,当前用到的是 tencent-scf 组件
name: scfdemo # (必填) 创建的实例名称,请修改成您的实例名称

#组件参数
inputs:
  name: ${name}-${stage}-${app} #函数名称
  src: ./  #代码路径
  type: 'web' # 部署Web函数时需指定该值
  handler: index.main_handler #入口(部署非Web函数时生效)
  runtime: Nodejs10.15 # 云函数运行时的环境
  region: ap-guangzhou # 云函数所在区域
  events: # 触发器
    - apigw: # 网关触发器
        parameters:
          endpoints:
            - path: /
              method: GET

serverless.yml 文件包含的信息:

组件信息

组件名 是否必选 说明
component 必填 component 的名称,使用serverless registry查询您可以引入的组件。
name 必填 创建的实例名称,每个组件在部署时将创建一个实例。

参数信息

inputs 下的参数为组件配置参数。一个最简单 SCF 组件参数配置由以下几部分:

参数名 说明
name 云函数名称。由于云函数又是资源 ID,为了保证资源的唯一性,建议采用 ${name}-${stage}-${app} 变量方式。
src 代码路径。
type 函数类型,默认为事件函数。支持的类型为:event(事件函数),web(Web 函数)。
handler 函数处理方法名称 。
entryFile 函数入口文件名。(函数类型为 web 且无 scf_bootstrap 文件时生效)
runtime 云函数运行环境,目前支持: Python2.7、Python3.6、Nodejs6.10、Nodejs8.9、Nodejs10.15、Nodejs12.16、PHP5、PHP7、Go1、Java8 和 CustomRuntime。
region 云函数所在的区域。
events 触发器。 支持的触发器为:timer、apigw、cos、cmq、ckafka 。

账号权限

部署实例时需要账号授权去操作具体的云资源,目前可以通过两种方式进行授权:扫码授权密钥授权

  • 扫码授权:能快速进行授权部署,但生成的凭证是临时凭证,过期后需要重新扫码。
  • 密钥授权:能够获得永久授权,需要预先配置账号的 SecretId 和 SecretKey 。

配置详情可参考 权限配置

开发调试

serverless.yml文件所在的目录下运行 serverless dev 可以实时输出云端日志,每次部署完毕后,对项目进行访问,即可在命令行中实时输出调用日志,便于查看业务情况和排障。nodejs 支持开启开发调试能力,将会对本地代码的改动进行检测和自动上传。详情请参考 开发与调试

应用管理

Serverless 部署一个组件实例实质是部署了一个单组件实例的应用。

在应用项目开发过程中,一个应用下可能会存在多个组件实例,如何管理组件实例进行应用项目开发,请参考 应用管理

其他命令

其他命令

License

MIT License

Copyright (c) 2020 Tencent Cloud, Inc.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].