From c5d7e0035cfac631bffafb9e2e5e1bb8a7d8c7e1 Mon Sep 17 00:00:00 2001 From: loitragg Date: Sat, 27 Sep 2025 16:05:25 +0700 Subject: [PATCH] chore(infra): correct naming --- iac/README.md | 44 ++++++++++++++++++++++++++++++++++++ iac/ecs.tf | 2 +- iac/terraform.tfvars.example | 2 +- iac/variables.tf | 2 +- 4 files changed, 47 insertions(+), 3 deletions(-) diff --git a/iac/README.md b/iac/README.md index 6a7fe92390..00d1a96cc5 100644 --- a/iac/README.md +++ b/iac/README.md @@ -18,6 +18,50 @@ Microsoft Entra App Proxy → Internal ALB → ECS Service (3 instances) → Aur - **Auto Scaling**: CPU-based scaling from 2-10 instances - **Monitoring**: CloudWatch dashboards and alarms +## Directory Structure + +``` +iac/ +├── modules/ # Reusable Terraform modules +│ └── grafana-otel/ # Standalone Grafana OTEL monitoring module +│ ├── main.tf +│ ├── variables.tf +│ ├── outputs.tf +│ ├── versions.tf +│ └── README.md +├── grafana-standalone/ # Example standalone Grafana deployment +│ ├── main.tf +│ ├── variables.tf +│ ├── outputs.tf +│ ├── terraform.tfvars.example +│ └── README.md +├── *.tf # Main OpenWebUI infrastructure +└── README.md # This file +``` + +### Grafana OTEL Monitoring Module + +The `modules/grafana-otel/` directory contains a standalone, reusable Terraform module for deploying Grafana OTEL LGTM (Logs, Grafana, Tempo, Mimir) monitoring stack. This module can be deployed independently of the main OpenWebUI infrastructure. + +**Features:** +- Complete OTEL observability stack (Grafana + Prometheus + Tempo + Loki) +- ECS Fargate deployment with autoscaling +- Service discovery integration +- Configurable security and network access +- CloudWatch logging integration + +**Usage:** +- **Standalone**: Use `grafana-standalone/` for independent deployment with S3 remote state +- **Integrated**: Reference the module from other Terraform configurations + +**State Management:** +- **Main Infrastructure**: `production/gravity-ai-chat/terraform.tfstate` +- **Grafana Monitoring**: `production/grafana-monitoring/terraform.tfstate` + +Both deployments use the same S3 bucket but separate state files for independent management. + +See `modules/grafana-otel/README.md` for detailed documentation. + ## Prerequisites 1. Terraform >= 1.0 diff --git a/iac/ecs.tf b/iac/ecs.tf index c939bc53f1..09582e4dcc 100644 --- a/iac/ecs.tf +++ b/iac/ecs.tf @@ -62,7 +62,7 @@ resource "aws_security_group" "ecs_scaled_sg" { # CloudWatch log group for the new service resource "aws_cloudwatch_log_group" "ecs_scaled_logs" { - name = "/ecs/webUIfargate-scaled" + name = "/ecs/openwebui-scaled" retention_in_days = 7 tags = { diff --git a/iac/terraform.tfvars.example b/iac/terraform.tfvars.example index 7ebfe269b1..bd29bb5334 100644 --- a/iac/terraform.tfvars.example +++ b/iac/terraform.tfvars.example @@ -11,7 +11,7 @@ existing_ecs_security_group_id = "sg-05e12bd2e202e19f6" # ECS Configuration cluster_name = "webUIcluster2" service_name = "webui3-scaled" -task_family_name = "webUIfargate-scaled" +task_family_name = "openwebui-scaled" container_image = "908027381725.dkr.ecr.us-east-1.amazonaws.com/github/open-webui/open-webui:v0.6.16-custom" # Scaling Configuration diff --git a/iac/variables.tf b/iac/variables.tf index 7f40da6ec0..7d733b372c 100644 --- a/iac/variables.tf +++ b/iac/variables.tf @@ -49,7 +49,7 @@ variable "service_name" { variable "task_family_name" { description = "ECS task definition family name" type = string - default = "webUIfargate-scaled" + default = "openwebui-scaled" } variable "container_image" {