Going Serverless: AWS Lambda, and S3

Standard
Reading Time: < 1 minute

Setting up a local development environment for a serverless AWS system. I will be setting up a local development environment.

Things needed:
NVM
Node
AWS CLI tool Version 1
Serverless Framework

Install AWS CLI Version 1:

The guide to install can be found here.

Install NVM:

Install Node:

Install Serverless Framework:

Create Project:

Initialize NPM:

Node packages we’ll be using:

AWS Profile (~/.aws/credentials):

Using the profile:

Testing and Using S3

Configure: (serverless.yml)

Edit handler.js:

Start Serverless Offline: (try to use separate terminals)

Pushing up file to Local S3:

Retrieving a file from Local S3:

Results:

On your second terminal, the one you ran sls offline start you should have log outputs stating you have successful PUT and GET responses.

For the GET request, you should have a file in your tmp/ directory.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.