My situation is:
I have a CloudFront distribution managed by CloudFormation that, amongst other things, needs to pass certain requests to an Edge Lambda.
I have a CodePipeline that builds new versions of my Lambda function based on repository commits.
I need to update the Lambda ARN in my CloudFront distribution whenever this lambda gets re-built to point to the new version.
So, I somehow need to reference the latest Lambda version in my CloudFormation template, and trigger CloudFormation to update my distribution whenever the CodePipeline builds a new version. Is it possible to do that passively? Do I have to write some new function to actively force a re-build? Is there another pattern for this I'm not aware of?
I managed to find the answer to my question. Basically, the scenario I describe is a known limitation of CloudFront + Edge Lambdas and there is currently no AWS solution.
Here is a link to the relevant issue discussion thread. There are a few references to third-party plugins to help deal with this problem.
https://github.com/serverless/serverless/issues/3944
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With