Articles in this section

Deploy Bold Reports ECS Multi-Container on AWS ECS Fargate with Application Load Balancer

Published:
Updated:

1. Overview

This guide deploys Bold Reports on AWS ECS Fargate using Amazon EFS storage, and an Application Load Balancer.

2. Prerequisites

• Amazon ECS cluster - https://docs.aws.amazon.com/AmazonECS/latest/userguide/create_cluster.html
• Amazon EFS - https://docs.aws.amazon.com/efs/latest/ug/gs-step-two-create-efs-resources.html
• IAM roles: ECS task execution role + CloudWatch access
• Application Load Balancer (Internet-facing) with at least 2 subnets across AZs
• Relational database (PostgreSQL, MySQL, Oracle or MSSQL) reachable from the ECS subnets
• All Bold Reports resources in the same VPC and Security Group

3. ECS Cluster

After prerequisites, the new cluster appears on the ECS Clusters list.

Picture1.jpg

4. Task Definitions

4.1 Placeholders used in every task definition

Placeholder What to put in
<service-task-definition-name> ECS Task Definition family name for the service.
<service-container-name> Container name inside the task definition.
<update the latest image> Container image repository with latest version tag.
<application-domain> Public DNS domain mapped to the Application Load Balancer.
<provide the DB type> Database engine type (PostgreSQL/ MySQL/ Oracle/ MSSQL).
<provide the DB host> Endpoint or IP address of the database server.
<provide the DB port number> Database port number (PostgreSQL: 5432, MySQL: 3306, MSSQL: 1433).
<provide the DB maintenance DB name> Default maintenance database name.
<provide the DB user name> Database master or application user with DDL rights.
<provide the DB name> Target database name for Bold Reports application data.
<provide the user email ID> Initial Bold Reports administrator email address.
<aws-region> AWS region where the ECS cluster and services reside.
<ecs-task-role-arn> ARN of the IAM Task Role (grants containers S3/CloudWatch access).
<ecs-task-execution-role-arn> ARN of the ECS Task Execution Role (grants ECS access to ECR/Secrets).
<account-id> 12-digit AWS Account ID.
<secret-name> Secret name defined in AWS Secrets Manager.
<efs-volume-name> Name given to the EFS volume in the task definition storage settings.
<efs-file-system-id> File system ID of the Amazon EFS instance.

4.2 Task Definition Files - Service Reference Table

⚠️ Task definitions for all Bold Reports services are maintained in the GitHub repository:

  1. From the sidebar click Task definitions › Create new task definition with JSON.

Picture2.jpg

  1. Based on the storage type use the Bold Reports task definitions from below GitHub
    GitHub Repository Location: GitHub - Bold Reports ECS Task Definitions

  2. Use the latest images from https://github.com/boldreports/boldreports-server-in-docker/blob/master/deploy/multiple-container/docker-compose.yml.

Secrets

⚠️ Secrets: Replace the DB password and user password into AWS Secrets Manager and reference it via the secrets block (valueFrom).

4.3 AWS Secrets Manager Creation

The following steps describe how to create the secret in AWS Secrets Manager for the DB password and user password.

Steps

  1. Go to Secret manager Page

  2. Click Store a new secret

Picture23.jpg

  1. Choose Secret type as Other type of secret

Picture24.jpg

  1. Next add the key/value pairs

Picture25.jpg

  1. Next set the Encryption key as aws/secretsmanager

Picture26.jpg

  1. Next set the secret name and description

Picture27.jpg

  1. Next set the tag if needed.

Picture28.jpg

  1. Next set the default options for Resource permission, Replicate secret, Configure rotation.

Picture29.jpg

  1. Next check the review.

Picture30.jpg

  1. Next click store to create the secret manager.

Policies

Policy need to attach with the IAM user account:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "ReadSpecificSecret",
      "Effect": "Allow",
      "Action": [
        "secretsmanager:GetSecretValue",
        "secretsmanager:DescribeSecret"
      ],
      "Resource": "arn:aws:secretsmanager:<aws-region>:<account-id>:secret:<secret-name>*"
    },
    {
      "Sid": "ListSecretsForConsole",
      "Effect": "Allow",
      "Action": [
        "secretsmanager:ListSecrets"
      ],
      "Resource": "*"
    }
  ]
}

Policy needs to attach with the task definition role:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "SecretsManagerAccess",
      "Effect": "Allow",
      "Action": [
        "secretsmanager:GetSecretValue",
        "secretsmanager:DescribeSecret"
      ],
      "Resource": "arn:aws:secretsmanager:<aws-region>:<account-id>:secret:<secret-name>*"
    }
  ]
}

4.4 Suggested CPU and Memory to support concurrent users

Service CPU (milli core) Memory (GB) Desired Tasks
ID WEB 512 1 1
ID UMS 512 1 1
ID API 512 1 1
REPORTS WEB 512 1 1
REPORTS API 512 1 1
REPORTS JOBS 512 1 1
REPORTS DESIGNER 512 1 1
REPORTS VIEWER 512 1 1
BOLD ETL 512 1 1
REPORTS AI 512 1 1
REPORTS MCP 512 1 1

5. Create Target Groups

Create Target Groups

Each Bold Reports service needs its own target group.

5.1 Create Target Group for each services

  1. Go to EC2 > Target Groups > Create target group

Picture3.jpg

  1. Choose the Target type as IP address and provide the target group name
  2. Choose the protocol as HTTP and choose the respective VPC

Picture4.jpg

  1. Provide health check endpoint for each services as mentioned in the table below

Picture5.jpg

Health-check paths per target group:

Service Health check path
IDP Web /health-check
IDP UMS /health-check
IDP API /health-check
Reports Web /health-check
Reports Jobs /health-check
Reports API /health-check
Reports Designer /health-check
Reports Viewer /health-check
Bold ETL /etlservice/health-check
Reports AI /reportsai/health-check
Reports MCP /health-check
  1. Under the Advanced health check settings change the Success Codes value from 200 to 200-399

    Picture38.jpg

  2. Click Next and click Create target group

  3. Follow the above steps and create target group for each service

Suggested target-group names:

Service Suggested TG name Port
IDP Web tg-idp-web 80
IDP UMS tg-idp-ums 80
IDP API tg-id-api 80
Reports Web tg-reports-web 80
Reports Jobs tg-reports-jobs 80
Reports API tg-reports-api 80
Reports Designer tg-reports-designer 80
Reports Viewer tg-reports-Viewer 80
BOLD ETL tg-bold-etl 80
Reports AI tg-reports-ai 80
Reports MCP tg-reports-mcp 80

⚠️ All target groups must live in the same VPC as the ECS cluster.

6. Application Load Balancer

Application Load Balancer

  1. Go to EC2 > Load balancers > Create load balancer
  2. Create Application Load balancer

Picture6.jpg

  1. To connect all the services, create a common load balancer and choose a listener based on your preference (80 or 443)

⚠️ Screenshots show 443 Listener

  1. Create the load balancer with:
    • Load balancer name
    • Internet-facing scheme
    • IPv4 IP address type
    • Same VPC and subnets/security group as the cluster

Picture7.jpg

Picture8.jpg

  1. For the Listeners and routing:
    • ALB listens to HTTPS:443 (and HTTP:80 redirected to HTTPS)
    • Choose the ID-WEB’s target group name
    • For HTTPS, import the respective SSL certificate

Picture9.jpg

Picture10.jpg

  1. Click Create load balancer

7. Listener Rules for Path-Based Routing

Listener Rules for Path-Based Routing

Once the Load balancer is created, click the HTTPS listener on the ALB Listeners tab and add rules to the HTTPS:443 listener.

Picture11.jpg

Picture12.jpg

Add a rule for each of the Bold Reports services. Each rule has:

  • Condition 1: Host header = <application-domain>
  • Condition 2: Path pattern = /<service-path>/*
  • Action: Forward to target group

Listener-rule reference table:

Service Target Group Host header Path pattern Priority
id-web tg-id-web /* 12
id-ums tg-id-ums /ums/* 11
id-api tg-id-api /api/* 10
reports-web tg-reports-web /reporting/* 9
reports-jobs tg-reports-jobs /reporting/jobs/* 8
reports-api tg-reports-api /reporting/api/* 7
reports-viewer tg-reports-viewer /reporting/viewer/* 6
bold-etl tg-bold-etl /etlservice/* 5
reports-designer tg-reports-designer /reporting/reportservice/* 4
reports-ai tg-reports-ai /reportsai/* 3
reports-mcp tg-reports-mcp /reportsmcp/* 2

⚠️ Lower priority values are evaluated first. The listener’s default action forwards to the IDP Web target group; it does not need a non-default priority.

Example for IDP Web:

Picture13.jpg

Picture14.jpg

Picture15.jpg

8. ECS Service Creation

ECS Service Creation

⚠️ RECOMMENDED DEPLOYMENT ORDER:
id-ums (first deployed, must be RUNNING) → id-api → id-web → reports-web → reports-api → reports-jobs → reports-designer → reports-viewer → bold-etl → reports-ai → reports-mcp

The id-ums service owns the schema + the initial administrator account. Any service that boots before id-ums is RUNNING will fail health checks at startup.

From the cluster → Services tab → click Create. Pick the right task definition family for this service.

Picture16.jpg

8.1 Environment

  1. Compute options = Launch type
  2. Launch type = Fargate
  3. Open Troubleshooting configuration - recommended → tick Turn on ECS Exec

Picture17.jpg

8.2 Tasks and health

⚠️ Desired tasks = 1, Health check grace period = 120 s

Picture39.jpg

8.3 Networking

  • VPC — same as the cluster
  • Subnets — private subnets only
  • Security group — same SG as the cluster
  • Public IP = Turned off

Picture19.jpg

8.4 Service Connect (shared namespace)

  1. Tick Use Service Connect → Configuration = Client and server → use the same namespace for every service
  2. If namespace is not available, Create namespace:
    • Provide the load balancer name
    • Instance discovery – API calls and DNS queries in VPCs
    • Select the same VPC as the cluster uses
    • Click Create Namespace
  3. Once namespace is created, choose it in the service connect

Picture20.jpg

8.5 Add Port Mappings and Applications

Use these Service Connect values verbatim:

Port alias Discovery DNS Port
idp-web id-web-service id-web-service 6000
idp-api id-api-service id-api-service 6001
idp-ums id-ums-service id-ums-service 6002
reports-web reports-web-service reports-web-service 6550
reports-api reports-api-service reports-api-service 6551
reports-jobs reports-jobs-service reports-jobs-service 6552
reports-designer reports-reportservice-service reports-reportservice-service 6553
reports-viewer reports-viewer-service reports-viewer-service 6554
bold-etl bold-etl-service bold-etl-service 6009
reports-ai reports-ai-service reports-ai-service 6555
reports-mcp reports-mcp-service reports-mcp-service 6556

⚠️ Same Service Connect namespace for every service
⚠️ Set per-request timeout as 240 s for every services

Picture21.jpg

8.6 Load balancer integration

In the Load balancer section:

  • Use existing ALB
  • Use existing HTTPS listener
  • Use matching listener row
  • Click Create

Picture22.jpg

Once all the details are given, click Create option to create the service. Repeat for all services.

9. Auto-Deployment and Verification

⚠️ After all services are RUNNING, browse to https://<application-domain>/. The Bold Reports auto-deployment wizard loads automatically on a fresh tenant.

Log in with the admin credentials (user-email + user-password).

9.1 Post-deployment checklist

  • ☐ All ECS services in RUNNING state
  • ☐ All target groups report at least one healthy target
  • ☐ Service Connect DNS resolves between every pair of services
  • ☐ No errors in CloudWatch Log Group /aws/ecs/boldbi
  • ☐ Map the ALB DNS to <application-domain> in Route 53

10. Auto Scaling Configuration

Auto Scaling Configuration - AWS ECS Fargate with Application Load Balancer

Overview

This section provides step-by-step instructions to enable auto-scaling for Bold Reports services on AWS ECS. Once configured, services will automatically scale based on CPU and Memory utilization metrics.

⚠️ Important Note: Once CPU or Memory reaches above 80%, it takes approximately 3 minutes for a new task to be completely launched and ready to serve traffic.

Step 1: Update Service with Monitoring Configuration

Navigate to the respective service and configure monitoring metrics:

  1. Go to AWS ECS > Clusters > Select your cluster > Services > Select the Bold Reports service
  2. Click on ‘Update service’ button
  3. Navigate to ‘Monitoring configuration’ section
  4. Add metric configuration for CPU Utilization
  5. Add metric configuration for Memory Utilization
  6. Set Resolution as 20 seconds (for faster scaling detection)
  7. Click ‘Update service’ to save changes

Picture31.jpg

Step 2: Configure Service Auto Scaling Task Counts

Set the minimum and maximum number of tasks for auto-scaling:

  1. Navigate to: ECS > Services > Select service > Service Auto Scaling
  2. Click ‘Set the number of tasks’ button
  3. Enable: ‘Use service auto scaling to adjust your service’s desired task count’
  4. Set Minimum number of tasks: 1
  5. Set Maximum number of tasks: 20 (based on expected load)
  6. Click ‘Save’ button to apply changes

Picture32.jpg

Picture33.jpg

Step 3: Create New Scaling Policies

Navigate to the scaling policies section:

  1. Go to the service’s Auto scaling tab > Scaling policies section
  2. Click ‘Create scaling policy’ button

Picture34.jpg

Step 4: Create CPU Utilization Scaling Policy

Configure Target Tracking policy for CPU metrics:

  1. Choose ‘Target Tracking’ as the scaling policy type
  2. Policy name: Enter a descriptive name (e.g., ‘service-name-cpu-scaling’)
  3. Metric type: Select ‘ECSServiceAverageCPUUtilizationHighResolution’
  4. Target utilization: Enter 80 (percent)
  5. Expand ‘Additional settings’ section
  6. Scale-in cooldown period: Set to 60 seconds
  7. Scale-out cooldown period: Set to 300 seconds (5 minutes)
  8. Click ‘Create scaling policy’ button to save

Picture35.jpg

Step 5: Create Memory Utilization Scaling Policy

Configure Target Tracking policy for Memory metrics:

  1. Click ‘Create scaling policy’ button again
  2. Choose ‘Target Tracking’ as the scaling policy type
  3. Policy name: Enter a descriptive name (e.g., ‘service-name-memory-scaling’)
  4. Metric type: Select ‘ECSServiceAverageMemoryUtilizationHighResolution’
  5. Target utilization: Enter 80 (percent)
  6. Expand ‘Additional settings’ section
  7. Scale-in cooldown period: Set to 60 seconds
  8. Scale-out cooldown period: Set to 300 seconds (5 minutes)
  9. Click ‘Create scaling policy’ button to save

Picture36.jpg

Step 6: Verification

Verify that both policies are now active:

  1. Navigate to the service’s Auto scaling tab > Scaling policies section
  2. You should see both policies listed with ‘Active’ status
  3. Verify CPU utilization policy shows 80% target
  4. Verify Memory utilization policy shows 80% target
  5. Both policies are now active and will trigger scaling events

Picture37.jpg

Scaling Timeline & Important Notes

When CPU or Memory exceeds 80%, AWS automatically launches new tasks. Timeline breakdown:

Phase Duration Activity
0-1 minute 1 min Alarm threshold exceeded, scaling initiated
1-3 minutes 2 min AWS ECS service initiates task launch request; Fargate provisions container, pulls image from ECR
During launch - Application (Bold Reports) initializes and starts
Health checks - Health checks pass, task added to load balancer
Traffic serving - Task receives traffic from load balancer
Total time 3 minutes From alarm trigger to production traffic

High Availability Configuration

Setting Minimum=2 ensures redundancy:

  • Service always runs minimum 2 tasks
  • If one task fails, other task continues serving traffic
  • Replacement task automatically launched by AWS
  • Result: Zero downtime during task failure

⚠️ Single task (Min=1) = Single point of failure!

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied