Skip to content


Folders and files

Last commit message
Last commit date

Latest commit



34 Commits



AWS Lambda function/application invoking Airly API to get some basic information about current air quality.

Lambda code is writen in Python and is rather easy to understand. As it only calls API and filters the result.

Email notification

Full information about at all indexes, pollutants and weather conditions.

Example of email received when there is bad air quality at location named Home: Email notification example

SMS notification

Only basic information, about main index value, percentage of pollutants indexes, and weather conditions.
Example of SMS received when there is good air quality at location named Home. SMS notification example

TODO list

  • Add unit tests for Python code
  • Add Lambda functional testing with lambci/docker-lambda
  • Create Terraform module from the current setup + add tags
  • Add simple scripts for single deployment. Use Krzysztof-Szyper-Epam/docker-terragrunt, so the only prerequisite will be Docker.
  • Add DynamoDB table for location lists. Allow different combinations of location, trigger and topic.


Terraform disclaimer

Infrastructure part can be easily deployed with Terraform with already existing definition.
It's meant be just an example of implementation, hence S3 bucket used for Lambda package will be created and destroy by default.
For simplicity Terraform backend is set be local only, so don't run it in a container or untrusted host, because you may loose or expose your tfstate file.
To adjust it to your existing infrastructure some Terraform basic knowledge is necessary.

AWS credentials

Follow instruction in AWS documentation.


Create secrets.tfvars file and put there your values as in example below.
For more details see description of those variables in
Example shows value that you NEED to set, other values can be overwritten if you like.

airly_api_key             = "1234567890abcdefABCDEF1234567890"
enable_bucket_creation    = true
enable_bucket_termination = true
user_email                = "" # can be empty - email notification will not be sent
user_locations = [{
  expression = "cron(0 11 ? * * *)"                         # trumpet call played at 12:00 each day -
  map_point  = ",19.93734" # location of Krakow Cloth Hall -
  name       = "Sukiennice"                                 # name of this place in Polish
user_phone = ""          # can be empty - text notification will not be sent
s3_bucket  = "my-bucket" # must be provided
s3_key     = ""          # can be empty - default location will be created



  • cd terraform
  • terraform init
  • terraform apply -var-file=secrets.tfvars


No releases published


No packages published