Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shelfio/chrome-aws-lambda-layer
58 MB Google Chrome to fit inside AWS Lambda Layer compressed with Brotli
https://github.com/shelfio/chrome-aws-lambda-layer
aws aws-lambda chromium lambda-layer
Last synced: 29 days ago
JSON representation
58 MB Google Chrome to fit inside AWS Lambda Layer compressed with Brotli
- Host: GitHub
- URL: https://github.com/shelfio/chrome-aws-lambda-layer
- Owner: shelfio
- License: mit
- Created: 2019-08-09T21:39:51.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-20T00:21:30.000Z (3 months ago)
- Last Synced: 2024-09-29T17:41:18.084Z (about 1 month ago)
- Topics: aws, aws-lambda, chromium, lambda-layer
- Homepage:
- Size: 254 MB
- Stars: 646
- Watchers: 36
- Forks: 46
- Open Issues: 9
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
- awesome-layers - `shelfio/chrome-aws-lambda-layer` - aws-lambda](https://api.globadge.com/v1/badgen/aws/lambda/layer/latest-version/us-east-1/764866452798/chrome-aws-lambda) | (Layers / Utilities)
README
# Google Chrome for AWS Lambda as a layer
> 58 MB Google Chrome to fit inside AWS Lambda Layer compressed with Brotli
[Sparticuz/chromium](https://github.com/Sparticuz/chromium) published as a Lambda Layer.
Tested with Node.js 16x/18x. Compatible with x86_64 only. Has Chromium v129.0.0
## Getting Started
Click on Layers and choose "Add a layer", and "Provide a layer version
ARN" and enter the following ARN.```
arn:aws:lambda:us-east-1:764866452798:layer:chrome-aws-lambda:48
```When importing the module within lambda, make sure you import `@sparticuz/chromium` not `chrome-aws-lambda`
```js
const chromium = require('@sparticuz/chromium');
```**package.json**
- `@sparticuz/chromium` marked as a dependency
- `puppeteer-core` marked as a dependency**lambda container settings**:
- x86_64 architecture
- > =1024mb memory
- `@sparticuz/chromium` marked as an externalModule in the bundling settings
- A lambda layer marked like so (this is CDK code, but convert to SAM or whatever at will):```ts
layers: [LayerVersion.fromLayerVersionArn(this, 'chromium-lambda-layer',
'arn:aws:lambda:us-east-1:764866452798:layer:chrome-aws-lambda:48'
)]
```**In the deployed lambda code**
You can just use a regular ES6 or CommonJS import statement for `@sparticuz/chrome-aws-lambda`, and just use as
indicated.## Available regions
* ap-northeast-1: `arn:aws:lambda:ap-northeast-1:764866452798:layer:chrome-aws-lambda:48`
* ap-northeast-2: `arn:aws:lambda:ap-northeast-2:764866452798:layer:chrome-aws-lambda:47`
* ap-south-1: `arn:aws:lambda:ap-south-1:764866452798:layer:chrome-aws-lambda:48`
* ap-southeast-1: `arn:aws:lambda:ap-southeast-1:764866452798:layer:chrome-aws-lambda:48`
* ap-southeast-2: `arn:aws:lambda:ap-southeast-2:764866452798:layer:chrome-aws-lambda:48`
* ca-central-1: `arn:aws:lambda:ca-central-1:764866452798:layer:chrome-aws-lambda:48`
* eu-north-1: `arn:aws:lambda:eu-north-1:764866452798:layer:chrome-aws-lambda:48`
* eu-central-1: `arn:aws:lambda:eu-central-1:764866452798:layer:chrome-aws-lambda:48`
* eu-west-1: `arn:aws:lambda:eu-west-1:764866452798:layer:chrome-aws-lambda:48`
* eu-west-2: `arn:aws:lambda:eu-west-2:764866452798:layer:chrome-aws-lambda:48`
* eu-west-3: `arn:aws:lambda:eu-west-3:764866452798:layer:chrome-aws-lambda:48`
* sa-east-1: `arn:aws:lambda:sa-east-1:764866452798:layer:chrome-aws-lambda:48`
* us-east-1: `arn:aws:lambda:us-east-1:764866452798:layer:chrome-aws-lambda:48`
* us-east-2: `arn:aws:lambda:us-east-2:764866452798:layer:chrome-aws-lambda:48`
* us-west-1: `arn:aws:lambda:us-west-1:764866452798:layer:chrome-aws-lambda:48`
* us-west-2: `arn:aws:lambda:us-west-2:764866452798:layer:chrome-aws-lambda:48`## License
MIT © [Shelf](https://shelf.io)