diff --git a/README.md b/README.md index 8a2d1d8b..b710be40 100644 --- a/README.md +++ b/README.md @@ -389,7 +389,10 @@ source_path = [ ] }, { path = "src/python3.8-app3", - commands = ["npm install"], + commands = [ + "npm install", + ":zip" + ], patterns = [ "!.*/.*\\.txt", # Skip all txt files recursively "node_modules/.+", # Include all node_modules @@ -424,6 +427,7 @@ Few notes: ``` * `commands` - List of commands to run. If specified, this argument overrides `pip_requirements`. + * `:zip [source] [destination]` is a special command which creates content of current working directory (first argument) and places it inside of path (second argument). * `pip_requirements` - Controls whether to execute `pip install`. Set to `false` to disable this feature, `true` to run `pip install` with `requirements.txt` found in `path`. Or set to another filename which you want to use instead. * `prefix_in_zip` - If specified, will be used as a prefix inside zip-archive. By default, everything installs into the root of zip-archive. diff --git a/examples/simple/main.tf b/examples/simple/main.tf index f6af0ca0..596e08eb 100644 --- a/examples/simple/main.tf +++ b/examples/simple/main.tf @@ -255,7 +255,10 @@ module "lambda_function" { # }, # { # path = "${path.module}/../fixtures/python3.8-app1" - # commands = ["npm install"] + # commands = [ + # "npm install", + # ":zip" + # ] # prefix_in_zip = "foo/bar", # patterns = [ # "!.*/.*\\.txt", # Filter all txt files recursively @@ -264,7 +267,10 @@ module "lambda_function" { # }, # { # path = "${path.module}/../fixtures/python3.8-app1" - # commands = ["npm install"] + # commands = [ + # "npm install", + # ":zip" + # ] # prefix_in_zip = "foo/bar", # By default everything installs into the root of a zip package # patterns = <