update AWS Lambda README with API Gateway and content-type details.

This commit is contained in:
Brandon Liu
2022-11-21 17:02:45 +08:00
parent e86d9b7e04
commit 1da20f4f49

View File

@@ -2,6 +2,8 @@
Generates a Lambda function for deploying PMTiles on Lambda behind Lambda Function URLs or API Gateway. (CloudFront is recommended as a cache in front.) Generates a Lambda function for deploying PMTiles on Lambda behind Lambda Function URLs or API Gateway. (CloudFront is recommended as a cache in front.)
The `Content-Type` header of responses will be `application/vnd.mapbox-vector-tile` : this is one of the [CloudFront compressible types](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html#compressed-content-cloudfront-file-types).
## How To Use ## How To Use
Self-contained Lambda ZIP: Self-contained Lambda ZIP:
@@ -25,8 +27,6 @@ Configure these Lambda environment variables:
* Example path setting for objects in a directory: `my_folder/{name}/file.pmtiles` * Example path setting for objects in a directory: `my_folder/{name}/file.pmtiles`
* `TILE_PATH`: optional, define the URL route of the tiles API. Default `/{name}/{z}/{x}/{y}.pbf` * `TILE_PATH`: optional, define the URL route of the tiles API. Default `/{name}/{z}/{x}/{y}.pbf`
For API Gateway integration, your Lambda Proxy Integration route will need to specify a greedy capturing parameter called `proxy` e.g. `/{proxy+}` (the default). API Gateway responses will always be GZIP-encoded.
## Test Event ## Test Event
Lambda Function URLs: Lambda Function URLs:
@@ -54,3 +54,8 @@ TBD
### Lambda@Edge ### 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. 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.
### API Gateway
* your Lambda Proxy Integration route will need to specify a greedy capturing parameter called `proxy` e.g. `/{proxy+}` (the default).
* API Gateway responses will always be GZIP-encoded, to work around binary content detection problems.