serverless dynamodb enable continuous backups

821 Views Asked by At

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

1

There are 1 best solutions below

0
On BEST ANSWER

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