aws-samples / image-optimization

Simple, performant and cost efficient solution for optimizing images using Amazon CloudFront, Amazon S3 and AWS Lambda
MIT No Attribution
172 stars 106 forks source link

Use CDK Intrinsic Functions to Retrieve URL at Deploy Time #24

Closed probably-not closed 6 months ago

probably-not commented 6 months ago

Description of changes:

The current iteration of this stack utilizes a Custom Resource in order to extract the domain name of the image-optimization Lambda's function URL. This implementation is pretty complex and is very difficult to port over to other CDK languages or implementations.

I've removed this implementation and replaced it with utilizing CDK Intrinsic Functions that allow us to parse out the domain name of the URL at deploy time. This makes the implementation a lot simpler and removes the need to port a Custom Resource over to other languages.

achrafsouk commented 6 months ago

Thank you a lot for simplifying the code. I will also delete the customer resource function, and clean the comments.