{"id":22464,"date":"2026-10-12T08:11:16","date_gmt":"2026-10-12T08:11:16","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=22464"},"modified":"2026-10-12T08:12:28","modified_gmt":"2026-10-12T08:12:28","slug":"terraform-architecture-and-components-through-diagram","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/terraform-architecture-and-components-through-diagram\/","title":{"rendered":"Terraform Architecture and Components through diagram"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"793\" height=\"344\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2021\/07\/terraform-architecture-components-workflow-1.jpg\" alt=\"\" class=\"wp-image-22465\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2021\/07\/terraform-architecture-components-workflow-1.jpg 793w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2021\/07\/terraform-architecture-components-workflow-1-300x130.jpg 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2021\/07\/terraform-architecture-components-workflow-1-768x333.jpg 768w\" sizes=\"auto, (max-width: 793px) 100vw, 793px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"766\" height=\"456\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2021\/07\/terraform-architecture-components-workflow-2.jpg\" alt=\"\" class=\"wp-image-22466\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2021\/07\/terraform-architecture-components-workflow-2.jpg 766w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2021\/07\/terraform-architecture-components-workflow-2-300x179.jpg 300w\" sizes=\"auto, (max-width: 766px) 100vw, 766px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"564\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2021\/07\/terraform-architecture-components-workflow-2.png\" alt=\"\" class=\"wp-image-22467\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2021\/07\/terraform-architecture-components-workflow-2.png 1200w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2021\/07\/terraform-architecture-components-workflow-2-300x141.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2021\/07\/terraform-architecture-components-workflow-2-1024x481.png 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2021\/07\/terraform-architecture-components-workflow-2-768x361.png 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\">Terraform Architecture &amp; End-to-End Workflow<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">This reference architecture covers the standard Terraform CLI workflow, including execution from a developer machine or CI\/CD runner. It shows the relationship between Terraform configuration, Terraform Core, provider plugins, state management, execution plans, and actual cloud infrastructure.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Complete list of Terraform architecture components<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>#<\/th><th>Component<\/th><th>Responsibility<\/th><\/tr><tr><td>1<\/td><td>Developer \/ DevOps Engineer<\/td><td>Writes infrastructure configuration and initiates changes<\/td><\/tr><tr><td>2<\/td><td>Git \/ Version Control<\/td><td>Stores and versions Terraform configuration<\/td><\/tr><tr><td>3<\/td><td>Execution Environment<\/td><td>Developer laptop, CI\/CD runner, or HCP Terraform execution environment<\/td><\/tr><tr><td>4<\/td><td>Root Module<\/td><td>Main Terraform configuration (<code>.tf<\/code> files)<\/td><\/tr><tr><td>5<\/td><td>Child Modules<\/td><td>Reusable infrastructure configuration, from local paths, Git, or registries<\/td><\/tr><tr><td>6<\/td><td>Input Variables &amp; Locals<\/td><td>Provide configurable and derived values<\/td><\/tr><tr><td>7<\/td><td>Resources &amp; Data Sources<\/td><td>Declare infrastructure to manage and external information to read<\/td><\/tr><tr><td>8<\/td><td>Terraform Core \/ CLI<\/td><td>Evaluates configuration, constructs dependency graphs, plans and executes changes<\/td><\/tr><tr><td>9<\/td><td>Provider Configuration &amp; Plugins<\/td><td>Connect Terraform Core to external platform APIs<\/td><\/tr><tr><td>10<\/td><td>Authentication &amp; Authorization<\/td><td>Provide credentials and permissions to access platforms and state<\/td><\/tr><tr><td>11<\/td><td>Terraform Registry<\/td><td>Source for published providers and modules<\/td><\/tr><tr><td>12<\/td><td>Initialization Artifacts<\/td><td><code>.terraform\/<\/code> cache and <code>.terraform.lock.hcl<\/code> provider dependency lock file<\/td><\/tr><tr><td>13<\/td><td>Backend<\/td><td>Defines where Terraform stores its state<\/td><\/tr><tr><td>14<\/td><td>Terraform State<\/td><td>Maps Terraform resource instances to real infrastructure objects<\/td><\/tr><tr><td>15<\/td><td>State Locking<\/td><td>Prevents concurrent conflicting state operations where supported<\/td><\/tr><tr><td>16<\/td><td>Dependency Graph<\/td><td>Determines resource dependencies and execution order<\/td><\/tr><tr><td>17<\/td><td>Execution Plan<\/td><td>Describes proposed create, update, replacement, or delete actions<\/td><\/tr><tr><td>18<\/td><td>Approval \/ Policy Checks<\/td><td>Optional human review and organizational governance<\/td><\/tr><tr><td>19<\/td><td>Terraform Apply<\/td><td>Executes the approved infrastructure changes<\/td><\/tr><tr><td>20<\/td><td>Cloud \/ SaaS APIs<\/td><td>Receive provider requests to inspect and modify external resources<\/td><\/tr><tr><td>21<\/td><td>Actual Infrastructure<\/td><td>AWS, Azure, GCP, Kubernetes, databases, SaaS resources, etc.<\/td><\/tr><tr><td>22<\/td><td>Output Values<\/td><td>Expose selected values from the resulting infrastructure<\/td><\/tr><tr><td>23<\/td><td>Drift Detection \/ Reconciliation<\/td><td>Subsequent plans identify differences between configuration, state, and actual resources<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This follows HashiCorp&#8217;s documented Core\u2013Provider architecture, initialization workflow, plan\/apply behavior, and state-management model.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. Terraform workflow \u2014 high-level phases<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"841\" height=\"215\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/10\/image-8.png\" alt=\"\" class=\"wp-image-78961\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/10\/image-8.png 841w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/10\/image-8-300x77.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/10\/image-8-767x196.png 767w\" sizes=\"auto, (max-width: 841px) 100vw, 841px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The important architectural distinction is that Terraform Core calculates and orchestrates changes; provider plugins communicate with external APIs; and the backend stores Terraform state. These are separate responsibilities.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. Terraform Architecture Diagram \u2014 End-to-End<\/h2>\n\n\n\n<div class=\"wp-block-merpress-mermaidjs diagram-source-mermaid\"><pre class=\"mermaid\">flowchart TB\n    subgraph SOURCE[\"01 - CONFIGURATION &amp; SOURCE CONTROL\"]\n        direction LR\n        DEV[\"Developer \/ Git \/ CI Pipeline\"]\n        ROOT[\"Root Module - HCL&lt;br\/>Providers, Resources, Data Sources&lt;br\/>Variables, Outputs, Backend\"]\n        MOD[\"Child Modules&lt;br\/>Local \/ Git \/ Registry\"]\n        VARS[\"Input Values&lt;br\/>tfvars \/ TF_VAR \/ Workspace\"]\n        AUTH[\"Credentials &amp; Identity&lt;br\/>IAM \/ OIDC \/ Environment\"]\n        DEV --> ROOT\n        ROOT -.->|References| MOD\n    end\n\n    subgraph CORE[\"02 - TERRAFORM CORE &amp; EXECUTION WORKFLOW\"]\n        direction LR\n        INIT[\"1. terraform init&lt;br\/>Initialize Backend&lt;br\/>Install Modules &amp; Providers\"]\n        VALID[\"2. terraform validate&lt;br\/>Check Configuration&lt;br\/>Optional: terraform fmt -check\"]\n        PLAN[\"3. terraform plan -out=tfplan&lt;br\/>Refresh Actual Resources&lt;br\/>Build Dependency Graph&lt;br\/>Calculate Changes\"]\n        GATE{\"4. Review&lt;br\/>Approved?\"}\n        APPLY[\"5. terraform apply tfplan&lt;br\/>Execute Saved Plan\"]\n        DONE([\"6. Complete&lt;br\/>Outputs Available\"])\n\n        INIT --> VALID --> PLAN --> GATE\n        GATE -->|Yes| APPLY --> DONE\n    end\n\n    subgraph RUNTIME[\"03 - STATE &amp; PROVIDER INTEGRATION\"]\n        direction LR\n        STATE[(\"Terraform State Backend&lt;br\/>Local \/ S3 \/ HCP Terraform&lt;br\/>State Locking If Supported\")]\n        PROVIDER[\"Provider Plugins&lt;br\/>AWS \/ Azure \/ Google&lt;br\/>Kubernetes \/ SaaS\"]\n        API[\"Cloud &amp; Service APIs\"]\n        INFRA[\"Actual Infrastructure&lt;br\/>VPC \/ EC2 \/ EKS \/ Databases&lt;br\/>DNS \/ Kubernetes \/ SaaS\"]\n\n        PROVIDER &lt;-->|API Requests &amp; Responses| API\n        API &lt;-->|Read &amp; Modify| INFRA\n    end\n\n    ROOT --> INIT\n    MOD -.->|Resolved During Init| INIT\n    VARS -.->|Runtime Input Values| PLAN\n    AUTH -.->|Provider Authentication| PROVIDER\n    AUTH -.->|Backend Authentication| STATE\n\n    INIT -.->|Configure Backend| STATE\n    INIT -.->|Install Plugins| PROVIDER\n\n    PLAN &lt;-->|Read State; Lock If Supported| STATE\n    PLAN &lt;-->|Refresh &amp; Read Data| PROVIDER\n\n    APPLY &lt;-->|Read &amp; Update State| STATE\n    APPLY -->|Create \/ Update \/ Delete| PROVIDER\n\n    GATE -.->|No: Revise &amp; Replan| ROOT\n\n    classDef source fill:#E8F2FF,stroke:#2864C5,color:#14396E,stroke-width:2px\n    classDef step fill:#F0EAFE,stroke:#8056C8,color:#402070,stroke-width:2px\n    classDef decision fill:#FFF0C4,stroke:#DB9200,color:#704A00,stroke-width:3px\n    classDef state fill:#FFF0DC,stroke:#D48827,color:#794609,stroke-width:2px\n    classDef provider fill:#DEF7F5,stroke:#15948C,color:#095E58,stroke-width:2px\n    classDef resource fill:#E3F5E9,stroke:#2E9954,color:#135B32,stroke-width:2px\n    classDef success fill:#D7F5DF,stroke:#26994D,color:#145C30,stroke-width:3px\n\n    class DEV,ROOT,MOD,VARS,AUTH source\n    class INIT,VALID,PLAN,APPLY step\n    class GATE decision\n    class STATE state\n    class PROVIDER,API provider\n    class INFRA resource\n    class DONE success\n\n    style SOURCE fill:#F5F9FF,stroke:#A7C6F1,stroke-width:2px\n    style CORE fill:#FBF8FF,stroke:#C4ADEA,stroke-width:2px\n    style RUNTIME fill:#F5FBFA,stroke:#A4D9D0,stroke-width:2px\n<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">4. How to explain this architecture during training<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Configuration: The engineer defines desired infrastructure using HCL, optionally using reusable modules.<\/li>\n\n\n\n<li>Initialization: Terraform prepares the backend and downloads required modules and provider plugins.<\/li>\n\n\n\n<li>Validation: Terraform checks whether the configuration is valid. Formatting checks are optional.<\/li>\n\n\n\n<li>Planning: Terraform reads the existing state, normally refreshes managed resources through providers, constructs a dependency graph, and calculates the required changes.<\/li>\n\n\n\n<li>Approval: The engineer or CI\/CD process reviews the execution plan. This is an external workflow gate, not a mandatory Terraform component.<\/li>\n\n\n\n<li>Applying: Terraform instructs provider plugins to execute the planned changes through platform APIs and persists updated state.<\/li>\n\n\n\n<li>Continuous management: Future plans compare the desired configuration with current infrastructure to identify drift and new changes.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">5. Important architectural accuracy notes<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Plan vs. Apply: A normal <code>terraform plan<\/code> doesn&#8217;t modify managed infrastructure. <code>terraform apply tfplan<\/code> executes a previously saved plan without another interactive approval prompt. Protect saved plan files because they can contain sensitive data. <img decoding=\"async\" src=\"https:\/\/www.google.com\/s2\/favicons?domain=https:\/\/developer.hashicorp.com&amp;sz=32\">HashiCorp Developer+2<\/li>\n\n\n\n<li>State vs. Infrastructure: Terraform state stores resource mappings and metadata; it is not the actual infrastructure. A backend manages state storage and locking where supported. <img decoding=\"async\" src=\"https:\/\/www.google.com\/s2\/favicons?domain=https:\/\/developer.hashicorp.com&amp;sz=32\">HashiCorp Developer+1<\/li>\n\n\n\n<li>Provider vs. Backend: A provider communicates with target service APIs; a backend handles Terraform state. The two serve different purposes. <img decoding=\"async\" src=\"https:\/\/www.google.com\/s2\/favicons?domain=https:\/\/developer.hashicorp.com&amp;sz=32\">HashiCorp Developer+1<\/li>\n\n\n\n<li>HCP Terraform: For remotely executed HCP workspaces, the same logical responsibilities apply, but the plan\/apply process runs on HCP-managed infrastructure or a configured agent. VCS-driven workflows use their own run and approval process rather than necessarily applying a local <code>tfplan<\/code> file. <img decoding=\"async\" src=\"https:\/\/www.google.com\/s2\/favicons?domain=https:\/\/developer.hashicorp.com&amp;sz=32\">HashiCorp Developer+1<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The central concept for students: Terraform configuration describes the desired infrastructure, Terraform Core determines the changes, providers interact with the actual platforms, and Terraform state tracks the resources being managed.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Terraform Architecture &amp; End-to-End Workflow This reference architecture covers the standard Terraform CLI workflow, including execution from a developer machine or CI\/CD runner. It shows the relationship&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[2],"tags":[],"class_list":["post-22464","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/22464","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=22464"}],"version-history":[{"count":5,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/22464\/revisions"}],"predecessor-version":[{"id":78963,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/22464\/revisions\/78963"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=22464"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=22464"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=22464"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}