{"id":18248164,"url":"https://github.com/serverless-components/tencent-mongodb","last_synced_at":"2025-04-08T19:51:12.129Z","repository":{"id":46371778,"uuid":"259522896","full_name":"serverless-components/tencent-mongodb","owner":"serverless-components","description":"腾讯云 Nosql DB Serverless Component","archived":false,"fork":false,"pushed_at":"2021-10-22T13:49:59.000Z","size":211,"stargazers_count":3,"open_issues_count":3,"forks_count":1,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-02-14T15:36:28.255Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serverless-components.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-28T03:37:12.000Z","updated_at":"2021-10-22T13:50:02.000Z","dependencies_parsed_at":"2022-09-22T23:21:34.419Z","dependency_job_id":null,"html_url":"https://github.com/serverless-components/tencent-mongodb","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-components%2Ftencent-mongodb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-components%2Ftencent-mongodb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-components%2Ftencent-mongodb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-components%2Ftencent-mongodb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serverless-components","download_url":"https://codeload.github.com/serverless-components/tencent-mongodb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247918687,"owners_count":21018041,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T09:36:06.949Z","updated_at":"2025-04-08T19:51:12.110Z","avatar_url":"https://github.com/serverless-components.png","language":"JavaScript","readme":"# 腾讯云 Nosql DB Serverless Component\n\n## 简介\n\n**腾讯云 Nosql DB 组件** - 通过使用[**Tencent Serverless Framework**](https://github.com/serverless/components/tree/cloud) , 基于云上 Serverless 服务, 快速创建并部署一个云开发环境，从而使用云上 Nosql DB 产品，实现“0”配置，便捷开发，极速部署，助力全栈应用项目的开发/托管。\n\n特性介绍：\n\n- [x] **按需付费** - 按照请求的使用量进行收费，没有请求时无需付费\n- [x] **\"0\"配置** - 只需要关心项目代码，之后部署即可，Serverless Framework 会搞定所有配置。\n- [x] **极速部署** - 部署速度快，仅需几秒，部署你的整个应用。\n- [x] **实时日志** - 通过实时日志的输出查看业务状态，便于直接在云端开发应用。\n- [x] **云端调试** - 可在云端直接进行项目调试，从而避免本地环境的差异。\n- [x] **便捷协作** - 通过云端控制台的状态信息和部署日志，方便进行多人协作开发。\n\n## 快速开始\n\n1. [**安装**](#1-安装)\n2. [**配置**](#2-配置)\n3. [**部署**](#3-部署)\n4. [**开发调试**](#4-开发调试)\n5. [**查看状态**](#5-查看部署状态)\n6. [**移除**](#6-移除)\n\n更多资源：\n\n- [**账号配置**](#账号配置)\n- [**更多组件**](#更多组件)\n\n### 1. 安装\n\n通过 npm 全局安装 [serverless cli](https://github.com/serverless/serverless)\n\n```bash\n$ npm install -g serverless\n```\n\n如果之前您已经安装过 Serverless Framework，可以通过下列命令升级到最新版：\n\n```bash\n$ npm update -g serverless\n```\n\n安装完毕后，通过运行`serverless -v`命令，查看 Serverless Framework 的版本信息，确保版本信息不低于以下版本：\n\n```bash\n$ serverless –v\nFramework Core: 1.68.0\nPlugin: 3.6.6\nSDK: 2.3.0\nComponents: 2.30.1\n```\n\n### 2. 配置\n\n\u003e 注意：name 字段必须 `以小写字母开头，只支持数字、小写字母 和 -`\n\n在项目根目录创建 `serverless.yml` 文件，在其中进行如下配置\n\n```bash\n$ touch serverless.yml\n```\n\n```yml\n# serverless.yml\norg: orgDemo\napp: appDemo\nstage: dev\ncomponent: mongodb\nname: mongodbDemo\n\ninputs:\n  name: my-demo\n```\n\n### 3. 部署\n\n在 serverless.yml 文件所在的项目根目录下，运行以下指令进行部署：\n\n```bash\n$ sls deploy\n\nserverless ⚡ framework\n\nmongodbDemo:\n  Region:    ap-guangzhou\n  Name:      my-demo\n  EnvID:     my-demo-dyxfxv\n  FreeQuota: basic\n\n20s › mongodbDemo › Success\n```\n\n部署时需要进行身份验证，如您的账号未 [登陆](https://cloud.tencent.com/login) 或 [注册](https://cloud.tencent.com/register) 腾讯云，您可以直接通过 `微信` 扫描命令行中的二维码进行授权登陆和注册。\n\n\u003e 如果希望查看更多部署过程的信息，可以通过 `sls deploy --debug` 命令查看部署过程中的实时日志信息，`sls`是 `serverless` 命令的缩写。\n\n### 注意！！！\n\n1. 由于 sls 运行角色限制，需要用户登录 [访问管理角色页面](https://console.cloud.tencent.com/cam/role)，手动为 **SLS_QcsRole** 添加 **TCBFullAccess** 的策略，否则无法正常运行。\n2. 目前 TCB 端仅支持每月最多创建销毁 `4` 次环境，请谨慎创建，若超过 `4` 次部署将会报错。\n\n### 5. 查看部署状态\n\n在`serverless.yml`文件所在的目录下，通过如下命令查看部署状态：\n\n```\n$ sls info\n```\n\n### 6. 移除\n\n在`serverless.yml`文件所在的目录下，通过以下命令移除部署=项目，移除后该组件会对应删除云上部署时所创建的所有相关资源。\n\n```bash\n$ sls remove\n```\n\n和部署类似，支持通过 `sls remove --debug` 命令查看移除过程中的实时日志信息，`sls`是 `serverless` 命令的缩写。\n\n### 账号配置\n\n当前默认支持 CLI 扫描二维码登录，如您希望配置持久的环境变量/秘钥信息，也可以本地创建 `.env` 文件\n\n```bash\n$ touch .env # 腾讯云的配置信息\n```\n\n在 `.env` 文件中配置腾讯云的 SecretId 和 SecretKey 信息并保存\n\n如果没有腾讯云账号，可以在此 [注册新账号](https://cloud.tencent.com/register)。\n\n如果已有腾讯云账号，可以在 [API 密钥管理](https://console.cloud.tencent.com/cam/capi) 中获取 `SecretId` 和`SecretKey`.\n\n```text\n# .env\nTENCENT_SECRET_ID=123\nTENCENT_SECRET_KEY=123\n```\n\n\u003e 注意：海外 ip 登录时，需要在`.env`文件中添加`SERVERLESS_PLATFORM_VENDOR=tencent` ，使 sls 默认使用 tencent 组件\n\n### 更多组件\n\n可以在 [Serverless Components](https://github.com/serverless/components) repo 中查询更多组件的信息。\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserverless-components%2Ftencent-mongodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserverless-components%2Ftencent-mongodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserverless-components%2Ftencent-mongodb/lists"}