Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

A Serverless framework deployment that creates a Lambda function, S3 bucket, and three DynamoDB tables. It then uploads the json data to the bucket and after deployment with cloud formation completes, invokes the lambda which extracts the s3 data and inserts it into the tables.

vinarius/aws-serverless

Repository files navigation

User Stories

Build a serverless framework deployment that creates a Lambda, an S3 bucket, and a Dynamo DB table and uploads a file to your bucket. Then, write a plugin that invokes the Lambda after the deployment, extracts data from the file in S3 and inserts that data into DynamoDB. Be creative. Show off. Make it interesting.

Getting Started

You must have an active account registered with AWS as well as Serverless for the application to function.

The following environment variables are required:

  • ACCESS_KEY_ID - Your aws account key id.
  • SECRET_ACCESS_KEY - Your aws account secret access key.
  • BUCKET_NAME - Desired s3 bucket to load data into and extract out of. Must be a globally unique name conforming to s3 standards.
  • MY_AWS_REGION - Desired region to generate stack resources in.

Run the following commands to get started: npm i npm run tsc

The output conjure.js file is what will be uploaded by serverless.

The Serverless library must be globally installed. You can visit the getting started docs for more info.

Once your AWS and Serverless accounts are registered and environment variables are set, run the following command to setup the application and cloud stack in your AWS account: serverless deploy

Work History

This repository uses a library called 'serverless'. I created an IAM user and generated an access key and a secret key so I could use aws services programatically. I stored the access keys in environment variables, leaving them out of the repository and source code. I then used the 'serverless deploy' command to take the local code, leverage the aws user to go into cloud formation, and generate the stack.

What did it generate:

  • DynamoDb Spells Table
  • DynamoDb Houses Table
  • DynamoDb Characters Table
  • S3 Bucket
  • S3 Bucket Policy
  • IAM role for lambda execution
  • Lambda logging capabilities with cloudwatch
  • Lambda function

About

A Serverless framework deployment that creates a Lambda function, S3 bucket, and three DynamoDB tables. It then uploads the json data to the bucket and after deployment with cloud formation completes, invokes the lambda which extracts the s3 data and inserts it into the tables.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published