terraform-provider-archive icon indicating copy to clipboard operation
terraform-provider-archive copied to clipboard

gzip support for archive_file

Open hashibot opened this issue 8 years ago • 2 comments
trafficstars

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.

hashibot avatar Jun 13 '17 20:06 hashibot

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.

joestump avatar Jul 18 '18 23:07 joestump

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

kendru avatar Jan 09 '23 20:01 kendru