hashicorp / terraform-provider-archive

Utility provider that provides a data source that can create zip archives for individual files or collections of files.
https://registry.terraform.io/providers/hashicorp/archive/latest/docs
Mozilla Public License 2.0
90 stars 62 forks source link

gzip support for archive_file #4

Open hashibot opened 7 years ago

hashibot commented 7 years ago

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


Feature request to implement gzip and base64 support for archive_file. Current issue is in conjunction with hashicorp/terraform#3407. Because now terraform provides data sources which seems to be right abstraction to perform such actions. Here is an example below.

data "archive_file" "foo" {
    type        = "gzip"
    source_file = "${path.module}/cloud-init.yaml"
    output_path = "${path.module}/files/cloud-init.gzip"
}

data "archive_file" "bar" {
    type        = "gzip|base64"
    source_file = "${path.module}/cloud-init.yaml"
    output_path = "${path.module}/files/cloud-init.base64"
}

We would also need a output_content as an attribute that would behave similar to source_content

If this feature request will be supported we can start working implementation.

joestump commented 6 years ago

I think by adding output_content you could crash a TF run if the contents of the archive was larger than the available RAM? Also, output_content would end up in your state file which I don't think is great.

That being said, 👍 to adding more archive types. Looks like adding them is pluggable.

kendru commented 1 year ago

Would a PR implementing a tar archive type (with optional gzip compression) be considered? If so, I am willing to contribute one.