2

How do I enable continuous backups for my DynamoDB table when using the Serverless Framework?

Ideally, I would define something in serverless.yml that would enable automatic DynamoDB backups

redgeoff
  • 2,675
  • 1
  • 20
  • 38

1 Answers1

3

It's a little hidden in a couple docs, but this can be done by defining PointInTimeRecoverySpecification in the resources section of you serverless.yml file, e.g.

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
redgeoff
  • 2,675
  • 1
  • 20
  • 38