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

WIP: Use aws-cdk to deploy an AWS Lambda based server-less version of the app #5

Merged
merged 57 commits into from
Jan 2, 2019

Conversation

floehopper
Copy link
Member

@floehopper floehopper commented Dec 15, 2018

I've made the repo private in order to publish this PR on the off-chance we decide it's worth trying to offer the functionality as a paid service.

I've created a milestone with a bunch of issues we might want to tackle before switching over to using the new version.

And run `npm install` to generate `package-lock.json`.
This is where I'll add custom code to define the AWS resources which
make up the stack.
This rule currently has no target and so won't do anything, but it's a
small step on the way.
Note that Ruby lambda functions cannot currently be "inline"; they have
to be in a separate file.
Note that unfortunately the trello gem currently (rather unnecessarily)
has an indirect dependency on the unf gem which has native extensions.
When I was trying this previously, I thought I ran into problems because
the extensions were being built on my local machine using Mac OSX
(x86_64-darwin-17), but were being deployed and run in an AWS Lambda
function which is an x86_64-linux platform. Previously I had used Docker
to build the extensions for the correct platform, however, when I just
tried deploying and running the function as it stands (with Mac
OSX-build extensions), it seemed to work OK, so maybe the whole Docker
thing was unnecessary!
I've chosen to use the board ID rather than a normalized version of the
board name for the S3 object key, because this is a lot less likely to
change over time.

There's no need to include a timestamp in the S3 object key, because the
S3 bucket has versioning enabled.
This means all the env vars are obtained at the same level.
To minimize the size of the zip file uploaded to AWS.
And reduce the size of the zip file uploaded to AWS.
And reduce the size of the zip file uploaded to AWS.
I noticed this was missing when I was comparing this project with the
`trello-full-backup` Python package [1].

[1]: https://pypi.org/project/trello-full-backup/
Move key & token to beginning of list and order the remaining keys
alphabetically.
This should hopefully speed up the API response time.
I'm planning to use this topic for monitoring as well as alarms.
No need to include "Trello" in constant name.
No need to repeat "Trello" in constant/function name.
No need to repeat "Trello" in constant/function name.
No need to repeat "Trello" in constant/function name.
TRELLO_BOARD_BACKUPS -> TRELLO_BACKUP.
BACKUP_TRELLO_BOARD_TOPIC_ARN -> TRELLO_BACKUP_BACKUP_BOARD_TOPIC_ARN.

This makes the code more consistent.
I want to introduce another schedule expression and this change which
makes the name more specific will make that easier.
Again this will make it easier to add another schedule expression rule.
Sends an email indicating whether the backup of all boards was
successful or not.
@floehopper
Copy link
Member Author

I'm going to leave this running for a day or two, but, now that I've addressed all the issues in https://github.com/freerange/trello_backup/milestone/1, I then plan to merge this into master.

@floehopper
Copy link
Member Author

This seems to have been running without problems for a few days. I've just downloaded all the JSON backup files and (although I haven't looked at them in detail) they look OK to me. So I'm going to merge this PR.

@floehopper floehopper merged commit 5820d95 into master Jan 2, 2019
@floehopper floehopper deleted the aws-ify branch January 2, 2019 11:40
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.

1 participant