Skip to content

johnjamesmarsh/devopsplayground11-lambda

 
 

Repository files navigation

Hands On Serverless Computing with Lambda

Sample Site | AWS Console | lab-001 | lab-002 | lab-003 | lab-004

Introduction

The topics for this hands-on session will be AWS Lambda, function as a service (FaaS). During this Playground you will create a website hosted on AWS S3 using AWS Lambda and Amazon API Gateway to add dynamic functionality to the site.

Steps

Each step will be associated with a Lab to complete build on the previous lab to progress. A Completed lab website is a available for view from the link above 'Sample Site'. All labs have been tested with the US Oregon region.

What is Serverless ?

A computing model where the existence of servers are hidden from developers. Within AWS eco-system Lambda is not the only serverless service. For the purpose of these labs we will look at S3, Lambda, and API Gateway to produce a functional website.

  • Storage - S3
  • Compute - Lambda
  • Database - DynamoDB, ElasticCache
  • API Proxy - API Gateway
  • Analytics - AWS Kinesis
  • Messaging & Queues - AWS SNS, SQS
  • State Management - AWS Step Functions
  • Diagnostics - AWS X-Ray

What Services Labs are covering?

  • S3 - Static Web hosting: Hosting a static website on S3 bucket.
  • Lambda: Creating a lambda function, that generates a random number and another function that processes form GET and PUT requests.
  • API Gateway: Using API Gateway to expose lambda function to static website hosted on S3 bucket.

Login

  • AWS Console: https://ecsd-training.signin.aws.amazon.com/console
  • Username: <TBA>
  • Password: <TBA>

Checkout code from GitHub

git clone https://github.com/ecsdigital/devopsplayground11-lambda.git
cd devopsplayground11-lambda

Download link for labs

wget --output-document  playground11.zip --quiet https://github.com/ecsdigital/devopsplayground11-lambda/archive/master.zip

Labs

  1. Lab-001 - Build Static Website with s3 Bucket
  2. Lab-002 - Sharing resources between s3 Buckets
  3. Lab-003 - Web Services with Lambda
  4. Lab-004 - Posting Data with Lambda

Prerequisites

  • Login to AWS account
  • Permissions to create S3 Buckets
  • Permissions to write and execute lambda functions
  • Permission to create API Gateway
  • Region: Oregon

IAM Roles needed for Labs

If you attempt the labs in your own AWS account you will need to create the following roles:

  • AWSS3FullAccess
  • AWSLambdaFullAccess
  • AmazonAPIGatewayAdministrator
  • AWSLambdaExecute

IAM Roles needed for Labs

Safari: Enable the hidden Develop menu

Some labs will require having access to a web browser console to see Browser errors like lab-002 and labb-003 for Cross Origin Resource Sharing. Safari has these development tools built-in however they need to be enabled.

Steps

  1. Safari > Preferences
  2. Check 'Show Develop menu in menu bar' (see image Safari Advanced Preferences red box)
  3. Safari menu bar should now show as in 'Safari Menu Bar' image below

Image: Safari Advanced Preferences

Safari Advanced Preferences Pane

Image: Safari Menu bar

Safari Menu

About

Lambda serverless workshop

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 58.2%
  • HTML 34.2%
  • Python 7.6%