Skip to content

Commit

Permalink
Updated resource name to use underscores.
Browse files Browse the repository at this point in the history
  • Loading branch information
dpappa committed May 9, 2024
1 parent 1d6c853 commit 812a1a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ resource "google_kms_key_ring" "keyring" {
location = var.region
}

resource "google_kms_crypto_key" "gke-encryption-key" {
resource "google_kms_crypto_key" "gke_encryption_key" {
count = var.enable_database_encryption && var.database_encryption_key_name == "" ? 1 : 0 # Only create if the feature is enabled and the customer didn't provide a key
name = "streamnative-gke-encryption-key"
key_ring = google_kms_key_ring.keyring[0].id
Expand Down Expand Up @@ -124,7 +124,7 @@ locals {
}

#Ensure database_encryption_key_name is of the format <KEYRING_NAME>/cryptoKeys/<KEY_NAME>
database_encryption = var.enable_database_encryption ? (var.database_encryption_key_name != "" ? [{"key_name": "projects/${var.project_id}/locations/${var.region}/keyRings/${var.database_encryption_key_name}", "state": "ENCRYPTED"}] : [{"key_name": google_kms_crypto_key.gke-encryption-key[0].id, "state": "ENCRYPTED"}]) : [{"key_name": "", "state": "DECRYPTED"}]
database_encryption = var.enable_database_encryption ? (var.database_encryption_key_name != "" ? [{"key_name": "projects/${var.project_id}/locations/${var.region}/keyRings/${var.database_encryption_key_name}", "state": "ENCRYPTED"}] : [{"key_name": google_kms_crypto_key.gke_encryption_key[0].id, "state": "ENCRYPTED"}]) : [{"key_name": "", "state": "DECRYPTED"}]
}

module "gke" {
Expand Down

0 comments on commit 812a1a7

Please sign in to comment.