diff --git a/infra/lambda/Gemfile b/infra/lambda/Gemfile index 3360860f..b8a7d79a 100644 --- a/infra/lambda/Gemfile +++ b/infra/lambda/Gemfile @@ -7,5 +7,6 @@ ruby '3.2.2' gem 'dynamoid', '3.8.0' gem 'aws-sdk-dynamodb' gem 'aws-sdk-sqs' +gem 'money-rails' gem 'superconfig' gem 'zeitwerk' diff --git a/infra/worker/main.tf b/infra/worker/main.tf index c827a819..cdae3330 100644 --- a/infra/worker/main.tf +++ b/infra/worker/main.tf @@ -4,6 +4,10 @@ resource "aws_cloudwatch_log_group" "this" { locals { app_environment = [ + { + name = "HOST" + value = var.host + }, { name = "WCA_HOST" value = var.wca_host @@ -16,10 +20,26 @@ locals { name = "QUEUE_NAME", value = var.shared_resources.queue.name }, + { + name = "VAULT_ADDR" + value = var.vault_address + }, + { + name = "VAULT_APPLICATION", + value = "wca-registration-production" + }, + { + name = "REGISTRATION_LIVE_SITE", + value = "true" + }, { name = "PROMETHEUS_EXPORTER" value = var.prometheus_address }, + { + name = "TASK_ROLE" + value = aws_iam_role.task_role.name + }, { name = "DYNAMO_REGISTRATIONS_TABLE", value = var.shared_resources.dynamo_registration_table.name @@ -28,6 +48,10 @@ locals { name = "REGISTRATION_HISTORY_DYNAMO_TABLE", value = var.shared_resources.dynamo_registration_history_table.name }, + { + name = "REDIS_URL" + value = "redis://${var.shared_resources.aws_elasticache_cluster.cache_nodes.0.address}:${var.shared_resources.aws_elasticache_cluster.cache_nodes.0.port}" + }, ] } diff --git a/infra/worker/variables.tf b/infra/worker/variables.tf index c318a612..09680da8 100644 --- a/infra/worker/variables.tf +++ b/infra/worker/variables.tf @@ -10,6 +10,18 @@ variable "name_prefix" { default = "wca-registration-worker" } +variable "vault_address" { + type = string + description = "The Address that vault is running at" + default = "http://vault.worldcubeassociation.org:8200" +} + +variable "host" { + type = string + description = "The host for generating absolute URLs in the application" + default = "registration.worldcubeassociation.org" +} + variable "region" { type = string description = "The region to operate in" @@ -74,6 +86,9 @@ variable "shared_resources" { api_gateway: object({ id: string, root_resource_id: string + }), + aws_elasticache_cluster: object({ + cache_nodes: any }) }) }