2

使用无服务器框架时,如何为我的 DynamoDB 表启用连续备份?

理想情况下,我会定义一些serverless.yml可以启用自动 DynamoDB 备份的东西

4

1 回答 1

5

它在几个文档中有点隐藏,但这可以通过在 serverless.yml 文件PointInTimeRecoverySpecificationresources部分中定义来完成,例如

resources:
  Resources:
    developers:
      Type: AWS::DynamoDB::Table
      Properties:
        TableName: myTable
        AttributeDefinitions:
          - AttributeName: myId
            AttributeType: S
        KeySchema:
          - AttributeName: myId
            KeyType: HASH
        ProvisionedThroughput:
          ReadCapacityUnits: 1
          WriteCapacityUnits: 1
        PointInTimeRecoverySpecification:
          PointInTimeRecoveryEnabled: true
于 2019-04-03T16:26:00.203 回答