Deploying Grafana container service, on AWS ECS with high availability. Amazon Aurora Serverless database for storing dashboard, users, and other persistent data.
Deploying Prometheus Sever and Custom AWS Prometheus Expoter to export AWS API to Prometheus metrics. This Python module allows you to run AWS API calls through Boto3, and expose the results of those calls as Prometheus metrics. Metrics must be described in YAML.
Focsing on follwoing api.
- EC2 Information [ This to visualize AWS services running in an AWS account, using Grafana ]
- AWS Cost Explorer API [ This to visualize AWS services running in an AWS account, using Grafana ]
- VPC
- Internet Gateway (IGW)
- Public and Private Subnets
- Security Groups, Route Tables and Route Table Associations
- IAM roles, instance profiles and policies
- Amazon EC2 Container Service ( On EC2 )
- Grafana container service on ECS.
- Prometheus Server and custom expoter containers to gather EC2 information and Cost Explorer api (every 24 hours)
- Amazon Aurora Serverless ( for high availibilty )
- Application Load balancer (Internet Facing) for Grafana service.
- Application Load balancer (Internal) for Prometheus Server.
- KMS Key
- Parameter Store for store Database / Grafana Admin password
- Python v3.7
- Terraform v0.11.14
- AWS Account
- IAM User With Admin Access
git clone [email protected]:nitinda/terraform_grafana_prometheus_on_ecs.git
cd terraform_grafana_prometheus_on_ecs
make plan
make apply
- Configure Grafana to query Prometheus Server (Application Load balancer (Internal))
Custom Docker Images
- https://github.com/nitinda/docker_prometheus_custom
- https://github.com/nitinda/docker_aws_api_prometheus_exporter
You can destroy this cluster entirely by running:
git clone [email protected]:nitinda/terraform_grafana_prometheus_on_ecs.git
cd terraform_grafana_prometheus_on_ecs
make plan
make destroy