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

Feature request - add feature to add file to pre-existing archive in Archive provider #2

Open
hashibot opened this issue Jun 13, 2017 · 4 comments

Comments

@hashibot
Copy link

This issue was originally opened by @ponyfleisch as hashicorp/terraform#9904. It was migrated here as part of the provider split. The original body of the issue is below.


I'm using AWS Lambda with node, so i package all the dependencies in a zip file. I need to use the template rendering on the main file to set some configurable parameters. If i want to use the Archive provider to create a zip file with the main file and the node_modules directory, i need to keep the node_modules directory unzipped in my module repository.

It would be much better to keep the dependencies around as zip and then use the Archive provider to add the source file to it (creating a new output zip file in the process).

@simonweil
Copy link

Any chance to get this implemented?

@ponyfleisch
Copy link

@simonweil my implementation of it was never merged, but it’s here: https://github.com/hashicorp/terraform/pull/9924/commits

@AbelHristodor
Copy link

This could be really useful

@air3ijai
Copy link

air3ijai commented Jul 25, 2024

Existing implementation will just override existing archive

# Add lambda to package
data "archive_file" "append" {
  type        = "zip"
  source_file = "lambda.py"
  output_path = "package.zip"
}

It would be very useful to be able to store lambda code separate from the archived package and just append it like we can do using zip

zip package.zip lambda.py

adding: lambda.py (deflated 37%)

Now we have just two options?

  • Store all packages and lambda unpacked in the repository
  • Store all packages and lambda packed in a zip file

We can store package separate and use Lambda layers, but they are not supported in Lambda@Edge.

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

No branches or pull requests

5 participants