Skip to content

Commit

Permalink
feat: adding terraform variables
Browse files Browse the repository at this point in the history
  • Loading branch information
geekbrother committed Jun 25, 2024
1 parent e20680e commit 5717a3f
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions terraform/ecs/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
],

Expand Down
23 changes: 23 additions & 0 deletions terraform/ecs/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
6 changes: 6 additions & 0 deletions terraform/res_ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 23 additions & 0 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 5717a3f

Please sign in to comment.