AWS Lambda Function - Weather
This single AWS Lambda function detects the URL path and performs one of 2 behaviours.
Built with
| Item | Details |
|---|---|
| Language | C# on .NET 10 |
| Hosting | AWS Lambda (dotnet10 managed runtime, x86_64, 128 MB) in eu-west-2 (London), called through a Lambda Function URL |
| Libraries | Amazon.Lambda.Core, Amazon.Lambda.APIGatewayEvents, Amazon.Lambda.Serialization.SystemTextJson, Newtonsoft.Json |
| Weather data | Open Meteo API (free, no API key) |
| Tests | NUnit, FluentAssertions, Amazon.Lambda.TestUtilities |
| Build & deploy | Azure DevOps YAML pipeline: restore, build, test, publish, zip, then upload to AWS Lambda with aws lambda update-function-code |
Links
| Item | Link |
|---|---|
| AWS Lambda Function hosted at | https://v7jjoujoytcidnjfdihfleknda0pamsr.lambda-url.eu-west-2.on.aws |
| Git Repo at | https://dev.azure.com/jones-steve/_git/AWS%20Lambda%20Weather |
| Azure DevOps YAML built at | https://dev.azure.com/jones-steve/AWS%20Lambda%20Weather/_build |
Endpoints
| Path | Example | What it does |
|---|---|---|
/html |
https://v7jjoujoytcidnjfdihfleknda0pamsr.lambda-url.eu-west-2.on.aws/html | THIS PAGE. Returns this HTML, describing the function. |
/ (default) |
https://v7jjoujoytcidnjfdihfleknda0pamsr.lambda-url.eu-west-2.on.aws | Any other path returns the same page as /html. |
/weather |
https://v7jjoujoytcidnjfdihfleknda0pamsr.lambda-url.eu-west-2.on.aws/weather?latitude=53&longitude=-2 | Gets the current weather for the given LAT & LNG (lat:53, lng:-2 is Stockport, UK) from the Open Meteo API and returns it as JSON. |
Weather request
| Item | Details |
|---|---|
| Query parameters | latitude and longitude (both required, otherwise returns 400) |
| Open Meteo API called | https://api.open-meteo.com/v1/forecast?latitude=53&longitude=-2¤t=temperature_2m,wind_speed_10m,wind_direction_10m,relative_humidity_2m,rain,is_day |
| Response type | application/json |
Weather response fields
| Field | Example | Meaning |
|---|---|---|
Latitude | 53.0 | Latitude of the forecast point |
Longitude | -2.0 | Longitude of the forecast point |
Current.Time | 2026-06-14T22:30:00 | Time of the reading (GMT) |
Current.Temperature_2m | 12.7 | Air temperature 2m above ground, °C |
Current.Wind_speed_10m | 16.2 | Wind speed 10m above ground, km/h |
Current.Wind_direction_10m | 78 | Wind direction 10m above ground, ° |
Current.Relative_humidity_2m | 73 | Relative humidity 2m above ground, % |
Current.Rain | 0.0 | Rain, mm |
Current.Is_day | false | Whether it is daytime |
Example JSON response
{
"Latitude": 53.0,
"Longitude": -2.0,
"Current": {
"Time": "2026-06-14T22:30:00",
"Temperature_2m": 12.7,
"Wind_speed_10m": 16.2,
"Wind_direction_10m": 78,
"Relative_humidity_2m": 73,
"Rain": 0.0,
"Is_day": false
}
}