How to help your coworkers get vaccinated in 7 steps

Warren Veerasingam
5 min readApr 11, 2021

--

“You’re discussing tactics! Do you realize what this really comes down to? Millions and millions of lives hanging on what this vessel does next!” — McCoy to Spock.
“I’m not a doctor dammit, but an engineer.” — that’s probably what I would say to McCoy.

Well, in case you were not on earth last year; we were hit by a global pandemic — Covid-19. Covid-19 is a new disease, caused by a novel (or new) coronavirus that has not previously been seen in humans. Luckily for us humans— a vaccine is now available (although it’s not tested on Klingon yet).

While some states might have an efficient vaccine rollout plan, other states are struggling to get people vaccination. In my state, the governor purchases the vaccines and distributes it to local pharmacies. So, if you want to get vaccinated, you need to make an appointment with a local pharmacy.

The problem with that is you have to visit their website and hit refresh until you find an appointment available. Unless you don’t have a full time job or you find pleasure staring at screen, I have a better way to solve this problem — we send a push notification when a vaccine appointment becomes available at a local pharmacy. If your company or you have an AWS account, you can set this up for the company. This way, all your coworkers can get notified when there’s a vaccination opportunity near them. Your coworkers can get notified via Slack (that’s what I do), Microsoft Teams, plain ol’ email or SMS.

If you have read this far and would like to pursue this effort, the following are the steps to set this up on your AWS account. Remember, the “Logic clearly dictates that the needs of the many outweigh the needs of the few.” You can make a difference at your workplace or community!

What is this application about?

A lightweight application (lambda function) that notifies you when a vaccine appointment becomes available near you. Get notified on:

  • Slack
  • Microsoft Teams
  • Email
  • SMS (text message)

Workflow

  1. CloudWatch will periodically trigger lambda.
  2. The lambda function (Notifier app) will call the following API: https://www.vaccinespotter.org/api/v0/states/<STATE>.json
  3. With the returned payload from the API, we will check against DynamoDB if the alert has been sent before. If it’s the same as the previous alert, the function does nothing.
  4. If the alert is new and is different than the previous alert, the function will trigger the SNS Topic.
  5. All resources subscribing to the SNS topic will receive the alert.

Step-by-step guide

1. Create IAM Policy

  • Navigate to the IAM Page on AWS console
  • Create new policy — covid-vaccine-all-lambda
  • Update <update-account-number-here> with your AWS account number
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb:BatchGetItem",
"dynamodb:GetItem",
"dynamodb:Query",
"dynamodb:Scan",
"dynamodb:BatchWriteItem",
"dynamodb:PutItem",
"dynamodb:UpdateItem"
],
"Resource": "arn:aws:dynamodb:us-east-1:<update-account-number-here>:table/Covid"
},
{
"Effect": "Allow",
"Action": [
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Resource": "arn:aws:logs:us-east-1:<update-account-number-here>:*"
},
{
"Effect": "Allow",
"Action": "logs:CreateLogGroup",
"Resource": "*"
}
]
}

2. Create IAM Role

  • Navigate to the IAM Page on AWS console
  • Create new Role
  • For ‘Choose a use case’, select Lambda
  • Filter for the policy you’ve created in the previous step covid-vaccine-all-lambda
  • Name the new role — covid-vaccine-all-role

3. Create SNS Topic

  • Navigate to the SNS Page on AWS console
  • Create topic
  • Type: Standard
  • Name: covid-vaccine-notifier
  • You will need the Topic ARN for the next step. Copy for later use

4. Create Dynamo Table

  • Navigate to the DynamoDb Page on AWS console
  • Create new table
  • Table name: Covid
  • Primary key* : Partition key: Source Type: string

5. Create Lambda Function

  • Navigate to the Lambda Page on AWS console
  • Create new lambda function
  • Function name: covid-vaccine-notifier
  • Runtime: Go 1.x
  • Change default execution role: Use an existing role
  • Existing role (created in previous step): covid-vaccine-all-role
  • Download latest zip file covid-vaccine-notifier-lambda.zip from github release here
  • Upload the zip file from previous step
  • Update Runtime setting to: bin/covid-vaccine-notifier
  • Navigate to the Configuration tab
  • Navigate to Environment variables
  • Insert the following environment variables:
  • MUTE: hyvee (the pharmacies you would like to mute)
  • RANGE_A: 00000 (starting range of zipcode — leave blank if you want the whole state)
  • RANGE_B: 99999 (ending range of zipcode — leave blank if you want the whole state)
  • SOURCE: covid-vaccine-notifier (you don’t have to change this)
  • STATE: IA (match the state you’re living)
  • TABLE_ID: 2019 (you don’t have to change this)
  • TABLE_NAME: Covid (you don’t have to change this)
  • TOPIC_ARN: (paste the topic ARN from the previous step)
  • AWS_REGION: Default is us-east-1
  • See example:

6. Create CloudWatch Rule

  • Navigate to the CloudWatch Page on AWS console
  • Navigate to Events-> Rules
  • Create Rule
  • Step 1: Event Source. Choose Schedule
  • Enter the rate you want the API to be checked. Ideally it would be 5 minutes
  • Target: Choose Lambda function
  • Function: covid-vaccine-notifier

7. Create Subscription

  • Navigate to the SNS Page on AWS console
  • On side bar, select Subscription
  • Next, Create subscription
  • On dropdown — Select the SNS Topic ARN , created in previous step — arn:aws:sns:us-east-1:<update-account-number-here>:covid-vaccine-notifier
  • Protocol — Choose SMS for text message notification or Email for email notification
  • Both Slack and Teams channel should have an option to send emails to that channel.

How to get email for Slack

How to get email for Team

That’s it!

If you have any questions, leave a comment or open an issue here.

Resources: https://github.com/warrensbox/covid-vaccine-tracker

Live long and prosper 🖖

--

--

Warren Veerasingam
Warren Veerasingam

Written by Warren Veerasingam

Software Engineer at Pixar Animation Studios

No responses yet