We have a server-less stack that relies on multiple AWS Lambdas to perform tasks. To help make code re-usable we have multiple Lambda Layers shared across the Lambdas.
Our issue is, when we make a change to a layer, it creates a new version of the layer. All Lambdas that use this layer do not automatically use the latest version. They are however smart enough to detect that there is a new version and no longer run (throwing an exception that it needs to use the latest layer)
For 50+ Lambdas, The AWS portal has a terrible flow for updating layers. One-by-one, manually open every Lambda, remove the layer, add the new layer etc.
Is there a way to update all Lambdas to use the latest version of all necessary layers using the CLI or some other automated method?