Created
August 17, 2021 12:19
-
-
Save dgulli/2e37600107ebeceee6d24db35f59bd4e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#create a keyring | |
resource "google_kms_key_ring" "keyring" { | |
name = var.kmsKeyRingName | |
location = var.region | |
} | |
#create a key | |
resource "google_kms_crypto_key" "key" { | |
name = var.kmsKeyName | |
key_ring = google_kms_key_ring.keyring.id | |
purpose = var.kmsKeyPurpose | |
version_template { | |
algorithm = var.kmsKeyAlgo | |
protection_level = "HSM" | |
} | |
lifecycle { | |
prevent_destroy = false | |
} | |
} | |
#KMS Data block for CAS key version input | |
data "google_kms_crypto_key_version" "keyVersion" { | |
crypto_key = google_kms_crypto_key.key.id | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment