Skip to content

An awsm that does image operations for you (resizing, etc.)

Notifications You must be signed in to change notification settings

awsm-org/awsm-images

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

awsm-images

This awsm does image modifications (resizing, etc.) and showcases many of the features and integration points of JAWS:

  • browserify optimization
  • including own version of the aws-sdk
  • ENV var integration into code and exposing via the awsm.json:lambda.envVars extension point
  • Leverage awsm CloudFormation extension points (creates s3 bucket AND sets up fine grain perms)

Quickstart

Goal: Given image url, creates a thumbnail and saves to s3 bucket with the JAWS_DATA_MODEL_STAGE prefix (default jaws env var) and an env var defined by this awsm (IMAGE_RESIZE_BUCKET)

  1. Create a new jaws project. Commit your files to version control so we can do diff later (trust me this is worth it)
  2. Run npm install --save awsm-org/awsm-images
  3. This downloads the module, installs its dependencies (via npm), replicates the AWSM module to the aws_modules directory, merges in CF resources to project resources-cf.json, merges in CF lambda IAM rules to project resources-cf.json. Cool right?
  4. Run jaws env list <stage> all You will notice how IMAGE_RESIZE_BUCKET is not set.
  5. Run jaws env set <stage> all IMAGE_RESIZE_BUCKET <imgresize.yourdomain.from.new.jaws.project.prompt>
  6. Cd into aws_modules/awsm-images/thumbnail and run jaws deploy lambda. Note how small the lambda code size is ;). Most of the size is the aws-sdk that can't currently be browserified.
  7. Find an image that is > 100x100 and test the lambda sending json {"url":"url here"}

About

An awsm that does image operations for you (resizing, etc.)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published