secure_secrets

airasia/secure_secrets/google

Terraform Module HCL GOOGLE

Terraform module for decrypting secrets (that were encrypted with KMS Keys) in GCP. Can optionally store the encrypted secrets into Secret Manager as well.

Install
module "secure_secrets" {
source = "airasia/secure_secrets/google"
version = "3.0.0"
}
plain text: /constructs/tfmod-airasia-secure-secrets-google/install.txt
⭐ Source on GitHub 📦 Registry page
README

Terraform module for decrypting secrets (that were encrypted with KMS Keys) in GCP. Can optionally store the encrypted secrets into Secret Manager as well. Generating ciphertext from plaintext using KMS symmetric encryption You can use the gcloud kms encrypt tool in your terminal, to create a ciphertext from a plaintext. ``bash echo -n "my-plaintext-secret" \ | gcloud kms encrypt \ --project "my-gcp-project-id" \ --location "asia-southeast1" \ --keyring "my-kms-key-ring" \ --key "my-kms-key" \ --plaintext-file - \ --ciphertext-file - \ | base64 ` It outputs a base64 encoded ciphertext: ` CiQAosletmGOhvZDifaX4JxkBGSwm1/5mIPtMGPhEE8xGkpii4cSLnCNaYhPP2qjEQetFwc6XMWluCsgp/6kJGBPRdT8UNu6UyhVHWguZqJ/yiUIeQ== ` Revealing plaintext from ciphertext using KMS symmetric decryption You can use the gcl

Inputs (5)
NameTypeDescriptionDefault
name_suffixstringAn arbitrary suffix that will be added to the end of the resource name(s). For e required
kms_keystringA KMS Key (self-link) that will be used for decrypting the secrets. required
secretsmap(string)Mapping of secret_names (as keys) and secret_ciphertexts (as values). Generate t required
copy_to_smboolWhether to copy the secret_ciphertexts (from var.secrets) into GCP Secret Managefalse
encryptboolWhether to keep the encrypted secret while adding to secret manager or save it afalse
Outputs (1)
decrypted_secrets — A map of secret_names (as keys) and secret_plaintexts (as values).
Resources (3)
google_project_servicegoogle_secret_manager_secretgoogle_secret_manager_secret_version
Details
FrameworkTerraform Module
LanguageHCL
Version3.0.0
Cloud GOOGLE
★ Stars2
Forks3
Total downloads31.1k
Inputs5
Outputs1
Resources3
LicenseGPL-3.0
Namespaceairasia
Updated