Skip to content

base64gzip_compat

unitstack

Usage

base64gzip_compat(str: string) --> string

base64gzip_compat gzips str and encodes the result in Base64, as base64gzip did in Terragrunt v1.1.3 and earlier. Since Terragrunt 1.2, base64gzip uses the gzip encoder of a newer Go release, which compresses differently. The value still decompresses to the same content, but a resource that compares the encoded value plans a replacement, e.g. an EC2 instance with user_data_base64 and user_data_replace_on_change = true.

Use base64gzip_compat where the encoded value must not change across Terragrunt upgrades:

terragrunt.hcl
inputs = {
user_data_base64 = base64gzip_compat(
file("${get_terragrunt_dir()}/user-data.sh"),
)
}

Parameters

strstring

The string to compress and encode.

Examples

terragrunt.hcl
inputs = {
user_data_base64 = base64gzip_compat(file("user-data.sh"))
}