Skip to content

Lambda 7.15.0 changes the behavior of ":zip" command: CWD instead of path is zippedΒ #644

@uncatchable-de

Description

@uncatchable-de

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:

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.

Terminal Output Screenshot(s)

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions