简体中文 | English
Easily provision Tencent CDN using Serverless Components.
Install the Serverless Framework:
$ npm install -g serverless
Just create the following simple boilerplate:
$ touch serverless.yml
$ touch .env # your Tencent api keys
Add the access keys of a Tencent CAM Role with AdministratorAccess
in the .env
file, using this format:
# .env
TENCENT_SECRET_ID=XXX
TENCENT_SECRET_KEY=XXX
- If you don't have a Tencent Cloud account, you could sign up first.
Also should goto CDN Service Page, and open CDN service。
# serverless.yml
component: cdn
name: cdnDemo
org: orgDemo
app: appDemo
stage: dev
inputs:
area: overseas
domain: abc.com
origin:
origins:
- xxx.cos-website.ap-guangzhou.myqcloud.com
originType: cos
originPullProtocol: http
$ sls deploy
$ sls remove
Checkout the Serverless Components repo for more information.
MIT License
Copyright (c) 2020 Tencent Cloud, Inc.