terraform-provider-archive
terraform-provider-archive copied to clipboard
gzip support for archive_file
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.
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.
Would a PR implementing a tar archive type (with optional gzip compression) be considered? If so, I am willing to contribute one.