-
Notifications
You must be signed in to change notification settings - Fork 48
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
base: master
Are you sure you want to change the base?
Conversation
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. |
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. |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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>" |
There was a problem hiding this comment.
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>/*" |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
Deploys Lambda function and S3 backup bucket.
To use the serverless config:
npm i -g serverless
npm install
serverless deploy
To remove serverless deployment:
serverless remove