This repository is a CDK stack which deploys a Lambda function and a S3 bucket to your AWS account and will run automatic backups from your Contentful instance.
Image | Name | Team | |
---|---|---|---|
Jörn Meyer | [email protected] |
- Create your own environment file by executing
cp .env.example .env
. - Modify the values in the
.env
file to your liking. Please pay special attention to theSCHEDULE
variable1. - Afterwards, run
cdk synth
2. - Your backups will automatically show up in the S3 bucket called
[YOUR_PREFIX]-contentful-backup-bucket
.
Variable | Use |
---|---|
CONTENTFUL_MANAGEMENT_TOKEN |
Your personal access token for the Contentful Management API. Find yours here. |
CONTENTFUL_SPACE_ID |
The space ID for your Contentful space. Find yours here. |
CONTENTFUL_ENVIRONMENT_ID |
The identifier for your Contentful environment. Default is master . |
PREFIX |
This string gets prefixed to all resource names in your AWS so you can run multiple backups for multiple Contentful spaces in the same AWS account without namespace pollution. |
SCHEDULE |
The schedule your backups should be created on. Uses cron syntax, so, for example cron(0 23 * * ? *) will make a backup every night at 11pm. |
TIMEOUT_MINUTES |
The timeout in minutes for the Lambda function creating your backups. |
MEMORY_SIZE |
The memory limit for the Lambda function in MB. |
Command | Result |
---|---|
npm run build |
compile typescript to js |
npm run watch |
watch for changes and compile |
npm run test |
perform the jest unit tests |
cdk deploy |
deploy this stack to your default AWS account/region |
cdk diff |
compare deployed stack with current state |
cdk synth |
emits the synthesized CloudFormation template |