chrome-aws-lambda | Chromium Binary for AWS Lambda and Google Cloud Functions | Cloud Functions library
kandi X-RAY | chrome-aws-lambda Summary
kandi X-RAY | chrome-aws-lambda Summary
Chromium Binary for AWS Lambda and Google Cloud Functions
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of chrome-aws-lambda
chrome-aws-lambda Key Features
chrome-aws-lambda Examples and Code Snippets
Community Discussions
Trending Discussions on chrome-aws-lambda
QUESTION
I have this iamRoleStatements on my serverless.yml, which should allow those actions to my lambda functions:
...ANSWER
Answered 2021-Nov-06 at 20:41Unless you've edited/redacted TABLE_NAME
in the error message, my guess is that you're inadvertently attempting to write to a table which probably doesn't exist (TABLE_NAME
).
You haven't posted your handler code, but I'd check your code and verify that your actual table name is being set/interpolated correctly before your handler code attempts to insert an item with the DynamoDB API.
QUESTION
I'm running headless chrome in a lambda layer (https://github.com/alixaxel/chrome-aws-lambda).
Issue is, I am trying to call .toLocaleString("en-AU"), but everything comes out as UTC/GMT regardless. I have read that node didn't always ship with internationalization options. I'm assuming something along those lines is what is going on here.
Any suggestions for how to work around this?
...ANSWER
Answered 2021-Jul-07 at 02:16You can use moment.js
for better control over time and time formats in NodeJS Lambda
QUESTION
I'm trying to create this lambda function in AWS using Amplify however when I try to launch the chromium the lambda function does not return any value and the function end up timing up:
"errorMessage": "2020-12-09T02:56:56.210Z 57402f8e-9fb2-4341-837d-bdf2ee6e9262 Task timed out after 25.57 seconds"
I add the Layer as suggested by @James Shapiro, now I'm getting a URL return for the chromium but it still not launching it:
This is my function:
...ANSWER
Answered 2020-Dec-09 at 04:10Have you tried installing a chrome-aws-lambda
layer and then adding it to your function? See the instructions here in the "AWS Lambda Layer" section.
QUESTION
I am currently using the following Puppeteer AWS Lambda Layer to scrape 30 URLs and create and save screenshots in S3. At the moment, I send 30 individual payloads therefore running 30 AWS Lambda functions. https://github.com/shelfio/chrome-aws-lambda-layer
Each JSON payload contains a URL and an image file name that are sent every 2-3 seconds to API Gateway via a POST request. The first 6 or 9 Lambda functions in the list seem to run fine, then they start to fail with Navigation failed because browser has disconnected!
as reported in AWS Cloudwatch.
So I am looking for an alternative solution, How could I edit the code below to batch screenshot a set of 30 URLs, by handling a single array of JSON payloads? (eg. For loop etc)
Here is my current code for generating individual AWS Lambda screenshots and sending to S3:
...ANSWER
Answered 2020-Aug-23 at 03:42I tried to replicate the issue and modify the code to use loop.
While working on this issue, I found several things worth pointing out:
- the lambda requires a lot of RAM (at least 1GB in my test, but more better). Using small amount of RAM lead to failures.
- lambda timeout must be large to handle a number of URLs to screenshot.
- your
img
from the JSON payload is not used at all. I did not modify this behavior, as I don't know if this is by design or not. - similar errors to yours were observed when running async for loop and/or not closing pages opened.
- modified return value to output an array of s3 urls.
- undefied URL
Here is the modified code that worked in my tests using nodejs12.x
runtime:
QUESTION
I am currently working on an AWS Lambda that generates a PDF from HTML. The lambda is working perfectly once deployed however I would like to get it to run locally to make development easier.
I have installed SAM from AWS as well as Docker which AWS says will be needed to run a lambda locally.
In my solution folder in the command line I am running sam local invoke "HelloWorldFunction" -e pdf/test-data/test.json
which then appears to work as it says that it is fetching it and then mounting it to the local docker container. However it then gives the following error:
Which appears to be an error about the puppeteer executable for chrome not existing even though it is in there. I am using the following variables:
...ANSWER
Answered 2020-Jun-12 at 08:46It looks like I had to use the path provided by chrome-aws-lambda
. So the code to generate the browser looks like this and it works:
QUESTION
I'm getting started with nodejs and the serverless framwork.
My handler.js contains:
...ANSWER
Answered 2020-Jun-05 at 18:41Let me explain here. Serverless framework can invoke(run) lambda in two ways(locally and in cloud-AWS). It seems you are trying to invoke lambda in AWS. (arn:aws:lambda:us-east-1:155754363046:function:sellthelandnow-dev-hello) Basically this arn does not exist in your AWS-155754363046 account. you need to use
QUESTION
I'm getting started trying to write a lambda function with node and puppeteer. I'm using the serverless framework
I've been trying to follow https://codissimo.sinumo.tech/2019/12/27/serverless-puppeteer-with-aws-lambda-layers-and-node-js/ to utilize the provisioned chrome at https://github.com/shelfio/chrome-aws-lambda-layer . My function is working as expected locally.
my handler.js contains:
...ANSWER
Answered 2020-May-31 at 20:35These are accessible in CloudWatch logs.
If you access in the region you execute the Lambda in it should have a log group of /aws/lambda/functionname.
Then a stream of the save revision
QUESTION
I'm getting started trying to write a lambda function with node and puppeteer. I'm using the serverless framework
I've been trying to follow https://codissimo.sinumo.tech/2019/12/27/serverless-puppeteer-with-aws-lambda-layers-and-node-js/ to utilize the provisioned chrome at https://github.com/shelfio/chrome-aws-lambda-layer . My function is working as expected locally.
My Yaml file contains:
...ANSWER
Answered 2020-May-29 at 22:20There is a space in your layer ARN.
Your config in YAML:
QUESTION
I have created a simple application that accepts a URL and converts it to a PDF. It stores the resultant PDF in an S3 bucket and returns the URL of the PDF. It uses Chrome (running headless) to convert the URL to a PDF. I used the serverless framework, AWS Lambda, and the chrome-aws-lambda npm package. When I execute this setup locally using serverless it all works great. I can use postman to make a request with a URL and it returns the URL of the resultant PDF. When I deploy this setup to AWS Lambda, it returns a 502 internal server error response. When I look at the AWS logs for my application I see the following:
...ANSWER
Answered 2020-Feb-07 at 01:36serverless-bundle
only includes the JS code that you use in your handler and strips everything else to minimize your bundle. That means the chrome binaries are excluded.
To include those binaries, add the following to your serverless.yml
:
QUESTION
So a little background to the task, I'm trying to run the chrome-aws-lambda on aws lambda.
As you can see on the GitHub, it follows async/await syntax. My problem is, I want to be able to read a value from dynamodb in the middle of the execution of chrome-AWS-lambda.
I know how to read the value from dynamodb in normal function, I know how to use chrome-AWS-lambda. I just can't get these 2 to work together.
Should I be using some special function to read the data from dynamodb? currently, I am using DocumentClient.get()
Any help would be very appreciated.
...ANSWER
Answered 2020-Jan-16 at 17:42you can force the return to be a promise, and thus it will satisfy async/await requirements:
DocumentClient.get().promise()
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install chrome-aws-lambda
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page