terraform-aws-modules/terraform-aws-lambda

Allow building from custom Docker image without any local Dockerfile

bouchardmathieu-qc opened this issue · 3 comments

Is your request related to a new offering from AWS?

No

Is your request related to a problem? Please describe.

We would like to use the Docker support in this module to be able to more easily manage the discrepancies between the supported Python version of AWS Lambda and the version installed by default in our build environment (CodeBuild). We have a secure environment where we need to use images from a private repository because network access is restricted. We have copied the official SAM Python build images in our repository, so we need to pass a custom image to the module.

Describe the solution you'd like.

A simple way to use a custom image from an outside source

Describe alternatives you've considered.

After a couple of tries with the module, it seems that this is not supported right now because the code for using custom images is based on a local Dockerfile that is used to construct a custom image when executing the Terraform code and we cannot only pass the name of an external image to use. We also cannot use a custom almost empty Dockerfile with the name of the image passed as an argument of the docker build command, because the custom docker options are only used when calling the docker run command to create the layers.

Additional context

Our AWS environment is based on https://github.com/aws-samples/aws-secure-environment-accelerator

This issue has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this issue will be closed in 10 days

This issue was automatically closed because of stale in 10 days

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.