Skip to content

samaksha/S3-Drive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

S3 Drive Live

How it works?

You need to create a presigned url using valid AWS credentials (the presigned url will inherit the permissions from the IAM instance or IAM user who generated the link), then another application is able to perform an upload without needing to be authenticated to your AWS account.

Requirements

  • An AWS account
  • An S3 bucket
  • An IAM user with permissions to upload

How to run the sample code?

We split our code in 2 sections:

  • Express server app which will be used to generate presigned urls (must be authenticated to AWS).
  • An angular application that will fetch the presigned url and upload a file (using Angular owns HTTP library).

Run the Express app

  1. Install the dependencies:

    yarn
  2. Run the server

    yarn start

Note: keep in mind that the sample does NOT have explicit AWS credentials set, so it will try to fetch them from one of the available sources. Check AWS documentations here about how the Node SDK chooses credentials.

Run Angular app

  1. Go to the Angular app directory

    cd angular
  2. Install dependencies

    yarn
  3. Run application

    yarn start

Note: for both Angular app and the backend script, the server must be running. Also, inside the backend script, .ENV must be populated.