https://github.com/optiop/postgres-grafana-on-ecs
A showcase of visualizing Postgresql data using Grafana deployed as containers on Amazon Elastic Container Service (ECS).
https://github.com/optiop/postgres-grafana-on-ecs
blog elasticcontainerservice grafana optiop postgresql visualization
Last synced: 5 months ago
JSON representation
A showcase of visualizing Postgresql data using Grafana deployed as containers on Amazon Elastic Container Service (ECS).
- Host: GitHub
- URL: https://github.com/optiop/postgres-grafana-on-ecs
- Owner: optiop
- License: mit
- Created: 2024-03-08T17:23:27.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-02T20:45:53.000Z (over 1 year ago)
- Last Synced: 2024-12-02T21:34:41.233Z (over 1 year ago)
- Topics: blog, elasticcontainerservice, grafana, optiop, postgresql, visualization
- Language: HCL
- Homepage: https://optiop.org/blog/content/visualize-postgres-data-using-grafana-ecs/index.html
- Size: 656 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Visualize PostgreSql data using Grafana deployed on Amazon Elastic Container Service (ECS)
[

](https://discord.gg/WkA4PM2dna)
[

](https://optiop.org/blog/content/visualize-postgres-data-using-grafana-ecs/index.html)
[

](./LICENSE)
The repository contains the terraform code to deploy Grafana and PostgreSql
on Amazon Elastic Container Service (ECS).
## Table of Contents
* [Architecture](#architecture)
* [Code Structure](#code-structure)
* [Usage](#usage)
* [References](#references)
## Cloud Architecture
The following diagram shows the architecture of the deployment. It consists of
two services `grafana` and `postgres` running on ECS. The `grafana` service
is connected to the `postgres` service using the official Grafana PostgreSql
plugin. Through this connection, Grafana can visualize the data stored in the
PostgreSql database. Furthermore, the `grafana` service is exposed to the
internet using an Elastic Load Balancer (ELB).

## Code Structure
The repository contains the following files and directories:
```plaintext
├── LICENSE
├── README.md
├── docs
├── ops
│ ├── ecs
│ │ ├── README.md
│ │ ├── main.tf
│ │ ├── modules
│ │ │ ├── cluster
│ │ │ ├── grafana
│ │ │ ├── postgres
│ │ │ └── vpc
│ │ ├── provider.tf
│ │ └── variables.tf
│ └── repository
│ └── ecr.tf
└── src
├── docker-compose.yaml
├── grafana
│ ├── Dockerfile
│ ├── grafana.ini
│ └── provisioning
│ ├── dashboards
│ │ └── dashboards.yaml
│ └── datasources
│ └── postgres.yaml
└── postgres
├── Dockerfile
└── init.sql
```
* `src` contains the source code for the `grafana` and `postgres` services.
* `ops/repository` contains the terraform code to create the Elastic Container
Registry (ECR) repository, and required IAM roles.
* `ops/ecs` contains the terraform code to create the ECS cluster, services,
## Usage
1. Follow the instructions in the [ops/repository/README.md](./ops/repository/README.md)
to create the Elastic Container Registry (ECR) repository and required IAM roles.
2. Follow the instruction in the [ops/ecs/README.md](./ops/ecs/README.md) to deploy
the `grafana` and `postgres` services on Amazon Elastic Container Service (ECS).
## References
* [Grafana](https://grafana.com/)
* [PostgreSql](https://www.postgresql.org/)
* [Amazon Elastic Container Service](https://aws.amazon.com/ecs/)