terraform-aws-cloudfront-s3-cdn icon indicating copy to clipboard operation
terraform-aws-cloudfront-s3-cdn copied to clipboard

Lambda@Edge with pre-provided zips

Open syphernl opened this issue 3 years ago • 2 comments

Describe the Feature

If would be nice if the Lambda@Edge code could be provided as a zip rather than a piece of plain-text code.

Use Case

Some Lambda@Edge functions might require more files to run (e.g. node_modules). If a zip could be provided, this would make it possible to run such scripts as well.

Describe Ideal Solution

Add two new variables:

  • create_package - boolean, defaults to true
  • local_existing_package - Path to the existing package to upload

syphernl avatar Jan 05 '22 12:01 syphernl

@syphernl thanks for the feature request!

Yes, I think that is a good idea. As the person who implemented the lambda@edge submodule I can say that this was the original idea, but plain text code was faster so I implemented that as an first iteration.

I will take a look!

korenyoni avatar Jan 05 '22 13:01 korenyoni

@korenyoni Not sure whether you are aware of it but I discovered that work has started on a terraform-aws-lambda-function module as well very recently. Perhaps this submodule contents can be moved to that module instead?

I read that you implemented it the way it is now because of the Lambda@Edge needs to live in us-east-1. But since it is possible to pass along providers to modules, it probably would make sense to consolidate the Lambda/Lambda@Edge code into a single module?

syphernl avatar Jan 05 '22 13:01 syphernl