|
27 | 27 | ](./LICENSE) |
28 | 28 |
|
29 | 29 | </div> |
| 30 | + |
| 31 | +The repository contains the terraform code to deploy Grafana and PostgreSql |
| 32 | +on Amazon Elastic Container Service (ECS). |
| 33 | + |
| 34 | +## Table of Contents |
| 35 | +* [Architecture](#architecture) |
| 36 | +* [Code Structure](#code-structure) |
| 37 | +* [Usage](#usage) |
| 38 | +* [References](#references) |
| 39 | + |
| 40 | + |
| 41 | +## Cloud Architecture |
| 42 | + |
| 43 | +The following diagram shows the architecture of the deployment. It consists of |
| 44 | +two services `grafana` and `postgres` running on ECS. The `grafana` service |
| 45 | +is connected to the `postgres` service using the official Grafana PostgreSql |
| 46 | +plugin. Through this connection, Grafana can visualize the data stored in the |
| 47 | +PostgreSql database. Furthermore, the `grafana` service is exposed to the |
| 48 | +internet using an Elastic Load Balancer (ELB). |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | +## Code Structure |
| 53 | + |
| 54 | +The repository contains the following files and directories: |
| 55 | + |
| 56 | +```plaintext |
| 57 | +├── LICENSE |
| 58 | +├── README.md |
| 59 | +├── docs |
| 60 | +├── ops |
| 61 | +│ ├── ecs |
| 62 | +│ │ ├── README.md |
| 63 | +│ │ ├── main.tf |
| 64 | +│ │ ├── modules |
| 65 | +│ │ │ ├── cluster |
| 66 | +│ │ │ ├── grafana |
| 67 | +│ │ │ ├── postgres |
| 68 | +│ │ │ └── vpc |
| 69 | +│ │ ├── provider.tf |
| 70 | +│ │ └── variables.tf |
| 71 | +│ └── repository |
| 72 | +│ └── ecr.tf |
| 73 | +└── src |
| 74 | + ├── docker-compose.yaml |
| 75 | + ├── grafana |
| 76 | + │ ├── Dockerfile |
| 77 | + │ ├── grafana.ini |
| 78 | + │ └── provisioning |
| 79 | + │ ├── dashboards |
| 80 | + │ │ └── dashboards.yaml |
| 81 | + │ └── datasources |
| 82 | + │ └── postgres.yaml |
| 83 | + └── postgres |
| 84 | + ├── Dockerfile |
| 85 | + └── init.sql |
| 86 | +``` |
| 87 | + |
| 88 | +* `src` contains the source code for the `grafana` and `postgres` services. |
| 89 | +* `ops/repository` contains the terraform code to create the Elastic Container |
| 90 | + Registry (ECR) repository, and required IAM roles. |
| 91 | +* `ops/ecs` contains the terraform code to create the ECS cluster, services, |
| 92 | + |
| 93 | +## Usage |
| 94 | + |
| 95 | +1. Follow the instructions in the [ops/repository/README.md](./ops/repository/README.md) |
| 96 | + to create the Elastic Container Registry (ECR) repository and required IAM roles. |
| 97 | +2. Follow the instruction in the [ops/ecs/README.md](./ops/ecs/README.md) to deploy |
| 98 | + the `grafana` and `postgres` services on Amazon Elastic Container Service (ECS). |
| 99 | + |
| 100 | + |
| 101 | +## References |
| 102 | +* [Grafana](https://grafana.com/) |
| 103 | +* [PostgreSql](https://www.postgresql.org/) |
| 104 | +* [Amazon Elastic Container Service](https://aws.amazon.com/ecs/) |
0 commit comments