# chaitanya980/terraform_cloud_automation architecture

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

- Interactive diagram: https://gitdiagram.com/chaitanya980/terraform_cloud_automation
- Repository: https://github.com/chaitanya980/terraform_cloud_automation

## Overview

This is a Terraform/AWS deployment project with a small Express app. Its documented workflow is GitHub Actions automating infrastructure provisioning and application deployment; Terraform provisions EC2 for the Dockerized app, S3 for state, and ECR for images. The workflow and Terraform implementation details were not sampled, so their specific calls and configuration links are shown only where the README supports them.

Main entry points: [`github/worklfows/deploy-app.yml`](https://github.com/chaitanya980/terraform_cloud_automation/blob/main/github/worklfows/deploy-app.yml) (Deploy workflow), [`terraform/main.tf`](https://github.com/chaitanya980/terraform_cloud_automation/blob/main/terraform/main.tf) (Infrastructure config), [`github/worklfows/terraform.yml`](https://github.com/chaitanya980/terraform_cloud_automation/blob/main/github/worklfows/terraform.yml) (Terraform workflow), [`nodeapp/Dockerfile`](https://github.com/chaitanya980/terraform_cloud_automation/blob/main/nodeapp/Dockerfile) (App container)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_automation["CI/CD automation"]
  node_deploy_workflow["Deploy workflow<br/>[deploy-app.yml]"]
  node_terraform_workflow["Terraform workflow<br/>[terraform.yml]"]
end

subgraph group_infrastructure["Terraform infrastructure"]
  node_terraform_config["Infrastructure config<br/>[main.tf]"]
  node_state_config["State backend config<br/>[backend.tf]"]
end

subgraph group_application["Node application"]
  node_app_container["App container"]
  node_node_server["Express server<br/>[server.js]"]
end

subgraph group_cloud["AWS resources"]
  node_ec2["EC2 host"]
  node_s3[("Terraform state bucket")]
  node_ecr["Container registry"]
end

node_developer(("Project operator"))

node_developer -.->|"initiates"| node_deploy_workflow
node_developer -.->|"initiates"| node_terraform_workflow
node_deploy_workflow -->|"automates deployment"| node_node_server
node_terraform_workflow -->|"automates provisioning"| node_terraform_config
node_terraform_config -->|"provisions"| node_ec2
node_terraform_config -->|"provisions"| node_ecr
node_state_config -->|"stores state"| node_s3
node_app_container -->|"packages"| node_node_server
node_ec2 -->|"hosts"| node_app_container
node_deploy_workflow -.->|"publishes images"| node_ecr

click node_deploy_workflow "https://github.com/chaitanya980/terraform_cloud_automation/blob/main/github/worklfows/deploy-app.yml"
click node_terraform_workflow "https://github.com/chaitanya980/terraform_cloud_automation/blob/main/github/worklfows/terraform.yml"
click node_terraform_config "https://github.com/chaitanya980/terraform_cloud_automation/blob/main/terraform/main.tf"
click node_state_config "https://github.com/chaitanya980/terraform_cloud_automation/blob/main/terraform/backend.tf"
click node_app_container "https://github.com/chaitanya980/terraform_cloud_automation/blob/main/nodeapp/Dockerfile"
click node_node_server "https://github.com/chaitanya980/terraform_cloud_automation/blob/main/nodeapp/server.js"

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_deploy_workflow,node_terraform_workflow toneBlue
class node_terraform_config,node_state_config toneAmber
class node_app_container,node_node_server toneMint
class node_ec2,node_s3,node_ecr toneRose
class node_developer toneIndigo
```

## Components

### CI/CD automation

- [Deploy workflow](https://github.com/chaitanya980/terraform_cloud_automation/blob/main/github/worklfows/deploy-app.yml): `github/worklfows/deploy-app.yml`
- [Terraform workflow](https://github.com/chaitanya980/terraform_cloud_automation/blob/main/github/worklfows/terraform.yml): `github/worklfows/terraform.yml`

### Terraform infrastructure

- [Infrastructure config](https://github.com/chaitanya980/terraform_cloud_automation/blob/main/terraform/main.tf): `terraform/main.tf`
- [State backend config](https://github.com/chaitanya980/terraform_cloud_automation/blob/main/terraform/backend.tf): `terraform/backend.tf`

### Node application

- [App container](https://github.com/chaitanya980/terraform_cloud_automation/blob/main/nodeapp/Dockerfile): `nodeapp/Dockerfile`
- [Express server](https://github.com/chaitanya980/terraform_cloud_automation/blob/main/nodeapp/server.js): `nodeapp/server.js`

### AWS resources

- **EC2 host**
- **Terraform state bucket**
- **Container registry**

### Other components

- **Project operator**

## Connections

- Project operator → Deploy workflow: initiates
- Project operator → Terraform workflow: initiates
- Deploy workflow → Express server: automates deployment (evidence: `README.md`)
- Terraform workflow → Infrastructure config: automates provisioning (evidence: `README.md`)
- Infrastructure config → EC2 host: provisions (evidence: `README.md`)
- Infrastructure config → Container registry: provisions (evidence: `README.md`)
- State backend config → Terraform state bucket: stores state (evidence: `README.md`)
- App container → Express server: packages (evidence: `README.md`)
- EC2 host → App container: hosts (evidence: `README.md`)
- Deploy workflow → Container registry: publishes images
