alexcasalboni / aws-lambda-power-tuning

AWS Lambda Power Tuning is an open-source tool that can help you visualize and fine-tune the memory/power configuration of Lambda functions. It runs in your own AWS account - powered by AWS Step Functions - and it supports three optimization strategies: cost, speed, and balanced.
Apache License 2.0
5.29k stars 363 forks source link

Lambda layer usage #187

Closed macdrorepo closed 1 year ago

macdrorepo commented 1 year ago

Hello,

Is there a way to plug a custom lambda layer (which is acutally used by by lambda in "prod") to testing purposues with this tool? For now step functions are failing with error that lambda can't import missing libs from layer.

alexcasalboni commented 1 year ago

Hi @macdrorepo, thanks for asking :)

Yes, you should be able to run any Lambda function, with or without Layers.

Before running the Step Functions state machine, please make sure that your function runs properly (no syntax error, no missing libraries, no missing downstream dependencies, no other kind of bugs, etc.). Lambda Power Tuning assumes that your function can run successfully when invoked with the given payload.

If you see a "can't import missing libs from layer" error, it should have nothing to do with Lambda Power Tuning. So I'd recommend debugging your function code and configuration before power-tuning it. Are you 100% sure the same layer is already used in prod with the same function code and the same runtime?

macdrorepo commented 1 year ago

OK thanks, lambda is running fine, I thought it is missing parameter in Tuning tool. If not to be closed.