This modules creates a Lambda function to create on-demand DynamoDB backups. It also creates a CloudWatch scheduled event to trigger the Lambda function daily. The Lambda also makes sure to delete old backups.
npm install -g serverlessnpm installCopy the file env-example.yml to env.yml and edit its content.
Set up your AWS Credentials. Follow these instructions. Easiest is to use AWS profiles. You can create a profile with the command:
$ aws configure --profile newAccountand then use it by exporting:
export AWS_PROFILE=newAccountor prefixing every serverless command with
AWS_PROFILE=newAccount serverless ...The IAM identity used to deploy requires several permissions. Start by creating an IAM policy based on the content of this file. You will need to replace with the name of the AWS region and with your actual AWS account number.
Once you have added that policy, attach it to your user account (or to a group your user is part of).
serverless deploy -vserverless deploy function -f backupDynamoDBTablesserverless remove -v