# dohuyanevezuch/netology-diplom-inf architecture

> Architecture diagram of the GitHub repository dohuyanevezuch/netology-diplom-inf, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dohuyanevezuch/netology-diplom-inf
- Repository: https://github.com/dohuyanevezuch/netology-diplom-inf

## Overview

This repository provisions Yandex Cloud infrastructure for a web application. The documented workflow is to bootstrap remote Terraform state, apply the main infrastructure (including a VPC, VM, registry, and Ansible inventory), then use Ansible to install and configure Docker on the VM. The README also documents an application-repository GitHub Actions build-and-publish capability; deployment from the registry to the VM is not described in the available evidence, so that connection is omitted. Relationships below are based on the README; no source excerpts were available.

Main entry points: [`terraform/infrastructure/main.tf`](https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/terraform/infrastructure/main.tf) (Infrastructure root), [`ansible/playbook.yml`](https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/ansible/playbook.yml) (Ansible playbook), [`ansible/roles/docker/tasks/main.yml`](https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/ansible/roles/docker/tasks/main.yml) (Docker setup), [`terraform/infrastructure/modules/vm/main.tf`](https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/terraform/infrastructure/modules/vm/main.tf) (Compute VM)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_state["State bootstrap"]
  node_bootstrap["State bootstrap<br/>[main.tf]"]
  node_object_storage[("Object Storage<br/>[main.tf]")]
end

subgraph group_cloud["Cloud infrastructure"]
  node_infra["Infrastructure root<br/>[main.tf]"]
  node_network["VPC and subnet<br/>[main.tf]"]
  node_security["Security group<br/>[main.tf]"]
  node_vm["Compute VM<br/>[main.tf]"]
  node_registry[("Container registry<br/>[main.tf]")]
  node_inventory["Ansible inventory<br/>[inventory.tf]"]
end

subgraph group_config["VM configuration"]
  node_ansible["Ansible playbook<br/>[playbook.yml]"]
  node_docker_role["Docker setup<br/>[main.yml]"]
  node_docker_install["Docker install<br/>[install.yml]"]
  node_docker_check["Docker check<br/>[check.yml]"]
end

subgraph group_delivery["Application delivery"]
  node_app_repo(("Application repository"))
  node_github_actions["GitHub Actions"]
  node_application["Web application"]
end

node_operator(("Operator"))

node_operator -->|"runs Terraform"| node_bootstrap
node_bootstrap -->|"creates bucket"| node_object_storage
node_operator -->|"applies infrastructure"| node_infra
node_infra -->|"stores state"| node_object_storage
node_infra -->|"creates network"| node_network
node_infra -->|"configures access"| node_security
node_infra -->|"creates VM"| node_vm
node_infra -->|"creates registry"| node_registry
node_infra -->|"generates inventory"| node_inventory
node_operator -->|"runs playbook"| node_ansible
node_ansible -->|"connects using"| node_inventory
node_ansible -->|"configures VM"| node_vm
node_ansible -->|"sets up Docker"| node_docker_role
node_docker_role -->|"runs install tasks"| node_docker_install
node_docker_role -->|"runs check tasks"| node_docker_check
node_app_repo -->|"triggers builds"| node_github_actions
node_github_actions -->|"publishes image"| node_registry
node_vm -.->|"hosts application"| node_application

click node_bootstrap "https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/terraform/bootstrap/main.tf"
click node_object_storage "https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/terraform/bootstrap/main.tf"
click node_infra "https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/terraform/infrastructure/main.tf"
click node_network "https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/terraform/infrastructure/modules/vpc/main.tf"
click node_security "https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/terraform/infrastructure/modules/security_group/main.tf"
click node_vm "https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/terraform/infrastructure/modules/vm/main.tf"
click node_registry "https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/terraform/infrastructure/modules/container_registry/main.tf"
click node_inventory "https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/terraform/infrastructure/inventory.tf"
click node_ansible "https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/ansible/playbook.yml"
click node_docker_role "https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/ansible/roles/docker/tasks/main.yml"
click node_docker_install "https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/ansible/roles/docker/tasks/install.yml"
click node_docker_check "https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/ansible/roles/docker/tasks/check.yml"

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_bootstrap,node_object_storage toneBlue
class node_infra,node_network,node_security,node_vm,node_registry,node_inventory toneAmber
class node_ansible,node_docker_role,node_docker_install,node_docker_check toneMint
class node_app_repo,node_github_actions,node_application toneRose
class node_operator toneIndigo
```

## Components

### State bootstrap

- [State bootstrap](https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/terraform/bootstrap/main.tf): `terraform/bootstrap/main.tf`
- [Object Storage](https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/terraform/bootstrap/main.tf): `terraform/bootstrap/main.tf`

### Cloud infrastructure

- [Infrastructure root](https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/terraform/infrastructure/main.tf): `terraform/infrastructure/main.tf`
- [VPC and subnet](https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/terraform/infrastructure/modules/vpc/main.tf): `terraform/infrastructure/modules/vpc/main.tf`
- [Security group](https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/terraform/infrastructure/modules/security_group/main.tf): `terraform/infrastructure/modules/security_group/main.tf`
- [Compute VM](https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/terraform/infrastructure/modules/vm/main.tf): `terraform/infrastructure/modules/vm/main.tf`
- [Container registry](https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/terraform/infrastructure/modules/container_registry/main.tf): `terraform/infrastructure/modules/container_registry/main.tf`
- [Ansible inventory](https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/terraform/infrastructure/inventory.tf): `terraform/infrastructure/inventory.tf`

### VM configuration

- [Ansible playbook](https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/ansible/playbook.yml): `ansible/playbook.yml`
- [Docker setup](https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/ansible/roles/docker/tasks/main.yml): `ansible/roles/docker/tasks/main.yml`
- [Docker install](https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/ansible/roles/docker/tasks/install.yml): `ansible/roles/docker/tasks/install.yml`
- [Docker check](https://github.com/dohuyanevezuch/netology-diplom-inf/blob/main/ansible/roles/docker/tasks/check.yml): `ansible/roles/docker/tasks/check.yml`

### Application delivery

- **Application repository**
- **GitHub Actions**
- **Web application**

### Other components

- **Operator**

## Connections

- Operator → State bootstrap: runs Terraform (evidence: `README.md`)
- State bootstrap → Object Storage: creates bucket (evidence: `README.md`)
- Operator → Infrastructure root: applies infrastructure (evidence: `README.md`)
- Infrastructure root → Object Storage: stores state (evidence: `README.md`)
- Infrastructure root → VPC and subnet: creates network (evidence: `README.md`)
- Infrastructure root → Security group: configures access (evidence: `README.md`)
- Infrastructure root → Compute VM: creates VM (evidence: `README.md`)
- Infrastructure root → Container registry: creates registry (evidence: `README.md`)
- Infrastructure root → Ansible inventory: generates inventory (evidence: `README.md`)
- Operator → Ansible playbook: runs playbook (evidence: `README.md`)
- Ansible playbook → Ansible inventory: connects using (evidence: `README.md`)
- Ansible playbook → Compute VM: configures VM (evidence: `README.md`)
- Ansible playbook → Docker setup: sets up Docker (evidence: `README.md`)
- Docker setup → Docker install: runs install tasks (evidence: `README.md`)
- Docker setup → Docker check: runs check tasks (evidence: `README.md`)
- Application repository → GitHub Actions: triggers builds (evidence: `README.md`)
- GitHub Actions → Container registry: publishes image (evidence: `README.md`)
- Compute VM → Web application: hosts application
