S3 Drive Live
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.
- An AWS account
- An S3 bucket
- An IAM user with permissions to upload
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).
-
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.
-
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.