This repo provides the code for the Lambda function that handles new SFTP uploads for the Prior Art Archive. Each file uploaded via SFTP is:
- Assigned a UUID,
- Appended with metadata for UUID and original filename,
- Copied to its final destination bucket.
On the Lambda function, the following environment variables must be set:
sourceBucket
: The name of the source S3 bucket.destinationBucket
: The name of the destination S3 bucket.idResolverUrl
: A URL that will be sent a GET request with?slug=example
and should return theid
of the Organization with that slug.
To build the Lambda trigger, use the yarn package
command and deploy the resulting deploy.zip
through the Lambda interface.
This project does not currently use a Lambda framework, so deployment and testing must be done manually using the AWS Lambda interfaces.
However, we have a nice yarn script to bundle the project in a format that can be uploaded to Lambda:
> yarn package
This will generate a deploy.zip file which can be uploaded to Lambda.
We use eslint, to check that your contribution meets the style guidelines just run:
> yarn lint
Check out this logging documentation for guidelines around when and how to log.