使用无服务器框架时,如何为我的 DynamoDB 表启用连续备份?
理想情况下,我会定义一些serverless.yml
可以启用自动 DynamoDB 备份的东西
使用无服务器框架时,如何为我的 DynamoDB 表启用连续备份?
理想情况下,我会定义一些serverless.yml
可以启用自动 DynamoDB 备份的东西
它在几个文档中有点隐藏,但这可以通过在 serverless.yml 文件PointInTimeRecoverySpecification
的resources
部分中定义来完成,例如
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