Skip to content

Commit 3b5cf1e

Browse files
committed
Align ops service variables
* The ops service can use the same environment variables as the web and sidekiq services. This way they are kept in sync for any commands that run on the ops service
1 parent b33a9ed commit 3b5cf1e

2 files changed

Lines changed: 6 additions & 39 deletions

File tree

terraform/app/ecs.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,11 @@ module "ops_service" {
217217
vpc_id = aws_vpc.application_vpc.id
218218
}
219219
task_config = {
220-
environment = local.task_envs["OPS_SERVICE"]
221-
secrets = local.task_secrets["OPS_SERVICE"]
220+
environment = local.task_envs["CORE"]
221+
secrets = local.task_secrets["CORE"]
222222
cpu = 1024
223223
memory = 2048
224-
execution_role_arn = aws_iam_role.ecs_task_execution_role["OPS_SERVICE"].arn
224+
execution_role_arn = aws_iam_role.ecs_task_execution_role["CORE"].arn
225225
task_role_arn = data.aws_iam_role.ecs_task_role.arn
226226
log_group_name = aws_cloudwatch_log_group.ecs_log_group.name
227227
region = var.region

terraform/app/variables.tf

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ variable "enable_enhanced_db_monitoring" {
119119
}
120120

121121
locals {
122-
server_types = toset(["CORE", "REPORTING", "OPS_SERVICE"])
122+
server_types = toset(["CORE", "REPORTING"])
123123
is_production = var.environment == "production"
124124
parameter_store_variables = tomap({
125125
CORE = local.is_production ? {} : tomap({
@@ -148,10 +148,6 @@ locals {
148148
valueFrom = aws_rds_cluster.core.master_user_secret[0].secret_arn
149149
}]
150150
REPORTING = []
151-
OPS_SERVICE = [{
152-
name = "DB_CREDENTIALS"
153-
valueFrom = aws_rds_cluster.core.master_user_secret[0].secret_arn
154-
}]
155151
}
156152
)
157153

@@ -181,12 +177,6 @@ locals {
181177
valueFrom = "arn:aws:ssm:${var.region}:${var.account_id}:parameter${var.mise_sops_age_key_path}"
182178
}],
183179
)
184-
OPS_SERVICE = [
185-
{
186-
name = "RAILS_MASTER_KEY"
187-
valueFrom = "arn:aws:ssm:${var.region}:${var.account_id}:parameter${var.rails_master_key_path}"
188-
}
189-
]
190180
}
191181
)
192182

@@ -253,34 +243,11 @@ locals {
253243
value = var.environment == "production" ? "production" : "staging"
254244
}
255245
]
256-
OPS_SERVICE = [
257-
{
258-
name = "DB_HOST"
259-
value = aws_rds_cluster.core.endpoint
260-
},
261-
{
262-
name = "DB_NAME"
263-
value = aws_rds_cluster.core.database_name
264-
},
265-
{
266-
name = "RAILS_ENV"
267-
value = var.environment == "production" ? "production" : "staging"
268-
},
269-
{
270-
name = "SIDEKIQ_REDIS_URL"
271-
value = local.redis_sidekiq_url
272-
},
273-
{
274-
name = "REDIS_CACHE_URL"
275-
value = local.redis_cache_url
276-
},
277-
]
278246
}
279247

280248
task_secrets = {
281-
CORE = concat(local.secret_values["CORE"], local.parameter_values["CORE"])
282-
REPORTING = concat(local.secret_values["REPORTING"], local.parameter_values["REPORTING"])
283-
OPS_SERVICE = concat(local.secret_values["OPS_SERVICE"], local.parameter_values["OPS_SERVICE"])
249+
CORE = concat(local.secret_values["CORE"], local.parameter_values["CORE"])
250+
REPORTING = concat(local.secret_values["REPORTING"], local.parameter_values["REPORTING"])
284251
}
285252
container_ports = {
286253
web = 4000

0 commit comments

Comments
 (0)