Code Monkey home page Code Monkey logo

aqa_s3_presigned_url's Introduction

This repo is based on https://github.com/aws-samples/amazon-s3-presigned-urls-aws-sam

S3 presigned URLs with SAM, auth and sample frontend

This example application shows how to upload objects to S3 directly from your end-user application using Signed URLs.

To learn more about how this application works, see the AWS Compute Blog post: https://aws.amazon.com/blogs/compute/uploading-to-amazon-s3-directly-from-a-web-or-mobile-application/

Important: this application uses various AWS services and there are costs associated with these services after the Free Tier usage - please see the AWS Pricing page for details. You are responsible for any AWS costs incurred. No warranty is implied in this example.

Added changes

We built our project based on the above example, added a S3 triggerred lambda function that executes whenever an object is created in the S3 bucket, and another function to report results.

.
├── README.MD                   <-- This instructions file
├── fetchScore                  <-- Source code for the serverless backend to fetch an item from DynamoDB table which stores the scores for uploaded videos
├── getSignedURL                <-- Source code for the serverless backend to get a presigned URL for upload
├── getPredScore                <-- Source code for the serverless backend to download object from S3 and process

Requirements

  • AWS CLI already configured with Administrator permission
  • AWS SAM CLI installed - minimum version 0.48.
  • python3.8

Installation Instructions

  1. Create an AWS account if you do not already have one and login.

  2. Clone the repo onto your local development machine using git clone.

Installing the application

There are two SAM templates available - one provides an open API, the other uses an authorizer. From the command line, deploy the chosen SAM template:

cd .. 
sam deploy --guided

When prompted for parameters, enter:

  • Stack Name: AQAUploadProcess
  • AWS Region: us-west-2
  • Accept all other defaults. Except:
UploadRequestFunction may not have authorization defined, Is this okay? [y/N]: y

This takes several minutes to deploy. At the end of the deployment, note the output values, as you need these later.

Testing with Postman

  1. First, copy the API endpoint from the output of the deployment. https://glxlp92kil.execute-api.us-west-2.amazonaws.com/uploads
  2. In the Postman interface, paste the API endpoint into the box labeled Enter request URL, select GET, add video as binary raw file.
  3. Send
  4. (For uploading a file to S3) In the Postman interface, open another tab, paste the presigned URL get from step 3, select PUT, add the same video as binary raw file as in step 2, send

aqa_s3_presigned_url's People

Contributors

gitskim avatar yumyumqing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.