terraform-aws-modules / terraform-aws-lambda

Terraform module, which takes care of a lot of AWS Lambda/serverless tasks (build dependencies, packages, updates, deployments) in countless combinations 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/lambda/aws
Apache License 2.0
892 stars 662 forks source link

feat: Add support building layers in DockerInDocker scenario #352

Closed mwiede closed 1 year ago

mwiede commented 1 year ago

Description

We have Jenkins instances running with Docker-In-Docker and there are Pipelines using Docker images as agent. I was facing problems with the docker run commands inside of this package, because the volumes for temporary directories or the current workspace/build-root could not be mounted.

The error, which occured was: ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'

Motivation and Context

Give option to make building lambda layer in Docker work in Docker-In-Docker/Jenkins-Docker. To be able to do this, one need to pass the container-id of the parent container to any docker run command in the --volumes-from parameter. On Jenkins this is now possible by defining TF_VAR_docker_volume as environent variable.

Additionally, this PR is fixing #219 by pulling the build image if needed.

Breaking Changes

none.

How Has This Been Tested?

github-actions[bot] commented 1 year ago

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

mwiede commented 1 year ago

@antonbabenko what is needed for the PR to be considered?

antonbabenko commented 1 year ago

@mwiede I'm at AWS reinvent this and next week, so I can't take a look at this.

Usually, when there is a new feature added we need to update example code to show how to use this feature for real. Could you or someone else make necessary changes there? It would help a lot to speed things up.

github-actions[bot] commented 1 year ago

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

github-actions[bot] commented 1 year ago

This PR was automatically closed because of stale in 10 days

github-actions[bot] commented 1 year ago

I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.