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.
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
However I want to use these encrypted crednetials in a terraform project e.g.
provider "google" {
credentials = file( "ENCRYPTED-CREDS")
project = var.project
region = "europe-west2"
}
My question is - how do I decrypt these credentials in terraform and/or use the encrypted credentials?