Live
S3 DriveHow 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
-
Install the dependencies:
yarn
-
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
-
Go to the Angular app directory
cd angular
-
Install dependencies
yarn
-
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.