amazon-dynamodbserverless-frameworkaws-serverlessserverless-plugins

serverless dynamodb enable continuous backups


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


Solution

  • 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