- Clone repo:
git clone git@github.com:foresighttech/cdk-s3-trigger-sfn.git
- Yarn init:
yarn
- projen init:
npx projen
- projen deploy (using shell credentials):
npx projen deploy
Upload exampleFiles/invalidFile.json
and exampleFiles/validFile.json
to the source bucket, and they will be sorted into the valid and quarantine buckets.
.projenrc
- project configuration file (using Projen)src/main.ts
- Main infrastructure definition using AWS CDK, including buckets and Step Functions definitionsrc/s3-event-trail.ts
- CDK construct that allows S3 events to trigger Step functions using CloudTrailsrc/main.copyToBucket.ts
- NodeJS lambda function that copies from a source bucket to a destination bucket defined in the eventsrc/identify_file
- Python lambda function that looks for specific fields in a provided JSON file and raises an error if not foundexampleFiles/
- Example files for this POC
npx projen destroy