• HashiCorp Developer

  • HashiCorp Cloud Platform
  • Terraform
  • Packer
  • Consul
  • Vault
  • Boundary
  • Nomad
  • Waypoint
  • Vagrant
Terraform
  • Install
  • Tutorials
    • About the Docs
    • Configuration Language
    • Terraform CLI
    • Terraform Cloud
    • Terraform Enterprise
    • CDK for Terraform
    • Provider Use
    • Plugin Development
    • Registry Publishing
    • Integration Program
  • Registry(opens in new tab)
  • Try Cloud(opens in new tab)
  • Sign up
Terraform Home

Configuration Language

Skip to main content
  • Configuration Language
  • Data Sources
    • Overview
      • base64decode
      • base64encode
      • base64gzip
      • csvdecode
      • jsondecode
      • jsonencode
      • textdecodebase64
      • textencodebase64
      • urlencode
      • yamldecode
      • yamlencode
  • Upgrading to Terraform v1.3
  • v1.x Compatibility Promises

  • Terraform Internals

  • Resources

  • Tutorial Library
  • Certifications
  • Community Forum
    (opens in new tab)
  • Support
    (opens in new tab)
  • GitHub
    (opens in new tab)
  • Terraform Registry
    (opens in new tab)
  1. Developer
  2. Terraform
  3. Configuration Language
  4. Functions
  5. textdecodebase64
  • Terraform
  • v1.2.x
  • v1.1 and earlier

ยปtextdecodebase64 Function

Note: This function is supported only in Terraform v0.14 and later.

textdecodebase64 function decodes a string that was previously Base64-encoded, and then interprets the result as characters in a specified character encoding.

Terraform uses the "standard" Base64 alphabet as defined in RFC 4648 section 4.

The encoding_name argument must contain one of the encoding names or aliases recorded in the IANA character encoding registry. Terraform supports only a subset of the registered encodings, and the encoding support may vary between Terraform versions.

Terraform accepts the encoding name UTF-8, which will produce the same result as base64decode.

Examples

> textdecodebase64("SABlAGwAbABvACAAVwBvAHIAbABkAA==", "UTF-16LE")
Hello World

Related Functions

  • textencodebase64 performs the opposite operation, applying target encoding and then Base64 to a string.
  • base64decode is effectively a shorthand for textdecodebase64 where the character encoding is fixed as UTF-8.
Edit this page on GitHub

On this page

  1. textdecodebase64 Function
  2. Examples
  3. Related Functions
Give Feedback(opens in new tab)
  • Certifications
  • System Status
  • Terms of Use
  • Security
  • Privacy
  • Trademark Policy
  • Trade Controls
  • Give Feedback(opens in new tab)