The name of the watermark image is hardcoded in the add_watermark() function. You can add another image file into the project and change the code to reflect that, if you want.
- Log in to AWS console, on the eu-central-1 region
- Setup IAM role 'lambda-with-s3' with AmazonS3FullAccess and CloudWatchLogsFullAccess (eller bara AWSLambdaFullAccess)
- Setup empty S3 bucket. Note the name.
- Create lambda function named "watermarker"
- IAM role: 'lambda-with-s3'
- Select event source S3 from list
- Tie trigger from S3 bucket created above for "ObjectCreated (All)" event type
- Set timeout 10 seconds, max memory 256 MB.
- Run npm install unless that's already up-to-date
- Run ./create-lambda-package.sh from project directory to create the deploy.zip file
- Upload zip file
- Enable event trigger