An open API service indexing awesome lists of open source software.

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).

Awesome Lists containing this project

README

          








Visualize PostgreSql data using Grafana deployed on Amazon Elastic Container Service (ECS)







[
![Discord](https://img.shields.io/discord/1216332587778179072)
](https://discord.gg/WkA4PM2dna)
[
![Blog](https://img.shields.io/badge/blog-optiop-blue)
](https://optiop.org/blog/content/visualize-postgres-data-using-grafana-ecs/index.html)
[
![license](https://img.shields.io/github/license/optiop/postgres-grafana-on-ecs)
](./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).

![Architecture](./docs/images/deployment.dark.png)

## 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/)