Skip to content

Latest commit

 

History

History
89 lines (60 loc) · 1.67 KB

README.en.md

File metadata and controls

89 lines (60 loc) · 1.67 KB

Tencent CDN Component

简体中文 | English

Easily provision Tencent CDN using Serverless Components.

Quick start

  1. Install
  2. Create
  3. Configure
  4. Deploy
  5. Remove

1. Install

Install the Serverless Framework:

$ npm install -g serverless

2. Create

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。

3. Configure

# 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

4. Deploy

$ sls deploy

 

5. Remove

$ sls remove

New to Components?

Checkout the Serverless Components repo for more information.

License

MIT License

Copyright (c) 2020 Tencent Cloud, Inc.