aws-lambda-image
aws-lambda-image copied to clipboard
Run against existing S3 images.
I guess it would be useful for a lot of people if you could also run this function against pre-existing files on S3. Is there a way to do so? I've seen some people use S3 list for such kind of things. Is this possible using Claudia.js?
You would need to install Claudia globally and then you can use test-lambda command with --event
flag. The problem is that you should create separate event file for each already existing image you would like to process. You can use the event_source.json from fixtures as example and update file path, bucket ARN and name and I guess that would be it. Let me know if this works for you.
You can copy S3 objects from existing bucket to the bucket with configured SNS. Every copied file will trigger a Lambda function. To copy files use 'aws s3 cp'
Thanks, that worked for me. However I still think it is nice to do it without moving all files back and forth. Guess that just isn't supported by the way AWS implemented Lambda events?
@Joostvanderlaan which method worked for you? The one from @sheh1000 ? aws s3 cp
doesn't trigger the lambda function for me. I am using:
aws s3 cp test.jpg s3://[bucketname]/directory/test.jpg
to test the function.
Any help will be appreciated :)
Got it working. Lambda function wasn't triggering because of bucket policies.