Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added serverless service config #103

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wzedi
Copy link

@wzedi wzedi commented Feb 1, 2018

Deploys Lambda function and S3 backup bucket.

To use the serverless config:

  1. Install the [serverless framework] (https://serverless.com/framework/docs/providers/aws/guide/installation/) - npm i -g serverless
  2. Update serverless.yml with your S3 Bucket Name and DynamoDB Stream ARN
  3. Update npm packages - npm install
  4. Deploy - serverless deploy

To remove serverless deployment:

  1. Empty the S3 bucket
  2. Remove - serverless remove

@rclark
Copy link
Contributor

rclark commented Feb 2, 2018

Hi @wzedi -- thanks for this effort!

Have you investigated the newly announced DynamoDB Global tables? We have started exploring it and it seems like it can manage most of the problems that this library exists to address. Moving forward, we're considering whether we want to deprecate this library in favor of taking advantage of that system.

I'd be curious to hear your thoughts and whether global tables sounds like it will satisfy your use cases.

@wzedi
Copy link
Author

wzedi commented Feb 11, 2018

Hi @rclark, we're using this library specifically as a backup for DynamoDB tables (streams -> versioned S3). We're in Asia Pacific (Sydney) that doesn't currently have On-demand backup and Restore. In this particular case global tables doesn't fit.

@hassankhan
Copy link

@rclark Any updates on the PR itself? We still use this project due to similar concerns as @wzedi.

Copy link

@hassankhan hassankhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few nitpicks 😉

provider:
name: aws
runtime: nodejs6.10
region: ap-southeast-2

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be better not to specify region or to use a command line option instead


provider:
name: aws
runtime: nodejs6.10

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can update this to Node 8 now 😄

events:
- stream: <YOUR DYNAMODB STREAM ARN>

environment:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to move this to the global section so that we can reference them in other parts of the serverless.yml

- Effect: "Allow"
Action:
- "s3:ListBucket"
Resource: "<YOUR BACKUP BUCKET NAME>"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the environment variables were global (instead of per-function), we could retrieve this without users having to replace them manually

- "s3:GetObject"
- "s3:PutObject"
- "s3:DeleteObject"
Resource: "arn:aws:s3:::<YOUR BACKUP BUCKET NAME>/*"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

- stream: <YOUR DYNAMODB STREAM ARN>

environment:
BackupRegion: <YOUR REGION>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These could be retrieved as environment variables: ${env:REGION}


environment:
BackupRegion: <YOUR REGION>
BackupBucket: <YOUR BACKUP BUCKET NAME>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

environment:
BackupRegion: <YOUR REGION>
BackupBucket: <YOUR BACKUP BUCKET NAME>
BackupPrefix: <YOUR PREFIX>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants