Comments (5)
Hello, is anybody at least going to acknowledge this issue?
from terraform-provider-archive.
I stumbled across this problem and I think the ultimate answer is that it is doing what it is supposed to and this use case just isn't supported.
I'd come across this when I was trying to create a zip containing a binary executable for deployment to an AWS lambda layer. I needed the binary to be within a specific location in the zip (bin/my_binary
). As I understand it the only way to control the location within the resulting zip is to use the source
sub-block. However the source
sub-block requires source.contents
which it expects to be a string representing the literal contents of your file. As you discovered with your zip and I with my executable those bits don't string, so we b64 encode them because that's what terraform
points us towards, but that changes the actual contents of the file to the b64 encoding (not the raw bytes we needed).
My beautiful imagined world would have something like
data "archive_file" "output_archive" {
type = "zip"
output_path = "${path.module}/output.zip"
source {
// Dear TL;DRers, this isn't a real param, just a suggestion.
source_path = "${path.module}/my_raw_binary"
filename = "${data.archive_file.input_archive.output_path}"
}
}
So sadly I think the solution is to make the zip outside of terraform. 😞
from terraform-provider-archive.
we need content_base64 argument similar to the local_file resource here:
https://registry.terraform.io/providers/hashicorp/local/latest/docs/resources/file#content_base64
from terraform-provider-archive.
Its very simple and basic functionality and is still not implemented 😞
from terraform-provider-archive.
Related Issues (20)
- Migrate to terraform-plugin-framework HOT 1
- Run archive_file on each apply HOT 2
- data.archive_file does not support resource tainting HOT 2
- Bump Development/Build Minimum Go Version to 1.17 HOT 2
- Bump Expected Minimum Go Version to 1.18 HOT 1
- archive_file doesn't re-create the archive upon content change
- Source_dir conflicts with source HOT 1
- Zip file created by terraform archive_file cannot be properly read by python
- Generated archive contents include an extra (empty) file when `output_path` is configured within same directory as `source_dir`. HOT 2
- Migrate acceptance testing to terraform-plugin-testing HOT 1
- Bump Expected Minimum Go Version to 1.19 HOT 1
- GitHub Actions - deprecated warnings found - action required! HOT 2
- archive_file data source gets created during "terraform plan" vs "terraform apply" and also is not deleted during destroy HOT 11
- Error generated during the execution of acceptance test on archive_file resource
- Documentation and changelog require updating HOT 1
- Support Additional Compression Types(Ex: tar.gz format) HOT 4
- Update Go Module to Go 1.20 Minimum HOT 1
- archive_file produces a corrupted zip file HOT 5
- Error generating archive with archive_file when symlink is present and exclude_symlink_directories is set to true HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-provider-archive.