github.com/hugorut/terraform@v1.1.3/website/docs/language/functions/base64gzip.mdx (about) 1 --- 2 page_title: base64gzip - Functions - Configuration Language 3 description: |- 4 The base64encode function compresses the given string with gzip and then 5 encodes the result in Base64. 6 --- 7 8 # `base64gzip` Function 9 10 `base64gzip` compresses a string with gzip and then encodes the result in 11 Base64 encoding. 12 13 Terraform uses the "standard" Base64 alphabet as defined in 14 [RFC 4648 section 4](https://tools.ietf.org/html/rfc4648#section-4). 15 16 Strings in the Terraform language are sequences of unicode characters rather 17 than bytes, so this function will first encode the characters from the string 18 as UTF-8, then apply gzip compression, and then finally apply Base64 encoding. 19 20 While we do not recommend manipulating large, raw binary data in the Terraform 21 language, this function can be used to compress reasonably sized text strings 22 generated within the Terraform language. For example, the result of this 23 function can be used to create a compressed object in Amazon S3 as part of 24 an S3 website. 25 26 ## Related Functions 27 28 * [`base64encode`](/language/functions/base64encode) applies Base64 encoding _without_ 29 gzip compression. 30 * [`filebase64`](/language/functions/filebase64) reads a file from the local filesystem 31 and returns its raw bytes with Base64 encoding.