1 Star 0 Fork 0

bgoonz / serverless-stack-resources-sample

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Serverless Stack Resources SST Sample

This project uses SST to create the resources in the Serverless Stack guide.

It uses CDK instead of CloudFormation YAML in our note taking app — https://github.com/AnomalyInnovations/serverless-stack-demo-api

For example, this what creating the DynamoDB table looks like in the two versions.

- Resources:
-   NotesTable:
-     Type: AWS::DynamoDB::Table
-     Properties:
-       TableName: ${self:custom.tableName}
-       AttributeDefinitions:
-         - AttributeName: userId
-           AttributeType: S
-         - AttributeName: noteId
-           AttributeType: S
-       KeySchema:
-         - AttributeName: userId
-           KeyType: HASH
-         - AttributeName: noteId
-           KeyType: RANGE
-       # Set the capacity to auto-scale
-       BillingMode: PAY_PER_REQUEST

+ const table = new dynamodb.Table(this, "notes", {
+   partitionKey: { name: 'userId', type: dynamodb.AttributeType.STRING },
+   sortKey: { name: 'noteId', type: dynamodb.AttributeType.STRING },
+   billingMode: dynamodb.BillingMode.PAY_PER_REQUEST,
+ });

Usage

Start by forking or cloning this repo.

Then install the dependencies.

$ npm install

Commands

npm run build

Build your app and synthesize your stacks.

Generates a build/ directory with the compiled files and a build/cdk.out/ directory with the synthesized CloudFormation stacks.

npm run deploy [stack]

Deploy all your stacks to AWS. Or optionally deploy, a specific stack.

npm run remove [stack]

Remove all your stacks and all of their resources from AWS. Or optionally removes, a specific stack.

npm test

Runs your tests using Jest. Takes all the Jest CLI options.

Documentation

Learn more about the Serverless Stack Toolkit.

Community

Follow us on Twitter, join our chatroom, or post on our forums.

空文件

简介

A sample SST app deploying the notes app resources from the Serverless Stack guide. 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/bgoonz/serverless-stack-resources-sample.git
git@gitee.com:bgoonz/serverless-stack-resources-sample.git
bgoonz
serverless-stack-resources-sample
serverless-stack-resources-sample
master

搜索帮助