Giter Site home page Giter Site logo

Comments (5)

lineardraft avatar lineardraft commented on August 28, 2024

Hello, is anybody at least going to acknowledge this issue?

from terraform-provider-archive.

kjschiroo avatar kjschiroo commented on August 28, 2024

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.

emoshaya avatar emoshaya commented on August 28, 2024

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.

goshander avatar goshander commented on August 28, 2024

Its very simple and basic functionality and is still not implemented 😞

from terraform-provider-archive.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.