Which Category is your question related to?
Documentation "Update layer content"
https://docs.amplify.aws/cli/function/layers#update-layer-content
Amplify CLI Version
4.32.0
What AWS Services are you utilizing?
AWS Lambda
AWS Lambda Layers
Provide additional details e.g. code snippets
In the lambda layer documentation, it says,
If there are changes available, the Amplify CLI will create a new layer version with the changes and ask during amplify push if you鈥檇 like to update all dependent functions to use the latest version.
while amplify cli does not ask anything about updating all dependent functions when I update and push changes in lambda layer.
Am I doing something wrong, or is this statement wrong?
Here is what cli prompts when I update lambda layer and run amplify push.
? Are you sure you want to continue? Yes
Content changes in Lambda layer [Lambda Layer Name] detected. Layer version increased to 4
Note: You need to run "amplify update function" to configure your functions with the latest layer version.
? What permissions do you want to grant to this new layer version? Previous version permissions
Hi @j-yamamoto
Content changes in Lambda layer [Lambda Layer Name] detected. Layer version increased to 4
The above quoted statement means , if you change anything in the lambda layer files locally in your project , amplify-cli automatically tracks your changes as you can see in the prompt you have mentioned above and will increase the layer version by 1 because lambda layer versions are immutable when deployed, any changes made to the layer after that will result in a new lambda layer version.
Note: You need to run "amplify update function" to configure your functions with the latest layer version.
The next prompt is to update you on the functions as you might some functions dependent on previous layer versions but as you have updated the lambda layer version , you may need to point the function to the latest version of lambda layer. CLI here prompts to do an amplify update function to point your function to this new layer when you have pushed the layer.
Hi @j-yamamoto
Sorry for the confusion. I misunderstood the above quoted lambda layer documentation. I am marking this as bug for documentation. Thanks for reporting it.
@akshbhu Thank you for working on this issue. Although the statement below was wrong, do you guys have any plan on implementing this feature?
If there are changes available, the Amplify CLI will create a new layer version with the changes and ask during amplify push if you鈥檇 like to update all dependent functions to use the latest version.
Since I use Amplify Console CI/CD feature, I would like amplify cli to update and push all functions depended on the lambda layer at the same time when the lambda layer gets updated and pushed.
Otherwise, I need to deploy twice. First deploy for the lambda layer update and second deploy for all functions depended on the lambda layer.
Most helpful comment
@akshbhu Thank you for working on this issue. Although the statement below was wrong, do you guys have any plan on implementing this feature?
Since I use Amplify Console CI/CD feature, I would like amplify cli to update and push all functions depended on the lambda layer at the same time when the lambda layer gets updated and pushed.
Otherwise, I need to deploy twice. First deploy for the lambda layer update and second deploy for all functions depended on the lambda layer.