# testing-acc-actions/terraform-task architecture

> Architecture diagram of the GitHub repository testing-acc-actions/terraform-task, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/testing-acc-actions/terraform-task
- Repository: https://github.com/testing-acc-actions/terraform-task

## Overview

This repository contains two Terraform infrastructure projects. The documented application workflow invokes a Python Lambda, reads credentials from Secrets Manager, queries Aurora PostgreSQL, and returns the query result. Terraform modules define the networking, database, and Lambda resources; the other project covers VPC, EC2, and ALB infrastructure. The handler was sampled, but Terraform source was not, so infrastructure relationships below rely on README statements rather than inspected Terraform calls; the EC2/ALB project has only high-level documentation.

Main entry points: [`aurora-lambda/lambda/src/handler.py`](https://github.com/testing-acc-actions/terraform-task/blob/feature/aurora-lambda/lambda/src/handler.py) (Lambda handler), [`aurora-lambda/modules/networking/main.tf`](https://github.com/testing-acc-actions/terraform-task/blob/feature/aurora-lambda/modules/networking/main.tf) (Networking module), [`aurora-lambda/main.tf`](https://github.com/testing-acc-actions/terraform-task/blob/feature/aurora-lambda/main.tf) (Aurora project root), [`main.tf`](https://github.com/testing-acc-actions/terraform-task/blob/feature/main.tf) (VPC EC2 ALB project)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Lambda application"]
  node_handler["Lambda handler<br/>[handler.py]"]
  node_secrets[("Secrets Manager")]
  node_result["JSON response<br/>[handler.py]"]
  node_lambda_module["Lambda module<br/>[main.tf]"]
  node_iam_role["Lambda IAM role<br/>[main.tf]"]
end

subgraph group_aurora["Aurora infrastructure"]
  node_postgres[("Aurora PostgreSQL<br/>[main.tf]")]
  node_infra_root["Aurora project root<br/>[main.tf]"]
end

subgraph group_network["Networking"]
  node_net_module["Networking module<br/>[main.tf]"]
  node_private_network["Private VPC network<br/>[main.tf]"]
  node_security_groups["Security groups<br/>[main.tf]"]
  node_secrets_endpoint["Secrets endpoint<br/>[main.tf]"]
end

subgraph group_web["VPC EC2 ALB"]
  node_web_root["VPC EC2 ALB project<br/>[main.tf]"]
  node_web_vpc["VPC networking<br/>[Vpc.tf]"]
  node_ec2["EC2 compute<br/>[Ec2_Instance.tf]"]
  node_alb["Application load balancer<br/>[alb.tf]"]
end

node_caller(("Lambda invoker"))

node_caller -->|"invokes"| node_handler
node_handler -->|"retrieves credentials"| node_secrets
node_handler -->|"queries"| node_postgres
node_handler -->|"returns"| node_result
node_infra_root -->|"configures"| node_net_module
node_infra_root -->|"configures"| node_lambda_module
node_infra_root -->|"configures"| node_postgres
node_net_module -->|"creates"| node_private_network
node_net_module -->|"configures"| node_security_groups
node_net_module -->|"creates"| node_secrets_endpoint
node_lambda_module -->|"creates"| node_iam_role
node_web_root -.->|"configures"| node_web_vpc
node_web_root -.->|"configures"| node_ec2
node_web_root -.->|"configures"| node_alb

click node_handler "https://github.com/testing-acc-actions/terraform-task/blob/feature/aurora-lambda/lambda/src/handler.py"
click node_postgres "https://github.com/testing-acc-actions/terraform-task/blob/feature/aurora-lambda/modules/aurora/main.tf"
click node_result "https://github.com/testing-acc-actions/terraform-task/blob/feature/aurora-lambda/lambda/src/handler.py"
click node_infra_root "https://github.com/testing-acc-actions/terraform-task/blob/feature/aurora-lambda/main.tf"
click node_net_module "https://github.com/testing-acc-actions/terraform-task/blob/feature/aurora-lambda/modules/networking/main.tf"
click node_private_network "https://github.com/testing-acc-actions/terraform-task/blob/feature/aurora-lambda/modules/networking/main.tf"
click node_security_groups "https://github.com/testing-acc-actions/terraform-task/blob/feature/aurora-lambda/modules/networking/main.tf"
click node_secrets_endpoint "https://github.com/testing-acc-actions/terraform-task/blob/feature/aurora-lambda/modules/networking/main.tf"
click node_lambda_module "https://github.com/testing-acc-actions/terraform-task/blob/feature/aurora-lambda/modules/lambda/main.tf"
click node_iam_role "https://github.com/testing-acc-actions/terraform-task/blob/feature/aurora-lambda/modules/lambda/main.tf"
click node_web_root "https://github.com/testing-acc-actions/terraform-task/blob/feature/main.tf"
click node_web_vpc "https://github.com/testing-acc-actions/terraform-task/blob/feature/modules/VPC/Vpc.tf"
click node_ec2 "https://github.com/testing-acc-actions/terraform-task/blob/feature/modules/EC2/Ec2_Instance.tf"
click node_alb "https://github.com/testing-acc-actions/terraform-task/blob/feature/modules/ALB/alb.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_handler,node_secrets,node_result,node_lambda_module,node_iam_role toneBlue
class node_postgres,node_infra_root toneAmber
class node_net_module,node_private_network,node_security_groups,node_secrets_endpoint toneMint
class node_web_root,node_web_vpc,node_ec2,node_alb toneRose
class node_caller toneIndigo
```

## Components

### Lambda application

- [Lambda handler](https://github.com/testing-acc-actions/terraform-task/blob/feature/aurora-lambda/lambda/src/handler.py): `aurora-lambda/lambda/src/handler.py`
- **Secrets Manager**
- [JSON response](https://github.com/testing-acc-actions/terraform-task/blob/feature/aurora-lambda/lambda/src/handler.py): `aurora-lambda/lambda/src/handler.py`
- [Lambda module](https://github.com/testing-acc-actions/terraform-task/blob/feature/aurora-lambda/modules/lambda/main.tf): `aurora-lambda/modules/lambda/main.tf`
- [Lambda IAM role](https://github.com/testing-acc-actions/terraform-task/blob/feature/aurora-lambda/modules/lambda/main.tf): `aurora-lambda/modules/lambda/main.tf`

### Aurora infrastructure

- [Aurora PostgreSQL](https://github.com/testing-acc-actions/terraform-task/blob/feature/aurora-lambda/modules/aurora/main.tf): `aurora-lambda/modules/aurora/main.tf`
- [Aurora project root](https://github.com/testing-acc-actions/terraform-task/blob/feature/aurora-lambda/main.tf): `aurora-lambda/main.tf`

### Networking

- [Networking module](https://github.com/testing-acc-actions/terraform-task/blob/feature/aurora-lambda/modules/networking/main.tf): `aurora-lambda/modules/networking/main.tf`
- [Private VPC network](https://github.com/testing-acc-actions/terraform-task/blob/feature/aurora-lambda/modules/networking/main.tf): `aurora-lambda/modules/networking/main.tf`
- [Security groups](https://github.com/testing-acc-actions/terraform-task/blob/feature/aurora-lambda/modules/networking/main.tf): `aurora-lambda/modules/networking/main.tf`
- [Secrets endpoint](https://github.com/testing-acc-actions/terraform-task/blob/feature/aurora-lambda/modules/networking/main.tf): `aurora-lambda/modules/networking/main.tf`

### VPC EC2 ALB

- [VPC EC2 ALB project](https://github.com/testing-acc-actions/terraform-task/blob/feature/main.tf): `main.tf`
- [VPC networking](https://github.com/testing-acc-actions/terraform-task/blob/feature/modules/VPC/Vpc.tf): `modules/VPC/Vpc.tf`
- [EC2 compute](https://github.com/testing-acc-actions/terraform-task/blob/feature/modules/EC2/Ec2_Instance.tf): `modules/EC2/Ec2_Instance.tf`
- [Application load balancer](https://github.com/testing-acc-actions/terraform-task/blob/feature/modules/ALB/alb.tf): `modules/ALB/alb.tf`

### Other components

- **Lambda invoker**

## Connections

- Lambda invoker → Lambda handler: invokes (evidence: `README.md`)
- Lambda handler → Secrets Manager: retrieves credentials (evidence: `aurora-lambda/lambda/src/handler.py`)
- Lambda handler → Aurora PostgreSQL: queries (evidence: `aurora-lambda/lambda/src/handler.py`)
- Lambda handler → JSON response: returns (evidence: `aurora-lambda/lambda/src/handler.py`)
- Aurora project root → Networking module: configures (evidence: `README.md`)
- Aurora project root → Lambda module: configures (evidence: `README.md`)
- Aurora project root → Aurora PostgreSQL: configures (evidence: `README.md`)
- Networking module → Private VPC network: creates (evidence: `README.md`)
- Networking module → Security groups: configures (evidence: `README.md`)
- Networking module → Secrets endpoint: creates (evidence: `README.md`)
- Lambda module → Lambda IAM role: creates (evidence: `README.md`)
- VPC EC2 ALB project → VPC networking: configures
- VPC EC2 ALB project → EC2 compute: configures
- VPC EC2 ALB project → Application load balancer: configures
