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
886 stars 656 forks source link

Ignoring some local directories on build #472

Closed benjamin9fin closed 1 year ago

benjamin9fin commented 1 year ago

Is your request related to a new offering from AWS?

No

Is your request related to a problem? Please describe.

Yes. It would be useful if the module offered a way to ignore some local directories (node_modules for example) when building a lambda.

Describe the solution you'd like.

The lambda module could have an ignore option and package.py could be instructed to ignore certain directories/files which aren't needed for the build (in a similar way to .dockerignore for example).

Describe alternatives you've considered.

Creating a separate build directory prior to running any terraform commands and copying only required files into it.

Additional context

adrianisk commented 1 year ago

You can use the patterns argument when specifying source paths to filter out files & directories

antonbabenko commented 1 year ago

@adrianisk Has just answered the question. Thank you!

I am closing this issue.

github-actions[bot] commented 11 months ago

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.