Running a Playwright script on AWS Lambda
steele.blue·116w
Preview
Report Post

I had a hell of a time getting a Playwright script to successfully run in an AWS Lambda. There’s a few guides on various ways to handle this, but none of them worked out of the box. For posterity, here’s what worked for me.

Use a Docker Container

The two primary ways I’ve seen Playwright and Puppeteer implemented are:

  1. Using the default Node runtime, with the Chromium browser installed as a separate layer. This is the approach taken by the chromium-lambda npm package.
  2. Using a Lambda Docker runtime, building off a Microsoft-provided base layer with Chromium pre-installed.

I was never able to make the Node runtime work, but did have success with the Docker runtime, so I’d recommend using that ar…

Similar Posts

Loading similar posts...