From b1af8d59e52bea1da8056ae74e87e21398f9fd76 Mon Sep 17 00:00:00 2001 From: abidknashtech Date: Mon, 13 Nov 2023 17:00:29 +0530 Subject: [PATCH] correct GCP key --- deployment/gcpresources/terraform/main.tf | 2 +- .../gcpresources/terraform/my-sql-instance-variables.tf | 5 ----- inventory-service/gcp-deploy-service.yaml | 6 +++--- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/deployment/gcpresources/terraform/main.tf b/deployment/gcpresources/terraform/main.tf index 9b61ab21..f1ec1974 100644 --- a/deployment/gcpresources/terraform/main.tf +++ b/deployment/gcpresources/terraform/main.tf @@ -162,5 +162,5 @@ resource "google_secret_manager_secret" "car-demo-secret" { resource "google_secret_manager_secret_version" "car-demo-secret-1" { secret = google_secret_manager_secret.car-demo-secret.id - secret_data = "{\"mysql-db-username\": \"${var.user_name}\", \"mysql-db-userpassword\": \"${var.user_password}\", \"gcp_json_key\": \"${var.gcp_json_key}\"}" + secret_data = "{\"mysql-db-username\": \"${var.user_name}\", \"mysql-db-userpassword\": \"${var.user_password}\", \"gcp-json-key\": \"${file("key.json")}\"}" } diff --git a/deployment/gcpresources/terraform/my-sql-instance-variables.tf b/deployment/gcpresources/terraform/my-sql-instance-variables.tf index 996f8c29..2afff598 100644 --- a/deployment/gcpresources/terraform/my-sql-instance-variables.tf +++ b/deployment/gcpresources/terraform/my-sql-instance-variables.tf @@ -70,8 +70,3 @@ variable user_password { description = "The password for the default user. If not set, a random one will be generated and available in the generated_user_password output variable." default = "JavaDBs#password2023" } - -variable gcp_json_key { - description = "GCP Json key" - default = "{}" -} diff --git a/inventory-service/gcp-deploy-service.yaml b/inventory-service/gcp-deploy-service.yaml index 1d5abe04..a6313f5a 100644 --- a/inventory-service/gcp-deploy-service.yaml +++ b/inventory-service/gcp-deploy-service.yaml @@ -39,7 +39,7 @@ spec: valueFrom: secretKeyRef: name: secret-to-be-created - key: gcp_json_key + key: gcp-json-key optional: false envFrom: - configMapRef: @@ -99,11 +99,11 @@ spec: key: car-demo-secret version: latest property: mysql-db-userpassword - - secretKey: "gcp_json_key" + - secretKey: "gcp-json-key" remoteRef: key: car-demo-secret version: latest - property: gcp_json_key + property: gcp-json-key - secretKey: "MY_SQL_SECRETS" remoteRef: