Description
Hi guys,
First of all, thank you for the work done with this. It's unfortunate that serverless doesn't handle this automatically and this library is really helpful.
When my serverless.yml
only contained 1 lambda@edge (eventType: origin-request) everything went smoothly.
However when I added a second function (eventType: viewer-request) CloudFormation started returning 412 (precondition failed).
Initially I thought I had something wrong with my function and I did several attempts including making the changes manually... All of them worked.
Then I tried switching the order of the functions (moving the Viewer-Request one to be created first). Still got a 412, but on the second one (which was now the Origin-Request one).
With that said, it seems that the solution would be to add a delay, a retry, or a wait until updateDistribution is done and changes are made so that you can run the second updateDistribution.
Otherwise this becomes a limitation for updating a CF Distribution.
Let me know if you need more info, or what am I missing :)
Thank you for your time! 👍 Keep up the good work and stay safe!