read replica support in external vuln scan module (#19166)

closes https://github.com/fleetdm/fleet/issues/18926
This commit is contained in:
Benjamin Edwards 2024-05-20 23:19:32 -04:00 committed by GitHub
parent a0ef33180a
commit 642f2a9e70
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,7 +14,8 @@ locals {
]
secrets = [
for k, v in merge(var.fleet_config.extra_secrets, {
FLEET_MYSQL_PASSWORD = var.fleet_config.database.password_secret_arn
FLEET_MYSQL_PASSWORD = var.fleet_config.database.password_secret_arn
FLEET_MYSQL_READ_REPLICA_PASSWORD = var.fleet_config.database.password_secret_arn
}) : {
name = k
valueFrom = v
@ -83,6 +84,18 @@ resource "aws_ecs_task_definition" "vuln-processing" {
name = "FLEET_MYSQL_ADDRESS"
value = var.fleet_config.database.address
},
{
name = "FLEET_MYSQL_READ_REPLICA_USERNAME"
value = var.fleet_config.database.user
},
{
name = "FLEET_MYSQL_READ_REPLICA_DATABASE"
value = var.fleet_config.database.database
},
{
name = "FLEET_MYSQL_READ_REPLICA_ADDRESS"
value = var.fleet_config.database.rr_address == null ? var.fleet_config.database.address : var.fleet_config.database.rr_address
},
{
name = "FLEET_REDIS_ADDRESS"
value = var.fleet_config.redis.address