Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Lambda / node functionality #4

Open
peoplemerge opened this issue May 1, 2015 · 0 comments
Open

Basic Lambda / node functionality #4

peoplemerge opened this issue May 1, 2015 · 0 comments

Comments

@peoplemerge
Copy link

Lambda app should respond to an s3 event that dir structure containing images has changed.

This guide explains the source and steps http://docs.aws.amazon.com/lambda/latest/dg/getting-started-amazons3-events.html and http://docs.aws.amazon.com/lambda/latest/dg/walkthrough-s3-events-adminuser.html

Expect the event to have the format http://docs.aws.amazon.com/AmazonS3/latest/dev/notification-content-structure.html but all you need is the bucket name (well maybe 1-2 more like region).

Write a metadata file in json that reflects the structure of the dir tree, in alphanumeric order. For example:
sculpture
sculpture/2_angel.jpg
sculpture/1_duck.jpg
paintings
paintings/1_amywinehouse.jpg

resulting json:

{
"categories": {
  "sculpture":[
    "1_duck.jpg",
    "2_angel.jpg"
  ], 
  "paintings":[
    "1_amywinehouse.jpg"
  ]
}
}

For now don't worry about the case when a user loads 1000 images. The script will run 1000 times, which is fine.
Write documentation on how a developer can set it up (bucket names / iam permissions), using http://docs.aws.amazon.com/lambda/latest/dg/getting-started-custom-events.html as a reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant