title: Decrypt gcp credentials in terraform?
body: <p>I have a google cloud/terraform project wherein I'm using terraform to send files to a google cloud storage bucket.  I have a json file of the service account credentials, that I've encrypted using cloud kms e.g.</p>
  <pre><code>gcloud kms encrypt \
      --key key \
      --keyring key-ring \
      --location location  \
      --plaintext-file file-with-data-to-encrypt \
      --ciphertext-file file-to-store-encrypted-data \
      | base64
  
  </code></pre>
  <p>However I want to use these encrypted crednetials in a terraform project e.g.</p>
  <pre><code>provider &quot;google&quot; {
  
    credentials = file( &quot;ENCRYPTED-CREDS&quot;)
  
    project = var.project
    region  = &quot;europe-west2&quot;
  }
  </code></pre>
  <p>My question is - how do I decrypt these credentials in terraform and/or use the encrypted credentials?</p>