aws-amplify / amplify-cli

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.
Apache License 2.0
2.82k stars 820 forks source link

Specify public layer arn once and use in all Lambda functions #6641

Open Nxtra opened 3 years ago

Nxtra commented 3 years ago

Which Category is your question related to? Function

Amplify CLI Version 4.43.0

Challenge I want to use a publicly available layer, like a layer to instrument my code for extra visibility (eg Lumigo, Thundra).
These have a specific layer ARN, for example: arn:aws:lambda:eu-west-1:xxxxxxxx:layer:layer-name:224.

I want to use this layer in all my lambda functions. How can I specify this layer once, and use it in all my lambda functions?

Current intermediate solutions:

Is there another way to provide this layerArn as a parameter to all stacks and not time and time again define it in every stack?

jhockett commented 3 years ago

Hi @Nxtra, while we do have the option to add a layer via ARN to a function with amplify update function, there's no way to do this for multiple functions with a single CLI command. Marking this as an enhancement.