Deploy replicant node in EMQX running in ECS

Hi,

I have an EMQX cluster running on ECS that are containing core nodes.
Here’s the task definition used for deploying the core nodes:

resource "aws_ecs_task_definition" "emqx" {
  family                   = "emqx-${var.project.application}-${var.project.environment}"
  network_mode             = "awsvpc"
  requires_compatibilities = ["FARGATE"]
  cpu                      = "4096"
  memory                   = "8192"
  task_role_arn            = aws_iam_role.mqtt_broker_task.arn
  execution_role_arn       = aws_iam_role.mqtt_broker_execution.arn

  container_definitions = jsonencode([{
    name  = "emqx",
    image = "emqx/emqx:5.3.2",
    portMappings = [
      {
        containerPort = 1883,
        hostPort      = 1883,
        protocol      = "tcp"
      },
      {
        containerPort = 8883,
        hostPort      = 8883,
        protocol      = "tcp"
      },
      {
        containerPort = 18083,
        hostPort      = 18083,
        protocol      = "tcp"
      }
    ],
    logConfiguration = {
      logDriver = "awslogs",
      options = {
        awslogs-group         = aws_cloudwatch_log_group.emqx.name,
        awslogs-region        = "eu-central-1",
        awslogs-stream-prefix = "emqx"
      }
    },
    environment = [
      {
        name  = "EMQX_CLUSTER__DISCOVERY_STRATEGY",
        value = "dns"
      },
      {
        name  = "EMQX_CLUSTER__DNS__NAME",
        value = "emqx-service.emqx-${var.project.application}-${var.project.environment}"
      }
    ]
  }])
}

I want to deploy replicant nodes. I’ve tried these environment variables, but none of them has worked:

  • “EMQX_NODE__DATA__ROLE” = “replicant”
  • “EMQX_NODE__ROLE” = “replicant”
  • “EMQX_NODE__COOKIE” = “secret_cookie”

Could someone help how to deploy replicant nodes in ECS environment? Many thanks!