Skip to content

Commit 4747847

Browse files
author
Ryan Ragnell
committed
docs: Add example demonstrating patterns with poetry_install
Shows how to use patterns to exclude source files while keeping only poetry configuration files when using poetry_install.
1 parent 5343a88 commit 4747847

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

examples/build-package/main.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,15 @@ module "lambda_layer_poetry" {
471471
path = "${path.module}/../fixtures/python-app-poetry"
472472
poetry_install = true
473473
poetry_tmp_dir = "${path.cwd}/../fixtures"
474+
# Patterns work correctly with poetry_install - only poetry files are needed
475+
# The installed dependencies will be in the layer, but source files will be excluded
476+
patterns = [
477+
"!ignore_please.txt", # Exclude this file
478+
"!index.py", # Exclude source code
479+
"pyproject.toml", # Include poetry config
480+
"poetry.lock", # Include lock file
481+
"poetry.toml" # Include poetry settings
482+
]
474483
}
475484
]
476485
hash_extra = "extra-hash-to-prevent-conflicts-with-module.package_dir"

0 commit comments

Comments
 (0)