From 5717a3ff210f116506dd570f3fb1b9f3a7eb7c9e Mon Sep 17 00:00:00 2001 From: Max Kalashnikoff Date: Tue, 25 Jun 2024 13:30:00 +0200 Subject: [PATCH] feat: adding terraform variables --- .env.example | 6 ++++++ terraform/ecs/cluster.tf | 5 +++++ terraform/ecs/variables.tf | 23 +++++++++++++++++++++++ terraform/res_ecs.tf | 6 ++++++ terraform/variables.tf | 23 +++++++++++++++++++++++ 5 files changed, 63 insertions(+) diff --git a/.env.example b/.env.example index 46e11d004..2709858de 100644 --- a/.env.example +++ b/.env.example @@ -31,3 +31,9 @@ export RPC_PROXY_POSTGRES_URI="postgres://postgres@localhost/postgres" # export RPC_PROXY_RATE_LIMITING_MAX_TOKENS=100 # export RPC_PROXY_RATE_LIMITING_REFILL_INTERVAL_SEC=1 # export RPC_PROXY_RATE_LIMITING_REFILL_RATE=2 + +# Uncomment for using the IRN client +# export RPC_PROXY_IRN_NODE=127.0.0.1:3011 +# export RPC_PROXY_IRN_KEY=base64_key +# export RPC_PROXY_IRN_NAMESPACE=namespace +# export RPC_PROXY_IRN_NAMESPACE_SECRET=namespace_secret diff --git a/terraform/ecs/cluster.tf b/terraform/ecs/cluster.tf index 087fab086..a2ca9da0f 100644 --- a/terraform/ecs/cluster.tf +++ b/terraform/ecs/cluster.tf @@ -116,6 +116,11 @@ resource "aws_ecs_task_definition" "app_task" { { name = "RPC_PROXY_POSTGRES_URI", value = var.postgres_url }, + { name = "RPC_PROXY_IRN_NODE", value = var.irn_node}, + { name = "RPC_PROXY_IRN_KEY", value = var.irn_key}, + { name = "RPC_PROXY_IRN_NAMESPACE", value = var.irn_namespace}, + { name = "RPC_PROXY_IRN_NAMESPACE_SECRET", value = var.irn_namespace_secret}, + { name = "RPC_PROXY_ANALYTICS_EXPORT_BUCKET", value = var.analytics_datalake_bucket_name }, ], diff --git a/terraform/ecs/variables.tf b/terraform/ecs/variables.tf index 0b8dfdb1f..f6a37ee09 100644 --- a/terraform/ecs/variables.tf +++ b/terraform/ecs/variables.tf @@ -333,3 +333,26 @@ variable "rate_limiting_refill_rate" { description = "The number of tokens to refill the bucket with" type = number } + +#------------------------------------------------------------------------------- +# IRN client configuration + +variable "irn_node" { + description = "IRN node address in Address:Socket format" + type = string +} + +variable "irn_key" { + description = "IRN client key in base64 format" + type = string +} + +variable "irn_namespace" { + description = "IRN storage namespace" + type = string +} + +variable "irn_namespace_secret" { + description = "IRN storage namespace secret key" + type = string +} diff --git a/terraform/res_ecs.tf b/terraform/res_ecs.tf index fd02331ac..e48d1fcd8 100644 --- a/terraform/res_ecs.tf +++ b/terraform/res_ecs.tf @@ -82,6 +82,12 @@ module "ecs" { rate_limiting_refill_interval = var.rate_limiting_refill_interval rate_limiting_refill_rate = var.rate_limiting_refill_rate + # IRN Client + irn_node = var.irn_node + irn_key = var.irn_key + irn_namespace = var.irn_namespace + irn_namespace_secret = var.irn_namespace_secret + # Analytics analytics_datalake_bucket_name = data.terraform_remote_state.datalake.outputs.datalake_bucket_id analytics_datalake_kms_key_arn = data.terraform_remote_state.datalake.outputs.datalake_kms_key_arn diff --git a/terraform/variables.tf b/terraform/variables.tf index 637a20b5e..9736f5bb8 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -206,3 +206,26 @@ variable "irn_aws_account_id" { description = "ID of the AWS account in IRN is being deployed" type = string } + +#------------------------------------------------------------------------------- +# IRN client configuration + +variable "irn_node" { + description = "IRN node address in Address:Socket format" + type = string +} + +variable "irn_key" { + description = "IRN client key in base64 format" + type = string +} + +variable "irn_namespace" { + description = "IRN storage namespace" + type = string +} + +variable "irn_namespace_secret" { + description = "IRN storage namespace secret key" + type = string +}