# balasekhardevops-coder/aws-sagemaker-llmops architecture

> Architecture diagram of the GitHub repository balasekhardevops-coder/aws-sagemaker-llmops, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/balasekhardevops-coder/aws-sagemaker-llmops
- Repository: https://github.com/balasekhardevops-coder/aws-sagemaker-llmops

## Overview

This repository provisions a VPC-only SageMaker Studio training lab through separate bootstrap, identity, and environment Terraform stacks. The documented deployment path is a manual GitHub Actions entry point followed by a reusable workflow that checks the account and state isolation, plans, then applies an approval-bound saved plan. The README also identifies the Dev stack’s legacy flat resources and the independent QA/Prod module roots. Source excerpts are limited to the incident-data generator, so infrastructure relationships below rely on README statements rather than sampled Terraform internals.

Main entry points: [`terraform/identity/main.tf`](https://github.com/balasekhardevops-coder/aws-sagemaker-llmops/blob/main/terraform/identity/main.tf) (Identity and policies), [`terraform/environments/dev`](https://github.com/balasekhardevops-coder/aws-sagemaker-llmops/tree/main/terraform/environments/dev) (Dev environment), [`.github/workflows/terraform-infra-manual.yml`](https://github.com/balasekhardevops-coder/aws-sagemaker-llmops/blob/main/.github/workflows/terraform-infra-manual.yml) (Manual deploy workflow), [`.github/workflows/terraform-reusable-deploy.yml`](https://github.com/balasekhardevops-coder/aws-sagemaker-llmops/blob/main/.github/workflows/terraform-reusable-deploy.yml) (Reusable deploy workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_deploy["Deployment"]
  node_manual["Manual deploy workflow"]
  node_reusable["Reusable deploy workflow"]
end

subgraph group_stacks["Terraform stacks"]
  node_bootstrap["Backend bootstrap<br/>[main.tf]"]
  node_identity["Identity and policies<br/>[main.tf]"]
  node_dev["Dev environment"]
  node_qa["QA environment"]
  node_prod["Prod environment"]
end

subgraph group_modules["Infrastructure modules"]
  node_modules["Reusable AWS modules"]
end

subgraph group_labdata["Lab data"]
  node_generator["Incident generator"]
  node_incidents["Incident dataset<br/>[incidents.jsonl]"]
end

node_operator(("Operator"))
node_backend[("Terraform state bucket")]
node_aws{{"AWS account"}}
node_studio["SageMaker Studio"]

node_operator -->|"starts"| node_manual
node_manual -->|"invokes"| node_reusable
node_reusable -.->|"deploys stacks"| node_bootstrap
node_bootstrap -->|"creates backend"| node_backend
node_identity -->|"defines roles"| node_aws
node_identity -->|"scopes policies"| node_backend
node_dev -->|"provisions resources"| node_aws
node_dev -->|"provisions domain"| node_studio
node_qa -->|"uses module roots"| node_modules
node_prod -->|"uses module roots"| node_modules
node_generator -->|"generates records"| node_incidents

click node_manual "https://github.com/balasekhardevops-coder/aws-sagemaker-llmops/blob/main/.github/workflows/terraform-infra-manual.yml"
click node_reusable "https://github.com/balasekhardevops-coder/aws-sagemaker-llmops/blob/main/.github/workflows/terraform-reusable-deploy.yml"
click node_bootstrap "https://github.com/balasekhardevops-coder/aws-sagemaker-llmops/blob/main/terraform/bootstrap/main.tf"
click node_identity "https://github.com/balasekhardevops-coder/aws-sagemaker-llmops/blob/main/terraform/identity/main.tf"
click node_dev "https://github.com/balasekhardevops-coder/aws-sagemaker-llmops/tree/main/terraform/environments/dev"
click node_qa "https://github.com/balasekhardevops-coder/aws-sagemaker-llmops/tree/main/terraform/environments/qa"
click node_prod "https://github.com/balasekhardevops-coder/aws-sagemaker-llmops/tree/main/terraform/environments/prod"
click node_modules "https://github.com/balasekhardevops-coder/aws-sagemaker-llmops/tree/main/terraform/modules"
click node_generator "https://github.com/balasekhardevops-coder/aws-sagemaker-llmops/blob/main/scripts/generate_incidents.py"
click node_incidents "https://github.com/balasekhardevops-coder/aws-sagemaker-llmops/blob/main/data/raw/incidents.jsonl"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_manual,node_reusable toneBlue
class node_bootstrap,node_identity,node_dev,node_qa,node_prod,node_backend toneAmber
class node_modules toneMint
class node_generator,node_incidents toneRose
class node_operator,node_aws,node_studio toneIndigo
```

## Components

### Deployment

- [Manual deploy workflow](https://github.com/balasekhardevops-coder/aws-sagemaker-llmops/blob/main/.github/workflows/terraform-infra-manual.yml): `.github/workflows/terraform-infra-manual.yml`
- [Reusable deploy workflow](https://github.com/balasekhardevops-coder/aws-sagemaker-llmops/blob/main/.github/workflows/terraform-reusable-deploy.yml): `.github/workflows/terraform-reusable-deploy.yml`

### Terraform stacks

- [Backend bootstrap](https://github.com/balasekhardevops-coder/aws-sagemaker-llmops/blob/main/terraform/bootstrap/main.tf): `terraform/bootstrap/main.tf`
- [Identity and policies](https://github.com/balasekhardevops-coder/aws-sagemaker-llmops/blob/main/terraform/identity/main.tf): `terraform/identity/main.tf`
- [Dev environment](https://github.com/balasekhardevops-coder/aws-sagemaker-llmops/tree/main/terraform/environments/dev): `terraform/environments/dev`
- [QA environment](https://github.com/balasekhardevops-coder/aws-sagemaker-llmops/tree/main/terraform/environments/qa): `terraform/environments/qa`
- [Prod environment](https://github.com/balasekhardevops-coder/aws-sagemaker-llmops/tree/main/terraform/environments/prod): `terraform/environments/prod`

### Infrastructure modules

- [Reusable AWS modules](https://github.com/balasekhardevops-coder/aws-sagemaker-llmops/tree/main/terraform/modules): `terraform/modules`

### Lab data

- [Incident generator](https://github.com/balasekhardevops-coder/aws-sagemaker-llmops/blob/main/scripts/generate_incidents.py): `scripts/generate_incidents.py`
- [Incident dataset](https://github.com/balasekhardevops-coder/aws-sagemaker-llmops/blob/main/data/raw/incidents.jsonl): `data/raw/incidents.jsonl`

### Other components

- **Operator**
- **Terraform state bucket**
- **AWS account**
- **SageMaker Studio**

## Connections

- Operator → Manual deploy workflow: starts (evidence: `README.md`)
- Manual deploy workflow → Reusable deploy workflow: invokes (evidence: `README.md`)
- Reusable deploy workflow → Backend bootstrap: deploys stacks
- Backend bootstrap → Terraform state bucket: creates backend (evidence: `README.md`)
- Identity and policies → AWS account: defines roles (evidence: `README.md`)
- Identity and policies → Terraform state bucket: scopes policies (evidence: `README.md`)
- Dev environment → AWS account: provisions resources (evidence: `README.md`)
- Dev environment → SageMaker Studio: provisions domain (evidence: `README.md`)
- QA environment → Reusable AWS modules: uses module roots (evidence: `README.md`)
- Prod environment → Reusable AWS modules: uses module roots (evidence: `README.md`)
- Incident generator → Incident dataset: generates records (evidence: `scripts/generate_incidents.py`)
