{"id":18248180,"url":"https://github.com/serverless-components/tencent-cynosdb","last_synced_at":"2025-04-04T15:32:15.176Z","repository":{"id":46371762,"uuid":"299288822","full_name":"serverless-components/tencent-cynosdb","owner":"serverless-components","description":"Tencent Cloud CynosDB component.","archived":false,"fork":false,"pushed_at":"2021-10-22T13:49:32.000Z","size":40,"stargazers_count":5,"open_issues_count":0,"forks_count":4,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-20T14:56:10.720Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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-09-28T11:37:15.000Z","updated_at":"2023-05-01T10:33:19.000Z","dependencies_parsed_at":"2022-08-31T08:51:44.095Z","dependency_job_id":null,"html_url":"https://github.com/serverless-components/tencent-cynosdb","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-components%2Ftencent-cynosdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-components%2Ftencent-cynosdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-components%2Ftencent-cynosdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-components%2Ftencent-cynosdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serverless-components","download_url":"https://codeload.github.com/serverless-components/tencent-cynosdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247203032,"owners_count":20900899,"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:10.340Z","updated_at":"2025-04-04T15:32:10.167Z","avatar_url":"https://github.com/serverless-components.png","language":"JavaScript","readme":"# 腾讯云 CynosDB 组件\n\n## 简介\n\n腾讯云 CynosDB 组件通过使用 [Serverless Framework](https://github.com/serverless/components)，基于云上 Serverless 服务，可以快速方便的创建，部署和管理腾讯云的 Cynosdb 产品。\n\n## 快速开始\n\n1. [安装](#1-安装)\n2. [创建](#2-创建)\n3. [配置](#3-配置)\n4. [部署](#4-部署)  \n   4.1 [开启外网访问](#4.1-开启外网访问)  \n   4.2 [重置密码](#4.2-重置密码)\n5. [查看状态](#5-查看状态)\n6. [移除](#6-移除)\n\n### 1. 安装\n\n通过 npm 全局安装 最新版本的 Serverless Framework\n\n```bash\n$ npm install -g serverless\n```\n\n### 2. 创建\n\n创建并进入一个全新目录：\n\n```bash\n$ mkdir tencent-cynosdb \u0026\u0026 cd tencent-cynosdb\n```\n\n### 3. 配置\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: cynosdb\nname: cynosdbDemo\n\ninputs:\n  region: ap-guangzhou\n  zone: ap-guangzhou-4\n  vpcConfig:\n    vpcId: vpc-xxx\n    subnetId: subnet-xxx\n```\n\n- [更多配置](https://github.com/serverless-components/tencent-cynosdb/tree/master/docs/configure.md)\n\n\u003e 注：当前仅支持 `北京三区，广州四区，上海二区，南京一区` 四个地域的创建和部署，因此在填写 yaml 中的地域可用区时需要注意填写为正确的地域和对应的 VPC 子网信息。\n\n### 4. 部署\n\n如您的账号未 [登录](https://cloud.tencent.com/login) 或 [注册](https://cloud.tencent.com/register) 腾讯云，您可以直接通过`微信`扫描命令行中的二维码进行授权登陆和注册。\n\n通过`sls`命令进行部署，并可以添加`--debug`参数查看部署过程中的信息\n\n\u003e 注：`sls`命令是`serverless`命令的缩写\n\n```bash\n$ sls deploy\n```\n\n#### 4.1 开启外网访问\n\n如果需要 serverless cynosdb 实例开启外网访问，只需添加 `enablePublicAccess` 配置为 `true`，如下：\n\n```yml\n# serverless.yml\norg: orgDemo\napp: appDemo\nstage: dev\ncomponent: cynosdb\nname: cynosdbDemo\n\ninputs:\n  region: ap-guangzhou\n  zone: ap-guangzhou-4\n  enablePublicAccess: true\n  vpcConfig:\n    vpcId: vpc-xxx\n    subnetId: subnet-xxx\n```\n\n然后重新执行部署：\n\n```bash\n$ sls deploy\n```\n\n\u003e **说明**：如果鉴权失败，请参考 [权限配置](https://cloud.tencent.com/document/product/1154/43006) 进行授权。\n\n部署成功后控制台输出参数介绍请参考 [output 文档](https://github.com/serverless-components/tencent-cynosdb/blob/master/docs/output.md)\n\n#### 4.2 重置密码\n\n组件只支持重置 `root` 用户密码，比如需要将密码重置为 `123456@abc` 只需运行如下命令:\n\n```bash\n$ sls resetpwd --inputs adminPassword=123456@abc\n```\n\n### 5. 查看状态\n\n在`serverless.yml`文件所在的目录下，通过如下命令查看部署状态：\n\n```bash\n$ sls info\n```\n\n### 6. 移除\n\n通过以下命令移除部署的 DB 实例，移除后该组件会对应删除云上部署时所创建的所有相关资源。\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```\n# .env\nTENCENT_SECRET_ID=123\nTENCENT_SECRET_KEY=123\n```\n\n### 更多组件\n\n可以在 [Serverless Components](https://github.com/serverless/components) repo 中查询更多组件的信息。\n\n## License\n\nMIT License\n\nCopyright (c) 2020 Tencent Cloud, Inc.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserverless-components%2Ftencent-cynosdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserverless-components%2Ftencent-cynosdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserverless-components%2Ftencent-cynosdb/lists"}