title: Kubernetes secret generated
body: <p>I want to put the following yaml as kubernetes secret with terraform:</p>
  <pre><code>type: GCS
  config:
    bucket: bucket-name
    service_account: |-
      {
        &quot;type&quot;: &quot;service_account&quot;,
        &quot;project_id&quot;: &quot;project-id-34657345&quot;,
        &quot;private_key_id&quot;: &quot;fdsaf7sdfa90f87sd9f80&quot;,
        &quot;private_key&quot;: &quot;-----BEGIN PRIVATE KEY-----\nñlfjdlñkasjfasdñklfjsdklñaf\n-----END PRIVATE KEY-----\n&quot;,
        &quot;client_email&quot;: &quot;metrics@project-id-34657345.iam.gserviceaccount.com&quot;,
        &quot;client_id&quot;: &quot;6745876867&quot;,
        &quot;auth_uri&quot;: &quot;https://accounts.google.com/o/oauth2/auth&quot;,
        &quot;token_uri&quot;: &quot;https://oauth2.googleapis.com/token&quot;,
        &quot;auth_provider_x509_cert_url&quot;: &quot;https://www.googleapis.com/oauth2/v1/certs&quot;,
        &quot;client_x509_cert_url&quot;: &quot;https://www.googleapis.com/robot/v1/metadata/x509/metrics%40project-id-34657345.iam.gserviceaccount.com&quot;
      }
  </code></pre>
  <p>But my code is generating the below yaml:</p>
  <pre><code>
  &quot;config&quot;: |
    &quot;bucket&quot;: &quot;bucket-name&quot;
    &quot;service_account&quot;: |
      {
        &quot;type&quot;: &quot;service_account&quot;,
        &quot;project_id&quot;: &quot;project-id-34657345&quot;,
        &quot;private_key_id&quot;: &quot;fdsaf7sdfa90f87sd9f80&quot;,
        &quot;private_key&quot;: &quot;-----BEGIN PRIVATE KEY-----\nñlfjdlñkasjfasdñklfjsdklñaf\n-----END PRIVATE KEY-----\n&quot;,
        &quot;client_email&quot;: &quot;metrics@project-id-34657345.iam.gserviceaccount.com&quot;,
        &quot;client_id&quot;: &quot;6745876867&quot;,
        &quot;auth_uri&quot;: &quot;https://accounts.google.com/o/oauth2/auth&quot;,
        &quot;token_uri&quot;: &quot;https://oauth2.googleapis.com/token&quot;,
        &quot;auth_provider_x509_cert_url&quot;: &quot;https://www.googleapis.com/oauth2/v1/certs&quot;,
        &quot;client_x509_cert_url&quot;: &quot;https://www.googleapis.com/robot/v1/metadata/x509/metrics%40project-id-34657345.iam.gserviceaccount.com&quot;
      }
  &quot;type&quot;: &quot;GCS&quot;
  
  </code></pre>
  <p>My terraform code:</p>
  <pre><code>locals {
    service_account_value = base64decode(var.json_key)
  
    thanos_config = yamlencode(
      {
        type = &quot;GCS&quot;
        config = yamlencode(
          {
            bucket          = var.bucket_name
            service_account = local.service_account_value
          }
        )
      }
    )
  }
  
  resource &quot;kubernetes_secret&quot; &quot;secret&quot; {
    metadata {
      name = var.secret_name
      namespace = var.namespace
    }
    data = {
      thanos-config = local.thanos_config
    }
  }
  </code></pre>
  <p>The generated secret with terraform doesn't work, If I create the secret manually with the first yaml everything is fine...
  Any idea? What I'm missing?</p>