Giter VIP home page Giter VIP logo

aws-serverless-s3-file-upload's Introduction

AWS Serverless

A serverless app that is hosted on Amazon AWS Lambda and stores data on DynamoDB and S3

Amazon AWS Settings

  • Sign Up to Amazon AWS using their 1-year free tier
  • On AWS, go to the IAM service
    • Create a new user
    • For "AWS credential type", make sure to select at least "Access key - Programmatic access"
    • In the Permissions screen, just to configure this example faster give the "AdministratorAccess" permissions. Either create a group to attach permissions and add your user or give your user this permissions directly. But for real scenarios, check the permissions needed. Never give full admin permissions if that is not needed.
    • Copy both "Access key ID" and "Secret access key" to the corresponding keys in your .env file
  • Go to the S3 service and click to create a bucket
    • The name must be unique in all amazon aws
    • Select the region closest to you to reduce any network delays and TAKE note of that because after 1 year you will start being charged if you did not delete your things.
    • For this example, uncheck the checkbox "Block all public access" to allow public access to your bucket
    • Click on "Create Bucket"
    • Save the name of the bucket and region chosen in the .env file corresponding key
  • On your terminal type:
      serverless config credentials --provider aws --key=<your_access_key_id> --secret=<your_secret_access_key> -o
    

Installation

yarn

Serverless Deploy

On your terminal type:

  yarn deploy

This process might take a quite some time. Once your deploy is finished you should receive in your terminal the URLs to call your serverless functions

AWS Lambda

Once the deploy is finished you can check your function at https://console.aws.amazon.com/lambda/home?region=us-east-1#/functions

Also, a bucket on AWS S3 will be created with the prefix osf-serverless-certificate.

In case you had no errors during the deploy and your code is not there, check other AWS Regions

Running the Application Locally

In the .env file there is a flag to decide if you want to use the in memory DynamoDB instance or not. If it is TRUE, it will use the local DynamoDB

Open a terminal and run:

yarn dynamo:start

Obs: It might take a few seconds for the local DynamoDB shell on localhost to be up.

Open another terminal and run:

yarn dev

Routes

Check the insomnia file in the project for routes to call the application both locally and on aws. Just remember to replace the production ones with the ones received after the deploy finished

aws-serverless-s3-file-upload's People

Contributors

anderson-0 avatar

Watchers

 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.