awslabs / aws-lambda-powershell-runtime

This new PowerShell custom runtime for AWS Lambda makes it even easier to run Lambda functions written in PowerShell to process events.
Apache License 2.0
57 stars 17 forks source link

PwshRuntimeLayer size has tipped over to 192Mb - causing Lambda Layer size issues #27

Open sdunnedeloitte opened 7 months ago

sdunnedeloitte commented 7 months ago

Hi there, When compiling the layers, i've started to get a lambda layer size issue when referencing the layers. i believe that this is caused to the PwshRuntimeLayer increasing in size to 192Mb. Once the AWS Tools and other modules are added, it's tipping the lambda to over 250Mb and so the CF stack is refusing to deploy due to the size limit. Is there any way that the layer size can be reduced and still operate? I can't reduce the AWS Tools layer down any further so stuck unable to deploy?

Many thanks, Sean.

julianwood commented 7 months ago

One solution is to use a container image for the custom runtime which can then be up to 10Gb. It would involve creating a Dockerfile which does the file copying. I'll see if I have a chance over the next 2 weeks to give it a go.

julianwood commented 6 months ago

There is a new demo example using a container image to build a function. You can amend as you need to: https://github.com/awslabs/aws-lambda-powershell-runtime/tree/main/examples/demo-container-image-all-aws-sdk