aws / aws/aws-sam-cli

Stop Sam Local from rebuilding layers on every invoke

Open
#3,725 17 comments 31 reactions 0 assignees View on GitHub
area/local/start-api maintainer/need-followup type/feature
Dominant language
Python
Stars
6.7k
Forks
1.2k
Avg merge
1d 10h
Merged PRs (30d)
52

Description

Currently it seems that `sam local start-api` will build any lambda layers on **every** request. This ends up creating a very slow dev experience.

Since `sam build` seems to be able to determine if a layer changes or not the local api behaviour not just assume the layer hasn't changed. If it does change `sam build` will rebuild it anyway?

it seems like passing the `--warm-containers=EAGER` as mentioned in this thread: https://github.com/Envek/aws-sam-typescript-layers-example/issues/11#issuecomment-1036057433 stops the layers from building each time but this isn't really a nice solution since a lot of times during testing I want to just test a single lambda I don't want to have to wait for all the lambda's to build layers again (each time I make a change to the code).

Is there another option I'm missing?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.