导入
准备数据库
学习如何为食材创建数据库。
...
数据库模式
No configuration found for ID: b23d375a44aaa2c2770f3bfd7ee1947029d3b0d58358df21faed1aa186b46fd8
1resources: 2 Resources: 3 InventoryTable: 4 Type: AWS::DynamoDB::Table 5 Properties: 6 TableName: ${self:service}-inventory-${self:provider.stage} 7 AttributeDefinitions: 8 - AttributeName: ingredient 9 AttributeType: S 10 KeySchema: 11 - AttributeName: ingredient 12 KeyType: HASH 13 ProvisionedThroughput: 14 ReadCapacityUnits: 1 15 WriteCapacityUnits: 1
1service: sweet-factory 2frameworkVersion: "3" 3 4provider: 5 name: aws 6 runtime: nodejs18.x 7 stage: dev 8 region: us-east-1 9 10functions: 11 hello: 12 handler: handlers/handler.hello 13 14plugins: 15 - serverless-esbuild 16 - serverless-step-functions 17 18stepFunctions: 19 stateMachines: 20 helloStateMachine: 21 name: MyHelloStateMachine 22 definition: 23 StartAt: HelloWorld 24 States: 25 HelloWorld: 26 Type: Task 27 Resource: 28 Fn::GetAtt: [hello, Arn] 29 End: true 30resources: 31 Resources: 32 InventoryTable: 33 Type: AWS::DynamoDB::Table 34 Properties: 35 TableName: ${self:service}-inventory-${self:provider.stage} 36 AttributeDefinitions: 37 - AttributeName: ingredient 38 AttributeType: S 39 KeySchema: 40 - AttributeName: ingredient 41 KeyType: HASH 42 ProvisionedThroughput: 43 ReadCapacityUnits: 1 44 WriteCapacityUnits: 1
1sls deploy
...
通过 Serverless Framework 创建的 DynamoDB 表