Skip to content

binoculars/awsm-s3tokenvendor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NPM npm version

Description

An AWSM module that returns upload tokens for S3 objects. Instead of handling uploads yourself with a passthrough, let AWS do the work for you by generating a signed request and let the client upload the file directly to S3.

Usage

  1. Create a JAWS project, jaws project create
  2. cd into the project directory.
  3. Run npm install --save awsm-s3tokenvendor
  4. Run jaws env set <stage> all UPLOAD_TIMEOUT <value>, where <value> is the timeout in minutes.
  5. Run jaws env set <stage> all UPLOAD_BUCKET <value>, where <value> is the name of the S3 Bucket you want your uploads to go to.
  6. optional Run jaws env set <stage> all UPLOAD_CONTENT_TYPE <value>, where <value> is the content type of the upload. For example:
    1. For PNG images, use image/png
    2. For any image, use image/
    3. For videos, use video/
    4. See the IANA list for all types.

Front-end

See Browser Uploads to S3 using HTML POST Forms

TODO

  • Ensure Lambda Function has IAM permissions for PutObject access to the S3 bucket in the CloudFormation template
  • Hook to create the S3 bucket if it does not exist

Disclaimer: This is currently a WIP. Use at your own risk.

About

AWS Module to generate S3 upload tokens

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published