Skip to content

Weather bot to send regular weather updates using AWS Lambda and Amazon SES. (Serveless architecture)

License

Notifications You must be signed in to change notification settings

abhiKohar/weather-bot

Repository files navigation

Weather BOT

Overview

This is a weather bot to send daily weather updates to an email list using AWS Lamda, Amazon SES and python.

Technology Stack

Notebooks

  • Python Notebook 1: notebook_1_Abhinav_kohar.ipynb -- Notebook that can take lat long inputs and generate weather report/forecast with charts for the location
  • Python Notebook 2: notebook_2_Abhinav_kohar.ipynb -- Notebook that has function to send an email to given email_id
  • Python Notebook 3: notebook_3_Abhinav_kohar.ipynb -- Notebook that can take lat/long, email_id as input at top and when run sends an email of weather report

Visualized weather

Example

Weather email example

Setup

AWS

Local

  • Setup a virtual environment, python3 -m venv .venv
  • Run pip install -r requirements.txt to install dependencies
  • Run python lambda_function.py to test locally
    • Note: Either populate a .env file and load its contents for local development or manually replace environment variables used in the code with values while testing locally.
    • pip install python-dotenv
    • from dotenv import load_dotenv
    • load_dotenv()

Deployment

  • Run ./scripts/build-deploy.sh to build and deploy the lambda to AWS

  • Run ./aws/ses/scripts/ses-create-weather-reminder-template.sh to create the WeatherReminderTemplate email template in SES

  • Run ./aws/ses/scripts/ses-update-template-weather-reminder.sh to update the WeatherReminderTemplate email templae in SES

  • Update the email sending persmissions for lamda user

  • Set the run schedule

  • AWS eventbridge config

Weather email example

  • AWS lamda function config

Weather email example

  • IAM policy

Weather email example

About

Weather bot to send regular weather updates using AWS Lambda and Amazon SES. (Serveless architecture)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages