File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ Note that this example may create resources which cost money. Run `terraform des
3535| ------| --------| ---------|
3636| <a name =" module_lambda_function_from_package " ></a > [ lambda\_ function\_ from\_ package] ( #module\_ lambda\_ function\_ from\_ package ) | ../../ | |
3737| <a name =" module_lambda_layer " ></a > [ lambda\_ layer] ( #module\_ lambda\_ layer ) | ../../ | |
38+ | <a name =" module_lambda_layer_pip_requirements " ></a > [ lambda\_ layer\_ pip\_ requirements] ( #module\_ lambda\_ layer\_ pip\_ requirements ) | ../.. | |
3839| <a name =" module_package_dir " ></a > [ package\_ dir] ( #module\_ package\_ dir ) | ../../ | |
3940| <a name =" module_package_dir_without_pip_install " ></a > [ package\_ dir\_ without\_ pip\_ install] ( #module\_ package\_ dir\_ without\_ pip\_ install ) | ../../ | |
4041| <a name =" module_package_file " ></a > [ package\_ file] ( #module\_ package\_ file ) | ../../ | |
Original file line number Diff line number Diff line change @@ -247,3 +247,25 @@ module "lambda_function_from_package" {
247247 module . lambda_layer . lambda_layer_arn
248248 ]
249249}
250+
251+ # ###############################################
252+ # Layer that supports requirements.txt install #
253+ # ##############################################
254+ module "lambda_layer_pip_requirements" {
255+ source = " ../.."
256+
257+ create_function = false
258+ create_layer = true
259+
260+ layer_name = " ${ random_pet . this . id } -layer-pip-requirements"
261+ compatible_runtimes = [" python3.8" ]
262+ runtime = " python3.8" # required to force layers to do pip install
263+
264+ source_path = [
265+ {
266+ path = " ${ path . module } /../fixtures/python3.8-app1"
267+ pip_requirements = true
268+ prefix_in_zip = " python" # required to get the path correct
269+ }
270+ ]
271+ }
You can’t perform that action at this time.
0 commit comments