Background story

One of our team members ran into an interesting real-life problem. His husband wanted to sign up for a Yoga class that was filling up very quickly. The problem was that the Yoga school was updating the class availability on the website and not sending email notifications.

So as one does, he used Altostra to create a scheduled application that scrapes the Yoga website every hour, diffs the current classes schedule against the previously stored one in a DynamoDB table and publishes a message to an SNS topic if any changes are detected. He then subscribed a phone number to the SNS topic, and sure enough, everyone was happy.

When they were done, removing the application was a matter of a few clicks — with the peace of mind that they have it available to be deployed again in a few clicks if the need arises.

That’s what we call Serverless Romance!

This is just one example of how you can use serverless services to quickly build a solution for real-world problems, and with Altostra, it’s super easy.

The problem

In this post, we’ll create a similar application to the one described above. To keep it in context with current real-life problems, our application will periodically poll a COVID-19 data API for a country of our choice and notify us if the infection count has gone up over a specific limit since the last check. Essentially, we’re building a personal COVID-19 alerting service.

Setup

Our cloud service provider is going to be AWS. The runtime for our code is Node.JS 12 and the design and deployment will be done using Altostra.

The cloud resources we’ll be using are:

  • Scheduler (an EventBridge rule with a schedule expression)
  • Lambda Function
  • DynamoDB Table
  • SNS Topic

We begin by initializing a project in a new directory:

$ mkdir covid19-tracker
$ cd covid19-tracker

$ alto init
✔ Initializing project

$ npm init -y; echo node_modules > .gitignore
$ git init
$ git add -A .
$ git commit -m "Initial"

#scheduled-tasks #altostra #serverless #aws #how-to

Solving real-life problems using serverless technologies
1.10 GEEK