-
-
Notifications
You must be signed in to change notification settings - Fork 726
Description
Description
Version 7.15 changed the behavior of the ":zip" command. In version 7.14, it zipped the path specified in the "path" attribute; In version 7.15 it zips the current working directory. This is a non-backward-compatible change.
The issue is caused by setting the _path variable to None in Version 7.15, while it previously contained the path attribute:
- https://github.com/terraform-aws-modules/terraform-aws-lambda/blob/v7.15.0/package.py#L780
- https://github.com/terraform-aws-modules/terraform-aws-lambda/blob/v7.14.0/package.py#L774
This was introduced by PR 640.
- β I have searched the open/closed issues and my issue is not listed.
Versions
-
Module version [Required]: 7.15.0
-
Terraform version:
Terraform v1.9.8 -
Provider version:
- provider registry.terraform.io/hashicorp/aws v5.77.0
- provider registry.terraform.io/hashicorp/external v2.3.4
- provider registry.terraform.io/hashicorp/local v2.5.2
- provider registry.terraform.io/hashicorp/null v3.2.3
- provider registry.terraform.io/hashicorp/random v3.6.3
Reproduction Code [Required]
Assume the following Lambda module source_path
configuration:
source_path = [
{
path = "${path.module}/application/src"
commands = [
":zip",
]
}
]
In version 7.14, this leads to a builds/plan.json file with this step:
[
"zip:embedded",
"application/src",
null
],
In version 7.15, this results in the following step:
[
"zip:embedded",
null,
null
],
Steps to reproduce the behavior: -
Expected behavior
The provided path
is respected and only that is zipped. This is also shown in the README.md:
path = "src/python-app3",
commands = [
"npm install",
":zip"
],
patterns = [
"!.*/.*\\.txt", # Skip all txt files recursively
"node_modules/.+", # Include all node_modules
],
Actual behavior
The current working directory is zipped. In combination with Terragrunt, it results in a 5GB large Zip file, which cannot be zipped in a reasonable time.