@serverless/tencent-postgresql

Tencent Cloud PostgresSQL Component

Usage no npm install needed!

<script type="module">
  import serverlessTencentPostgresql from 'https://cdn.skypack.dev/@serverless/tencent-postgresql';
</script>

README

Tencent Cloud PostgreSQL Component

简体中文 | English

Introduction

Using PostgreSQL Component, you can create/update/delete PostgreSQL Instance for Serverless Application conveniently.

Content

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

1. Install

Install the Serverless Framework globally:

$ npm install -g serverless

2. Create

In project root, 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.

3. Configure

# serverless.yml
MyPostgreSQL:
  component: '@serverless/tencent-postgresql'
  inputs:
    region: ap-guangzhou
    zone: ap-guangzhou-3
    dBInstanceName: serverlessDb
    dBVersion: 10.4
    dBCharset: UTF8
    vpcConfig:
      vpcId: 123
      subnetId: 123
    extranetAccess: false

4. Deploy

$ sls --debug

Notice: sls is short for serverless command.

 

5. Remove

$ sls remove --debug

More Components

Checkout the Serverless Components repo for more information.