Grafana on Amazon ECS

Grafana on Amazon ECS

Project Overview:

This project demonstrates how to deploy a production-ready Grafana dashboard using the official Docker image on Amazon Elastic Container Service (ECS) with the AWS Fargate launch type. The solution is fully serverless, no EC2 provisioning or container orchestration overhead and leverages Docker, ECS, and an Application Load Balancer (ALB) to expose Grafana’s web interface.By using the grafana/grafana image directly from Docker Hub, the deployment avoids the need for custom image builds or Amazon ECR. This makes the setup lightweight, fast to deploy, and ideal for internal dashboards, monitoring pipelines, or cloud-native observability stacks.

Steps taken to complets this project :

1. Create an ECS Cluster

Amazon ECS
Amazon ECS

- Go to ECS Console → Clusters → Create Cluster
- Choose Networking only (Fargate)
- Name it
- Click Create


2. Create a Security Gorup

Go to EC2 → Security Groups → Create
- Allow inbound traffic on port 80 (for ALB) and port 3000 (Grafana)
- Allow outbound traffic
- Save and note the security group ID


3. Create an Application Load Balancer


Amazone ECS

- Go to EC2 → Load Balancers → Create
- Choose Application Load Balancer
- Name: alb-grafana
- Scheme: Internet-facing
- Listener: HTTP on port 80
- Select VPC and public subnets
- Assign the security group you created


4. Create a Target Group

- Go to EC2 → Target Groups → Create
- Type: IP
- Protocol: HTTP
- Port: 3000
- Name: grafana-target-group
- Health check path: /
- Save


5. Uploaded and monitored execution with cloudwatch


Amazon ECS

- Launch type: Fargate
- Name: grafana-task
- Task size: 0.5 vCPU, 1 GB memory

Add Container:
- Name: grafana
- Image: grafana/grafana
- Port mappings: 3000
- Click Add


6. Create ECS Service


Amazon ECS

- Go to ECS → Cluster → Services → Create
- Launch type: Fargate
- Task definition: grafana-task
- Service name: grafana-service-vrezh3mx
- Number of tasks: 1
Networking:
- VPC: same as ALB
- Subnets: public
- Security group: same as ALB
Load balancer:
- Type: Application Load Balancer
- Select alb-grafana
- Listener: port 80
- Target group: grafana-target-group
- Click Create Service


7. Access Grafana


Amazon ECS
Amazon ECS

- Go to EC2 → Load Balancers → alb-grafana
- Copy the DNS name