WildRydes and AWS Amplify

I recently noticed that one of my favorite AWS tutorials has been updated to use AWS Amplify instead of an S3 bucket to host the static part of a serverless web application.

The rest of the application uses the same architecture as it did before, in other words API gateway is used to front the dynamic part of the site and invokes a Lambda function which writes to DynamoDB.

The tutorial can be found here:

https://aws.amazon.com/getting-started/hands-on/build-serverless-web-app-lambda-apigateway-s3-dynamodb-cognito/

From the Amplify page:

AWS Amplify is a set of tools and services that can be used together or on their own, to help front-end web and mobile developers build scalable full stack applications, powered by AWS. With Amplify, you can configure app backends and connect your app in minutes, deploy static web apps in a few clicks, and easily manage app content outside the AWS console.

You have the option of using an autogenerated domain name like this:

https://master.d27ic7jm0hwx2o.amplifyapp.com

or you can use a custom domain name in Route 53 which maps onto a supplied CloudFront name like this (Amplify integates with CloudFront behind the scenes):

wildrydes.thetrainit.com CNAME Simple
d2uobbjz8282xe.cloudfront.net

It also integrates with CodeCommit/Github, so that every time an update to the code is pushed, Amplify will provision, build, deploy and verify the application.

 

Wild Rydes: Building the Future of Unicorn Transportation

Fans of Wild Rydes will know that you can request a Wild Ryde from any location. Today, the CTO of Wild Rydes made this announcement:

“In order to protect the safety of our employees and customers, pick up points will be at designated landing pads. These includes parks and open spaces.”

A unicorn, who wished to remain anonymous, told us:

“I welcome this decision. Flying along streets is fine in science fiction films like The Fifth Element, but has proved too dangerous in real life”

April 1st, 2020

Introduction to Lambda – Image Thumbnail Application

In the “Systems Operations on AWS course” there is a short section on Lambda, and an example of creating a serverless image thumbnail application.

The course does not include any labs on Lambda, however the above graphic from the courseware is a free qwiklabs.com lab called “Introduction to AWS Lambda”.

If you attended an official AWS course with a partner training organization, you will have likely created and used an account on xx-xxxx-qwiklab.com, where xx-xxxx is training partner specific.

You can also create an account directly with qwiklabs.com, There are over 100 labs based on AWS, some which are free, including “Introduction to AWS Lambda”

A user uploads an object to the source bucket

S3 detects the object-created event and invokes the Lambda function passing the event data as a function parameter.

Lambda reads the object, creates a thumbnail using graphics libraries, and saves the thumbnail to the target bucket.

 

 

Step Functions

The “Architecting on AWS” started covering Step Functions in October 2018.

The course labs do not include step functions, but there is a good “10 Minute” tutorial here.

Step Functions is a serverless orchestration service that lets you easily coordinate multiple Lambda functions into flexible workflows that are easy to debug and easy to change.

The workflows you build with Step Functions are called state machines, and each step of your workflow is called a state.

All work is done by task states, which can be Lambda functions

The tutorial creates a step function which is presented visually

This state machine uses a series of Task states to open, assign and work on a support case. Then, a Choice state is used to determine if the case can be closed or not. Two more Task states then close or escalate the support case as appropriate.

The above image shows an execution of the workflow where the support case was escalated, causing the workflow to exit with a Fail state.

In a real world scenario, you might decide to continue working on the case until it is resolved instead of failing out of your workflow. To do that, you could remove the Fail state and edit the Escalate Case Task in your state machine to loop back to the Work On Case state. No changes to your Lambda functions would be required

Serverless Lab

There is a lab on Serverless Architecture in the Architecting course, making use of S3, Lambda, SNS, SQS and DynamoDB to process a file of customer banking transactions.

However there is no lab on API Gateway. Even though hands-on knowledge is not required for the exam, it is always good to try things out.

There is a walkthough Build a Serverless Web Application on the AWS site.

The exercise uses API Gateway, S3, Lambda and DynamoDB. For good measure, although it is not covered in the Architecting course or exam, it also uses Cognito for authentication.

The exercise takes about 2 hours. Cloud Formation scripts are also provided, but then you miss all the learning points.

Basically you sign in to the application using your email address, and then click on a map to order a taxi, except in this case its a flying taxi in the form of a Unicorn. When you click on a map and order a Unicorn, your  coordinates and username are posted to API gateway, which triggers Lambda to find the nearest available Unicorn. Lambda also logs your ride in DynamoDB.