diff --git a/terraform/main.tf b/terraform/main.tf index b63ef78..31731ff 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -66,7 +66,7 @@ resource "google_project_iam_member" "app-role-binding" { // HSM-KMS setup for signers resource "google_kms_key_ring" "gasolina_key_ring" { - name = "gasolinaKeyRing" + name = var.kms_key_ring location = "global" depends_on = [module.enabled_google_apis.project_id] @@ -179,7 +179,7 @@ resource "google_cloud_run_service" "gasolina_api" { } env { name = "GCP_KEY_RING_ID" - value = "gasolinaKeyRing" + value = var.kms_key_ring } env { name = "LAYERZERO_SUPPORTED_ULN_VERSIONS" @@ -235,4 +235,4 @@ resource "google_cloud_run_service_iam_policy" "noauth" { module.enabled_google_apis.project_id, google_cloud_run_service.gasolina_api ] -} \ No newline at end of file +} diff --git a/terraform/variables.tf b/terraform/variables.tf index 69f00f7..ef0a8c9 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -55,4 +55,10 @@ variable "num_signers" { variable "available_chain_names" { type = string description = "Comma separated list of chain names that gasolina will support e.g. ethereum,bsc,avalanche,polygon" -} \ No newline at end of file +} + +variable "kms_key_ring" { + type = string + description = "The name of the key ring to create in KMS" +} +