Skip to content
This repository has been archived by the owner on Jan 3, 2025. It is now read-only.

Commit

Permalink
Add missing variables for worker (#619)
Browse files Browse the repository at this point in the history
* add missing variables for worker

* add money-rails to lambda package
  • Loading branch information
FinnIckler authored Jul 17, 2024
1 parent b598e93 commit 0f5cbee
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions infra/lambda/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
24 changes: 24 additions & 0 deletions infra/worker/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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}"
},
]
}

Expand Down
15 changes: 15 additions & 0 deletions infra/worker/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -74,6 +86,9 @@ variable "shared_resources" {
api_gateway: object({
id: string,
root_resource_id: string
}),
aws_elasticache_cluster: object({
cache_nodes: any
})
})
}

0 comments on commit 0f5cbee

Please sign in to comment.