{"id":19338076,"url":"https://github.com/freerange/trello-backup","last_synced_at":"2026-05-07T19:15:30.188Z","repository":{"id":16246373,"uuid":"18994174","full_name":"freerange/trello-backup","owner":"freerange","description":"Backup Trello boards to S3 bucket","archived":false,"fork":false,"pushed_at":"2023-11-24T17:42:47.000Z","size":728,"stargazers_count":1,"open_issues_count":27,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-10-29T13:25:02.775Z","etag":null,"topics":["aws","aws-cdk","aws-sdk","backup","lambda-functions","ruby","s3","trello"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/freerange.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":["floehopper"]}},"created_at":"2014-04-21T14:03:18.000Z","updated_at":"2024-07-16T20:48:10.000Z","dependencies_parsed_at":"2023-11-24T17:24:42.717Z","dependency_job_id":"847ed214-56f6-4a68-94d7-4f22e27f130c","html_url":"https://github.com/freerange/trello-backup","commit_stats":{"total_commits":182,"total_committers":5,"mean_commits":36.4,"dds":0.5604395604395604,"last_synced_commit":"14aa58b739b15862690ba5c14ca1e161797e39d7"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freerange%2Ftrello-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freerange%2Ftrello-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freerange%2Ftrello-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freerange%2Ftrello-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/freerange","download_url":"https://codeload.github.com/freerange/trello-backup/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240372833,"owners_count":19791082,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-cdk","aws-sdk","backup","lambda-functions","ruby","s3","trello"],"created_at":"2024-11-10T03:16:17.354Z","updated_at":"2026-05-07T19:15:30.183Z","avatar_url":"https://github.com/freerange.png","language":"TypeScript","funding_links":["https://github.com/sponsors/floehopper"],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://healthchecks.io/badge/311aafdb-71ec-4397-865b-d6437d/1YwAknpr/trello-backup.svg\" /\u003e\n\n## Introduction\n\nWe use the AWS Cloud Development Kit (CDK) to deploy this Trello Backup application to AWS.\n\nThe enumerateBoards Lambda function runs on a schedule and iterates over the Trello boards accessible to the user identified by the `TRELLO_KEY` and `TRELLO_TOKEN`. It publishes a message about each board using the Simple Notification Service (SNS).\n\nThe backupBoard Lambda function subscribes to the messages published by enumerateBoards and, for each Trello board, downloads the recent data from that board and stores the data to an S3 bucket.\n\nThe checkBoardBackups Lambda function is scheduled to run after we expect the backup to have completed and checks that the backups have been created as expected. It updates our monitoring service (healthchecks.io) with the success or failure of the backup job. It additionally sends us an email if the backup failed.\n\n## Requirements\n\n* bash\n* node\n* npm\n* ruby\n* bundler\n\n## Setup\n\n### Install ruby\n\n    rbenv install\n\n**NOTE**. If you're not using rbenv then be sure to install the version in .ruby-version.\n\n### Install node\n\n    nvm install\n\n**NOTE**. If you're not using nvm then be sure to install the version in .nvmrc.\n\n### Install node packages\n\n    npm ci\n\n### Configure AWS\n\nYou need the credentials of an AWS IAM user that has permission to create, modify and delete all the AWS resources used in this CDK application.\n\n    aws configure\n\n### Getting a Trello API key\n\n**NOTE**. If you're modifying an existing stack then you'll want to get the existing value from the deployed version. See the section on Environment Variables below for more information.\n\nEnsure you're signed in to [Trello][] as a user with access to the relevant boards.\n\n    $ open \"https://trello.com/1/appKey/generate\"\n    # Copy the Key (under Developer API Keys) to the clipboard\n\n    # Temporarily store the Trello API key in an environment variable\n    $ export TRELLO_KEY=`pbpaste`\n\n    # Store the Trello API key in AWS Secrets Manager\n    $ aws secretsmanager create-secret --name /trello-backup/TRELLO_KEY --secret-string \"$TRELLO_KEY\"\n\n### Getting a Trello API token\n\n**NOTE**. If you're modifying an existing stack then you'll want to get the existing value from the deployed version. See the section on Environment Variables below for more information.\n\nEnsure you're signed in to [Trello][] as a user with access to the relevant boards. It's safe to do this step multiple times as you'll get the same token back even if it's already been generated.\n\n    $ open \"https://trello.com/1/connect?key=$TRELLO_KEY\u0026name=$TRELLO_APP_NAME\u0026expiration=never\u0026response_type=token\"\n    # Allow the Trello backup \"app\" to read our Trello account\n\n    # Copy the token from the resulting page\n\n    # Temporarily store the Trello token in an environment variable\n    $ export TRELLO_TOKEN=`pbpaste`\n\n    # Store the Trello API token in AWS Secrets Manager\n    $ aws secretsmanager create-secret --name /trello-backup/TRELLO_TOKEN --secret-string \"$TRELLO_TOKEN\"\n\n### Environment variables\n\nThe following are injected into the AWS Lambda functions from the AWS Secrets Manager as environment variables:\n\n* `TRELLO_KEY` - secret used in all 3 Lambda functions to authenticate with Trello\n* `TRELLO_TOKEN` - secret used in all 3 Lambda functions to authenticate with Trello\n\nIn the `.env` file, set the following environment variables:\n\n* `TRELLO_BACKUP_CARD_MODIFIED_SINCE` - used in the backupBoard function to query Trello for cards modified since a certain date\n* `TRELLO_BACKUP_OLDEST_ALLOWED_BACKUP_IN_SECONDS` - used by checkBoardBackups to determine whether the latest backup is recent enough e.g. `1800` only allows backups to be 30 minutes old; older backups trigger an error\n* `HEALTHCHECKS_ENDPOINT_URL` - used by checkBoardBackups function to record the success/failure of the function\n* `TRELLO_BACKUP_MONITORING_EMAIL_ADDRESS` - the email address where monitoring emails will be sent (an email will be sent on first deployment to ask you to confirm the subscription)\n* `TRELLO_BACKUP_SCHEDULE_FOR_BACKUP` - specifies how often/when the backup is performed, e.g. `cron(0 2 * * ? *)` runs daily at 2am (see [Schedule Expressions for Rules][3] for details)\n* `TRELLO_BACKUP_SCHEDULE_FOR_CHECK` - specifies how often/when the post-backup check is performed, e.g. `cron(30 2 * * ? *)` runs daily at 2.30am; should typically be run some time after the backup phase is expected to complete\n\n#### Retrieving existing values from AWS\n\nIf you're modifying an existing CDK application then you'll want to retrieve the values that are being used in production. You can use the aws cli to populate your .env with the production values:\n\n```\necho \"TRELLO_BACKUP_CARD_MODIFIED_SINCE=$(aws lambda list-functions | jq '.Functions | .[] | select(.FunctionName | test(\"TrelloBackupStack-backupBoard\")) | .Environment | .Variables | .TRELLO_BACKUP_CARD_MODIFIED_SINCE')\" \u003e\u003e .env\necho \"TRELLO_BACKUP_OLDEST_ALLOWED_BACKUP_IN_SECONDS=$(aws lambda list-functions | jq '.Functions | .[] | select(.FunctionName | test(\"TrelloBackupStack-checkBoardBackups\")) | .Environment | .Variables | .TRELLO_BACKUP_OLDEST_ALLOWED_BACKUP_IN_SECONDS')\" \u003e\u003e .env\necho \"HEALTHCHECKS_ENDPOINT_URL=$(aws lambda list-functions | jq '.Functions | .[] | select(.FunctionName | test(\"TrelloBackupStack-checkBoardBackups\")) | .Environment | .Variables | .HEALTHCHECKS_ENDPOINT_URL')\" \u003e\u003e .env\necho \"TRELLO_BACKUP_MONITORING_EMAIL_ADDRESS=$(aws sns list-subscriptions | jq '.Subscriptions | .[] | select(.SubscriptionArn | test(\"TrelloBackupStack-monitoringTopic\")) | .Endpoint')\" \u003e\u003e .env\necho \"TRELLO_BACKUP_SCHEDULE_FOR_BACKUP=$(aws events list-rules | jq '.Rules | .[] | select(.Name | test(\"TrelloBackupStack-RuleForBackup\")) | .ScheduleExpression')\" \u003e\u003e .env\necho \"TRELLO_BACKUP_SCHEDULE_FOR_CHECK=$(aws events list-rules | jq '.Rules | .[] | select(.Name | test(\"TrelloBackupStack-RuleForCheck\")) | .ScheduleExpression')\" \u003e\u003e .env\n```\n\n## Build\n\n    npm run build\n\n## Compare the local version to production\n\n    npx cdk diff\n\n## Deploy the application\n\n    npx cdk deploy\n\n## Execute CDK commands\n\n    cdk --profile \u003caws-profile-name\u003e \u003ccdk-command\u003e\n\n* See [Command-line Toolkit][2] for a list of commands and options to use with\nthe `cdk` command-line tool.\n\n* The `cdk.json` file defines an appropriate value for the `--app` option, so\nthere is no need to specify this unless you want to override that value.\n\n* When a stack uses assets (e.g. via a call to `aws-lambda.Code.asset()`),\nbefore using the `cdk` command-line tool to deploy to an AWS environment for\nthe first time, the environment must be bootstrapped using: `cdk bootstrap`.\n\n[Trello]: https://trello.com\n[1]: https://awslabs.github.io/aws-cdk/getting-started.html#configuring-the-cdk-toolkit\n[2]: https://awslabs.github.io/aws-cdk/tools.html#command-line-toolkit-cdk\n[3]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreerange%2Ftrello-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreerange%2Ftrello-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreerange%2Ftrello-backup/lists"}