# londheshubham153/terraform-for-devops architecture

> Architecture diagram of the GitHub repository londheshubham153/terraform-for-devops, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/londheshubham153/terraform-for-devops
- Repository: https://github.com/londheshubham153/terraform-for-devops

## Overview

This is a hands-on Terraform learning repository, not a single application. Its main workflow is for an engineer to provide configuration and variables, then use Terraform to plan or apply AWS infrastructure and inspect outputs. Separate examples cover a reusable multi-environment module, an EKS/VPC deployment, and modern Terraform language and lifecycle features. Relationships below follow the README; source excerpts were not available to verify finer-grained wiring.

Main entry points: [`ec2.tf`](https://github.com/londheshubham153/terraform-for-devops/blob/main/ec2.tf) (EC2 and security), [`aws_module_project/main.tf`](https://github.com/londheshubham153/terraform-for-devops/blob/main/aws_module_project/main.tf) (Environment composition), [`eks/vpc.tf`](https://github.com/londheshubham153/terraform-for-devops/blob/main/eks/vpc.tf) (VPC networking), [`eks/eks.tf`](https://github.com/londheshubham153/terraform-for-devops/blob/main/eks/eks.tf) (EKS cluster)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Core AWS"]
  node_root_config["Provider and versions<br/>[terraform.tf]"]
  node_root_inputs["Validated inputs<br/>[variables.tf]"]
  node_ec2["EC2 and security<br/>[ec2.tf]"]
  node_bootstrap["Instance bootstrap<br/>[script.sh]"]
  node_s3["S3 bucket<br/>[s3.tf]"]
  node_dynamodb[("DynamoDB table<br/>[dynamodb.tf]")]
  node_root_outputs["Infrastructure outputs<br/>[outputs.tf]"]
end

subgraph group_eks["EKS Deployment"]
  node_eks_provider["EKS provider and locals<br/>[provider.tf]"]
  node_vpc["VPC networking<br/>[vpc.tf]"]
  node_eks_cluster["EKS cluster<br/>[eks.tf]"]
  node_eks_outputs["EKS outputs<br/>[outputs.tf]"]
end

subgraph group_modules["Reusable Module"]
  node_module_config["Environment composition<br/>[main.tf]"]
  node_module_provider["Module provider config<br/>[providers.tf]"]
  node_module_inputs["Module inputs<br/>[variables.tf]"]
  node_module_server["Module EC2 servers<br/>[my_server.tf]"]
  node_module_bucket["Module S3 bucket<br/>[my_bucket.tf]"]
  node_module_table[("Module DynamoDB table<br/>[my_table.tf]")]
  node_module_outputs["Module outputs<br/>[my_outputs.tf]"]
end

subgraph group_features["Terraform Features"]
  node_foreach["Iteration examples<br/>[for_each.tf]"]
  node_validation["Validation examples<br/>[validation.tf]"]
  node_lifecycle["Lifecycle examples<br/>[lifecycle.tf]"]
  node_refactoring["Refactoring examples<br/>[moved.tf]"]
  node_imports["Import examples<br/>[import.tf]"]
  node_assertions["Check examples<br/>[check.tf]"]
  node_removal["Safe removal examples<br/>[removed.tf]"]
  node_terraform_test["Native test example<br/>[main.tf]"]
end

node_engineer(("Engineer"))
node_terraform["Terraform CLI"]
node_aws["AWS"]

node_engineer -->|"runs commands"| node_terraform
node_terraform -->|"reads configuration"| node_root_config
node_root_inputs -->|"configures"| node_ec2
node_ec2 -->|"uses user data"| node_bootstrap
node_terraform -->|"plans and applies"| node_aws
node_ec2 -->|"defines resources"| node_aws
node_s3 -->|"defines resources"| node_aws
node_dynamodb -->|"defines resources"| node_aws
node_terraform -->|"reports values"| node_root_outputs
node_terraform -->|"reads configuration"| node_eks_provider
node_vpc -->|"defines networking"| node_aws
node_eks_cluster -->|"defines cluster"| node_aws
node_vpc -->|"provides networking"| node_eks_cluster
node_terraform -->|"reports values"| node_eks_outputs
node_terraform -->|"reads configuration"| node_module_config
node_module_config -->|"instantiates module"| node_module_inputs
node_module_config -->|"uses provider config"| node_module_provider
node_module_server -->|"defines resources"| node_aws
node_module_bucket -->|"defines resources"| node_aws
node_module_table -->|"defines resources"| node_aws
node_terraform -->|"evaluates example"| node_foreach
node_terraform -->|"evaluates example"| node_validation
node_terraform -->|"evaluates example"| node_lifecycle
node_terraform -->|"evaluates example"| node_refactoring
node_terraform -->|"evaluates example"| node_imports
node_terraform -->|"evaluates example"| node_assertions
node_terraform -->|"evaluates example"| node_removal
node_terraform -->|"evaluates example"| node_terraform_test

click node_root_config "https://github.com/londheshubham153/terraform-for-devops/blob/main/terraform.tf"
click node_root_inputs "https://github.com/londheshubham153/terraform-for-devops/blob/main/variables.tf"
click node_ec2 "https://github.com/londheshubham153/terraform-for-devops/blob/main/ec2.tf"
click node_bootstrap "https://github.com/londheshubham153/terraform-for-devops/blob/main/script.sh"
click node_s3 "https://github.com/londheshubham153/terraform-for-devops/blob/main/s3.tf"
click node_dynamodb "https://github.com/londheshubham153/terraform-for-devops/blob/main/dynamodb.tf"
click node_root_outputs "https://github.com/londheshubham153/terraform-for-devops/blob/main/outputs.tf"
click node_eks_provider "https://github.com/londheshubham153/terraform-for-devops/blob/main/eks/provider.tf"
click node_vpc "https://github.com/londheshubham153/terraform-for-devops/blob/main/eks/vpc.tf"
click node_eks_cluster "https://github.com/londheshubham153/terraform-for-devops/blob/main/eks/eks.tf"
click node_eks_outputs "https://github.com/londheshubham153/terraform-for-devops/blob/main/eks/outputs.tf"
click node_module_config "https://github.com/londheshubham153/terraform-for-devops/blob/main/aws_module_project/main.tf"
click node_module_provider "https://github.com/londheshubham153/terraform-for-devops/blob/main/aws_module_project/providers.tf"
click node_module_inputs "https://github.com/londheshubham153/terraform-for-devops/blob/main/aws_module_project/my_app_infra_module/variables.tf"
click node_module_server "https://github.com/londheshubham153/terraform-for-devops/blob/main/aws_module_project/my_app_infra_module/my_server.tf"
click node_module_bucket "https://github.com/londheshubham153/terraform-for-devops/blob/main/aws_module_project/my_app_infra_module/my_bucket.tf"
click node_module_table "https://github.com/londheshubham153/terraform-for-devops/blob/main/aws_module_project/my_app_infra_module/my_table.tf"
click node_module_outputs "https://github.com/londheshubham153/terraform-for-devops/blob/main/aws_module_project/my_app_infra_module/my_outputs.tf"
click node_foreach "https://github.com/londheshubham153/terraform-for-devops/blob/main/examples/for_each.tf"
click node_validation "https://github.com/londheshubham153/terraform-for-devops/blob/main/examples/validation.tf"
click node_lifecycle "https://github.com/londheshubham153/terraform-for-devops/blob/main/examples/lifecycle.tf"
click node_refactoring "https://github.com/londheshubham153/terraform-for-devops/blob/main/examples/moved.tf"
click node_imports "https://github.com/londheshubham153/terraform-for-devops/blob/main/examples/import.tf"
click node_assertions "https://github.com/londheshubham153/terraform-for-devops/blob/main/examples/check.tf"
click node_removal "https://github.com/londheshubham153/terraform-for-devops/blob/main/examples/removed.tf"
click node_terraform_test "https://github.com/londheshubham153/terraform-for-devops/blob/main/examples/terraform_test/main.tf"

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_root_config,node_root_inputs,node_ec2,node_bootstrap,node_s3,node_dynamodb,node_root_outputs toneBlue
class node_eks_provider,node_vpc,node_eks_cluster,node_eks_outputs toneAmber
class node_module_config,node_module_provider,node_module_inputs,node_module_server,node_module_bucket,node_module_table,node_module_outputs toneMint
class node_foreach,node_validation,node_lifecycle,node_refactoring,node_imports,node_assertions,node_removal,node_terraform_test toneRose
class node_engineer,node_terraform,node_aws toneIndigo
```

## Components

### Core AWS

- [Provider and versions](https://github.com/londheshubham153/terraform-for-devops/blob/main/terraform.tf): `terraform.tf`
- [Validated inputs](https://github.com/londheshubham153/terraform-for-devops/blob/main/variables.tf): `variables.tf`
- [EC2 and security](https://github.com/londheshubham153/terraform-for-devops/blob/main/ec2.tf): `ec2.tf`
- [Instance bootstrap](https://github.com/londheshubham153/terraform-for-devops/blob/main/script.sh): `script.sh`
- [S3 bucket](https://github.com/londheshubham153/terraform-for-devops/blob/main/s3.tf): `s3.tf`
- [DynamoDB table](https://github.com/londheshubham153/terraform-for-devops/blob/main/dynamodb.tf): `dynamodb.tf`
- [Infrastructure outputs](https://github.com/londheshubham153/terraform-for-devops/blob/main/outputs.tf): `outputs.tf`

### EKS Deployment

- [EKS provider and locals](https://github.com/londheshubham153/terraform-for-devops/blob/main/eks/provider.tf): `eks/provider.tf`
- [VPC networking](https://github.com/londheshubham153/terraform-for-devops/blob/main/eks/vpc.tf): `eks/vpc.tf`
- [EKS cluster](https://github.com/londheshubham153/terraform-for-devops/blob/main/eks/eks.tf): `eks/eks.tf`
- [EKS outputs](https://github.com/londheshubham153/terraform-for-devops/blob/main/eks/outputs.tf): `eks/outputs.tf`

### Reusable Module

- [Environment composition](https://github.com/londheshubham153/terraform-for-devops/blob/main/aws_module_project/main.tf): `aws_module_project/main.tf`
- [Module provider config](https://github.com/londheshubham153/terraform-for-devops/blob/main/aws_module_project/providers.tf): `aws_module_project/providers.tf`
- [Module inputs](https://github.com/londheshubham153/terraform-for-devops/blob/main/aws_module_project/my_app_infra_module/variables.tf): `aws_module_project/my_app_infra_module/variables.tf`
- [Module EC2 servers](https://github.com/londheshubham153/terraform-for-devops/blob/main/aws_module_project/my_app_infra_module/my_server.tf): `aws_module_project/my_app_infra_module/my_server.tf`
- [Module S3 bucket](https://github.com/londheshubham153/terraform-for-devops/blob/main/aws_module_project/my_app_infra_module/my_bucket.tf): `aws_module_project/my_app_infra_module/my_bucket.tf`
- [Module DynamoDB table](https://github.com/londheshubham153/terraform-for-devops/blob/main/aws_module_project/my_app_infra_module/my_table.tf): `aws_module_project/my_app_infra_module/my_table.tf`
- [Module outputs](https://github.com/londheshubham153/terraform-for-devops/blob/main/aws_module_project/my_app_infra_module/my_outputs.tf): `aws_module_project/my_app_infra_module/my_outputs.tf`

### Terraform Features

- [Iteration examples](https://github.com/londheshubham153/terraform-for-devops/blob/main/examples/for_each.tf): `examples/for_each.tf`
- [Validation examples](https://github.com/londheshubham153/terraform-for-devops/blob/main/examples/validation.tf): `examples/validation.tf`
- [Lifecycle examples](https://github.com/londheshubham153/terraform-for-devops/blob/main/examples/lifecycle.tf): `examples/lifecycle.tf`
- [Refactoring examples](https://github.com/londheshubham153/terraform-for-devops/blob/main/examples/moved.tf): `examples/moved.tf`
- [Import examples](https://github.com/londheshubham153/terraform-for-devops/blob/main/examples/import.tf): `examples/import.tf`
- [Check examples](https://github.com/londheshubham153/terraform-for-devops/blob/main/examples/check.tf): `examples/check.tf`
- [Safe removal examples](https://github.com/londheshubham153/terraform-for-devops/blob/main/examples/removed.tf): `examples/removed.tf`
- [Native test example](https://github.com/londheshubham153/terraform-for-devops/blob/main/examples/terraform_test/main.tf): `examples/terraform_test/main.tf`

### Other components

- **Engineer**
- **Terraform CLI**
- **AWS**

## Connections

- Engineer → Terraform CLI: runs commands
- Terraform CLI → Provider and versions: reads configuration
- Validated inputs → EC2 and security: configures
- EC2 and security → Instance bootstrap: uses user data
- Terraform CLI → AWS: plans and applies
- EC2 and security → AWS: defines resources
- S3 bucket → AWS: defines resources
- DynamoDB table → AWS: defines resources
- Terraform CLI → Infrastructure outputs: reports values
- Terraform CLI → EKS provider and locals: reads configuration
- VPC networking → AWS: defines networking
- EKS cluster → AWS: defines cluster
- VPC networking → EKS cluster: provides networking
- Terraform CLI → EKS outputs: reports values
- Terraform CLI → Environment composition: reads configuration
- Environment composition → Module inputs: instantiates module
- Environment composition → Module provider config: uses provider config
- Module EC2 servers → AWS: defines resources
- Module S3 bucket → AWS: defines resources
- Module DynamoDB table → AWS: defines resources
- Terraform CLI → Iteration examples: evaluates example
- Terraform CLI → Validation examples: evaluates example
- Terraform CLI → Lifecycle examples: evaluates example
- Terraform CLI → Refactoring examples: evaluates example
- Terraform CLI → Import examples: evaluates example
- Terraform CLI → Check examples: evaluates example
- Terraform CLI → Safe removal examples: evaluates example
- Terraform CLI → Native test example: evaluates example
