Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task done
uncatchable-de opened this issue Nov 25, 2024 · 1 comment · Fixed by #646
Closed
1 task done

Comments

@uncatchable-de
Copy link

uncatchable-de commented Nov 25, 2024

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

@antonbabenko
Copy link
Member

This issue has been resolved in version 7.16.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants