{"id":15884066,"url":"https://github.com/christophshyper/lambda-airly","last_synced_at":"2026-01-03T17:07:53.700Z","repository":{"id":50156111,"uuid":"223025962","full_name":"ChristophShyper/lambda-airly","owner":"ChristophShyper","description":"AWS Lambda function/application invoking Airly API to get some basic information about current air quality","archived":false,"fork":false,"pushed_at":"2024-07-08T07:29:44.000Z","size":137,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T04:07:04.971Z","etag":null,"topics":["airly","airly-api","api-client","aws-lambda","lambda-architecture","lambda-functions","serverless","serverless-applications","terraform","terraform-aws"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ChristophShyper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-20T20:56:05.000Z","updated_at":"2024-07-08T07:29:47.000Z","dependencies_parsed_at":"2024-06-25T09:56:52.302Z","dependency_job_id":"51df32db-18dc-4ee3-862d-7015c560275d","html_url":"https://github.com/ChristophShyper/lambda-airly","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChristophShyper%2Flambda-airly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChristophShyper%2Flambda-airly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChristophShyper%2Flambda-airly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChristophShyper%2Flambda-airly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChristophShyper","download_url":"https://codeload.github.com/ChristophShyper/lambda-airly/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244059467,"owners_count":20391329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["airly","airly-api","api-client","aws-lambda","lambda-architecture","lambda-functions","serverless","serverless-applications","terraform","terraform-aws"],"created_at":"2024-10-06T04:42:28.076Z","updated_at":"2026-01-03T17:07:48.669Z","avatar_url":"https://github.com/ChristophShyper.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lambda-airly\n\n\n# Description\n[AWS](https://aws.amazon.com/) [Lambda](https://aws.amazon.com/lambda/) function/application invoking [Airly](https://airly.eu/) [API](https://developer.airly.eu/) to get some basic information about current [air quality](https://www.airqualitynow.eu/pollution_home.php).\n\nLambda code is writen in [Python](https://www.python.org/) and is rather easy to understand. As it only calls API and filters the result.\n\n## Email notification\nFull information about at all indexes, pollutants and weather conditions.\u003cbr\u003e  \nExample of email received when there is bad air quality at location named Home:\n![Email notification example](https://raw.githubusercontent.com/Krzysztof-Szyper-Epam/lambda-airly/master/images/email.png)\n\n## SMS notification\nOnly basic information, about main index value, percentage of pollutants indexes, and weather conditions.\u003cbr\u003e\nExample of SMS received when there is good air quality at location named Home.\n![SMS notification example](https://raw.githubusercontent.com/Krzysztof-Szyper-Epam/lambda-airly/master/images/sms.png)\n\n# TODO list\n* Add unit tests for Python code\n* Add Lambda functional testing with [lambci/docker-lambda](https://github.com/lambci/docker-lambda)\n* Create Terraform module from the current setup + add tags\n* Add simple scripts for single deployment. \nUse [Krzysztof-Szyper-Epam/docker-terragrunt](https://github.com/Krzysztof-Szyper-Epam/docker-terragrunt), so the only prerequisite will be Docker. \n* Add DynamoDB table for location lists. Allow different combinations of location, trigger and topic.\n\n# Prerequisites\n- [AWS](https://aws.amazon.com/) account, free tier should be enough to run it.\n- [Airly devloper](https://developer.airly.eu/) account with [API key](https://developer.airly.eu/docs#general.authentication)\n- [Python](https://www.python.org/) and [Terraform](https://www.terraform.io/) basics\n- [Linux](https://www.linux.org/) or [WSL](https://docs.microsoft.com/pl-pl/windows/wsl/install-win10) for running deployment scripts and tasks\n- [Docker](https://www.docker.com/) host application to run the deployment (for building Python requirements)\n\n# Terraform disclaimer\nInfrastructure part can be easily deployed with [Terraform](https://www.terraform.io/) with already existing definition.\u003cbr\u003e\nIt's meant be just an example of implementation, hence S3 bucket used for Lambda package will be created and destroy by default.\u003cbr\u003e\nFor 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.\u003cbr\u003e\nTo adjust it to your existing infrastructure some Terraform basic knowledge is necessary.\n\n# AWS credentials\nFollow instruction in [AWS documentation](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html).\n\n# Configuration\nCreate `secrets.tfvars` file and put there your values as in example below.\u003cbr\u003e\nFor more details see description of those variables in `variables.tf`.\u003cbr\u003e\nExample shows value that you *NEED* to set, other values can be overwritten if you like.\n```hcl-terraform\nairly_api_key             = \"1234567890abcdefABCDEF1234567890\"\nenable_bucket_creation    = true\nenable_bucket_termination = true\nuser_email                = \"\" # can be empty - email notification will not be sent\nuser_locations = [{\n  expression = \"cron(0 11 ? * * *)\"                         # trumpet call played at 12:00 each day - https://en.wikipedia.org/wiki/St._Mary%27s_Trumpet_Call\n  map_point  = \"https://airly.eu/map/en/#50.06170,19.93734\" # location of Krakow Cloth Hall - https://en.wikipedia.org/wiki/Krak%C3%B3w_Cloth_Hall\n  name       = \"Sukiennice\"                                 # name of this place in Polish\n}]\nuser_phone = \"\"          # can be empty - text notification will not be sent\ns3_bucket  = \"my-bucket\" # must be provided\ns3_key     = \"\"          # can be empty - default location will be created\n```\n\n# Test\n\n# Deploy\n- `cd terraform`\n- `terraform init`\n- `terraform apply -var-file=secrets.tfvars`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristophshyper%2Flambda-airly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchristophshyper%2Flambda-airly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristophshyper%2Flambda-airly/lists"}