Terraform base64decode function is including <<-EOT EOT in the outputs

I have used data sources for OCI provider where i am trying to read content of a resource, the content is in base64 encoded format, so i have used base64decode function to decode it

data "oci_secrets_secretbundle" "bundle" {
  secret_id = var.secret_ocid

locals {
secret_content = base64decode(data.oci_secrets_secretbundle.bundle.secret_bundle_content.0.content)

output "secret_content" {
    value = local.secret_content

Actual Output:


Expected: Base64DecodedValuehere

I need to make use of this output to create other resources

No, the base64decode function is not including <<-EOT EOT in the output - that’s just how Terraform delimits a multi-line string, when printing it in such a way that it would be valid to copy/paste back into a .tf file if desired.

By the way, you can test this yourself by creating a dummy output:

output "string_with_newlines" {
  value = "foo\nbar\nbaz\n"

@maxb i attaching screenshot of output

That screenshot agrees with what I said

Are you using it in another Terraform module or an external script/program? If the latter, you may need to use
terraform output -raw <output>

Nope lets say i am creating an autonomous database in Oracle Cloud, i need to provide the admin password, so i am converting the password to base64 format, same will be given to autonomous database code

You can use chomp or trimspace

thanks i have used chomp, it s working