lambda version in ZIP; update readme; improve status code responses

This commit is contained in:
Brandon Liu
2022-07-18 23:01:00 +08:00
parent de687baf61
commit 1570ff0253
3 changed files with 35 additions and 26 deletions

View File

@@ -5,10 +5,12 @@
Upload the resulting `lambda_function.zip` using the Lambda console.
## Restrictions
1. There is a limit of 1 MB for tiles served through Lambda@Edge.
2. Lambda@Edge does not support layers, environment variables, or ARM functions.
## Configuration
* `BUCKET`: the S3 bucket name.
* `PMTILES_PATH`
* `TILE_PATH`
## AWS Notes
@@ -17,28 +19,19 @@ Upload the resulting `lambda_function.zip` using the Lambda console.
## Test Event
CloudFront event:
```json
{
"Records": [
{
"cf": {
"request": {
"uri": "/my-tileset-name/0/0/0.pbf",
"method": "GET",
"headers": {}
}
}
}
]
}
```
API Gateway V2 / Lambda Function URLs:
```json
{
"rawPath": "/my-tileset-name/0/0/0.pbf"
}
```
```
### Monitoring
### Lambda@Edge
Lambda@Edge's multi-region features have little benefit when fetching data from S3 in a single region, and Lambda@Edge [doesn't support](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/edge-functions-restrictions.html) environment variables or responses over 1 MB. For globally distributed caching, use CloudFront in combination with Lambda Function URLs.