Skip to content

Rename variables for clarity, update default values #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions modules/ad-hoc/app/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ module "default_celery_worker" {
ecs_cluster_id = module.ecs.cluster_id
task_role_arn = module.iam.task_role_arn
execution_role_arn = module.iam.execution_role_arn
command = var.default_celery_worker_command
command = var.celery_worker_command
env_vars = concat(local.env_vars, var.extra_env_vars)
image = local.be_image
region = var.region
cpu = var.default_celery_worker_cpu
memory = var.default_celery_worker_memory
cpu = var.celery_worker_cpu
memory = var.celery_worker_memory
private_subnet_ids = var.private_subnet_ids
}

Expand Down
6 changes: 3 additions & 3 deletions modules/ad-hoc/app/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,19 @@ variable "celery_beat_memory" {

# default celery worker

variable "default_celery_worker_command" {
variable "celery_worker_command" {
description = "Command used to start celery worker"
default = ["celery", "--app=backend.celery_app:app", "worker", "--loglevel=INFO", "-Q", "default"]
type = list(string)
}

variable "default_celery_worker_cpu" {
variable "celery_worker_cpu" {
default = 1024
description = "CPU to allocate to container"
type = number
}

variable "default_celery_worker_memory" {
variable "celery_worker_memory" {
default = 2048
description = "Amount (in MiB) of memory used by the task"
type = number
Expand Down
18 changes: 9 additions & 9 deletions modules/prod/app/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ module "api" {
task_role_arn = var.task_role_arn
execution_role_arn = var.execution_role_arn
app_sg_id = var.app_sg_id
command = var.api_command
command = var.backend_command
env_vars = concat(local.env_vars, var.extra_env_vars)
image = local.be_image
region = var.region
cpu = var.api_cpu
memory = var.api_memory
cpu = var.backend_cpu
memory = var.backend_memory
port = 8000
path_patterns = ["/api/*", "/admin/*", "/graphql/*", "/mtv/*"]
health_check_path = "/api/health-check/"
Expand Down Expand Up @@ -107,8 +107,8 @@ module "web-ui" {
env_vars = []
image = local.fe_image
region = var.region
cpu = var.api_cpu
memory = var.api_memory
cpu = var.backend_cpu
memory = var.backend_memory
port = 80
path_patterns = ["/*"]
health_check_path = "/"
Expand All @@ -133,16 +133,16 @@ module "default_celery_worker" {
ecs_cluster_id = module.ecs.cluster_id
task_role_arn = var.task_role_arn
execution_role_arn = var.execution_role_arn
command = var.default_celery_worker_command
command = var.celery_worker_command
env_vars = concat(local.env_vars, var.extra_env_vars)
image = local.be_image
region = var.region
cpu = var.default_celery_worker_cpu
memory = var.default_celery_worker_memory
cpu = var.celery_worker_cpu
memory = var.celery_worker_memory
private_subnet_ids = var.private_subnet_ids
}

module "default_celery_worker_autoscaling" {
module "celery_worker_autoscaling" {
source = "../../internal/autoscaling"
cluster_name = "${terraform.workspace}-cluster"
service_name = "${terraform.workspace}-default"
Expand Down
54 changes: 27 additions & 27 deletions modules/prod/app/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -104,21 +104,21 @@ variable "django_settings_module" {

# api

variable "api_command" {
variable "backend_command" {
description = "Command used to start backend API container"
default = ["gunicorn", "-t", "1000", "-b", "0.0.0.0:8000", "--log-level", "info", "backend.wsgi"]
type = list(string)
}

variable "api_cpu" {
default = 1024
description = "CPU to allocate to container"
variable "backend_cpu" {
default = 256
description = "CPU to allocate for this task (256 = 0.25 vCPU)"
type = number
}

variable "api_memory" {
default = 2048
description = "Amount (in MiB) of memory used by the task"
variable "backend_memory" {
default = 512
description = "Amount (in MiB) of memory to allocate for this task"
type = number
}

Expand All @@ -131,14 +131,14 @@ variable "frontend_command" {
}

variable "frontend_cpu" {
default = 1024
description = "CPU to allocate to container for the frontend task"
default = 256
description = "CPU to allocate for this task (256 = 0.25 vCPU)"
type = number
}

variable "frontend_memory" {
default = 2048
description = "Amount (in MiB) of memory used by the frontend task"
default = 512
description = "Amount (in MiB) of memory to allocate for this task"
type = number
}

Expand All @@ -151,34 +151,34 @@ variable "celery_beat_command" {
}

variable "celery_beat_cpu" {
default = 1024
description = "CPU to allocate to container"
default = 256
description = "CPU to allocate for this task (256 = 0.25 vCPU)"
type = number
}

variable "celery_beat_memory" {
default = 2048
description = "Amount (in MiB) of memory used by the task"
default = 512
description = "Amount (in MiB) of memory to allocate for this task"
type = number
}

# default celery worker
# Celery worker

variable "default_celery_worker_command" {
variable "celery_worker_command" {
description = "Command used to start celery worker"
default = ["celery", "--app=backend.celery_app:app", "worker", "--loglevel=INFO", "-Q", "default"]
type = list(string)
}

variable "default_celery_worker_cpu" {
default = 1024
description = "CPU to allocate to container"
variable "celery_worker_cpu" {
default = 256
description = "CPU to allocate for this task (256 = 0.25 vCPU)"
type = number
}

variable "default_celery_worker_memory" {
default = 2048
description = "Amount (in MiB) of memory used by the task"
variable "celery_worker_memory" {
default = 512
description = "Amount (in MiB) of memory to allocate for this task"
type = number
}

Expand All @@ -191,13 +191,13 @@ variable "backend_update_command" {
}

variable "backend_update_cpu" {
default = 1024
description = "CPU to allocate to container"
default = 256
description = "CPU to allocate for this task (256 = 0.25 vCPU)"
type = number
}

variable "backend_update_memory" {
default = 2048
description = "Amount (in MiB) of memory used by the task"
default = 512
description = "Amount (in MiB) of memory to allocate for this task"
type = number
}