{"id":327,"date":"2024-10-09T23:25:45","date_gmt":"2024-10-09T21:25:45","guid":{"rendered":"https:\/\/www.c-sautter.de\/?p=327"},"modified":"2024-11-23T15:44:34","modified_gmt":"2024-11-23T14:44:34","slug":"terragrunt-the-missing-terraform-part","status":"publish","type":"post","link":"https:\/\/www.c-sautter.de\/en\/terragrunt-the-missing-terraform-part\/","title":{"rendered":"Terragrunt \u2013 the missing Terraform Part"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"alignright size-full is-resized\"><img data-dominant-color=\"aec8cd\" data-has-transparency=\"false\" fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/www.c-sautter.de\/wp-content\/uploads\/2024\/10\/Terragrunt_and_Terraform.jpeg\" alt=\"\" class=\"wp-image-449 not-transparent\" style=\"--dominant-color: #aec8cd; width:auto;height:200px\" srcset=\"https:\/\/www.c-sautter.de\/wp-content\/uploads\/2024\/10\/Terragrunt_and_Terraform.jpeg 1024w, https:\/\/www.c-sautter.de\/wp-content\/uploads\/2024\/10\/Terragrunt_and_Terraform-300x300.jpeg 300w, https:\/\/www.c-sautter.de\/wp-content\/uploads\/2024\/10\/Terragrunt_and_Terraform-150x150.jpeg 150w, https:\/\/www.c-sautter.de\/wp-content\/uploads\/2024\/10\/Terragrunt_and_Terraform-768x768.jpeg 768w, https:\/\/www.c-sautter.de\/wp-content\/uploads\/2024\/10\/Terragrunt_and_Terraform-12x12.jpeg 12w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>Terraform ist eines der Top IaC (Infrastructure as Code) Tools. Mit Terraform k\u00f6nnen Entwickler sicher und effizient Infrastruktur erstellen, \u00e4ndern und versionieren. In der deklarativen Konfigurationssprache HCL (HashiCorp Configuration Language) wird der gew\u00fcnschte Zustand einer cloudbasierten oder lokalen Infrastruktur beschrieben. Anschlie\u00dfend kann Terraform daraus einen Plan erstellen um die Infrastruktur bereitzustellen. Terraform hat viele Vorteile st\u00f6\u00dft aber in bestimmten Bereichen auf Einschr\u00e4nkungen. Terragrunt erweitert Terraform, indem es das Wiederverwenden und Organisieren von Terraform-Konfigurationen erleichtert. Es bietet eine einheitliche Struktur f\u00fcr Projekte mit mehreren Umgebungen und verbessert den Umgang mit Remote States und Modulen. Zudem kann Terragrunt die Abh\u00e4ngigkeiten zwischen mehreren Modulen automatisch aufl\u00f6sen.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<h2 class=\"wp-block-heading\">Terraform Projekt Struktur<\/h2>\n\n\n\n<p>Vereinfachtes Beispiel einer Projektstruktur mit zwei oder mehr Modulen.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u251c\u2500\u2500 environments\n\u2502   \u251c\u2500\u2500 dev\n\u2502   \u2502   \u251c\u2500\u2500 main.tf\n\u2502   \u2502   \u251c\u2500\u2500 outputs.tf\n\u2502   \u2502   \u251c\u2500\u2500 provider.tf\n\u2502   \u2502   \u2514\u2500\u2500 variables.tf\n\u2502   \u2514\u2500\u2500 prod\n\u2502       \u251c\u2500\u2500 main.tf\n\u2502       \u251c\u2500\u2500 outputs.tf\n\u2502       \u251c\u2500\u2500 provider.tf\n\u2502       \u2514\u2500\u2500 variables.tf\n\u2514\u2500\u2500 modules\n   \u251c\u2500\u2500 ec2\n   \u2502   \u251c\u2500\u2500 main.tf\n   \u2502   \u251c\u2500\u2500 outputs.tf\n   \u2502   \u2514\u2500\u2500 variables.tf\n   \u2514\u2500\u2500 network\n       \u251c\u2500\u2500 main.tf\n       \u251c\u2500\u2500 outputs.tf\n       \u2514\u2500\u2500 variables.tf<\/code><\/pre>\n\n\n\n<p>In reinen Terraform Projekten wird f\u00fcr jede Umgebung ein separates Environment Modul (dev, prod) erstellt, in das die geteilten Module (ec2, network) geladen werden. Da die unterschiedlichen Umgebungen bis auf die geteilten Module keine gemeinsame Codebasis haben entstehen sehr leicht Abweichungen zwischen den redundanten Code Teilen. Die Dateien <code>(main.tf, outputs.tf, provider.tf, variables.tf)<\/code> werden meist doppelt oder mehrfach gepflegt.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<h2 class=\"wp-block-heading\">Terragrunt Projekt Struktur<\/h2>\n\n\n\n<p>Vereinfachte Projektstruktur mit zwei oder mehr Modulen.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>|\u2500\u2500 live\n|    \u251c\u2500\u2500 terragrunt.hcl\n|    \u251c\u2500\u2500 _env\n|    \u2502   \u251c\u2500\u2500 ec2.hcl\n|    \u2502   \u251c\u2500\u2500 network.hcl\n|    \u2502   \u2514\u2500\u2500 provider.hcl\n|    \u251c\u2500\u2500 prod\n|    \u2502   \u251c\u2500\u2500 env.hcl\n|    \u2502   \u251c\u2500\u2500 app\n|    \u2502   \u2502   \u2514\u2500\u2500 terragrunt.hcl\n|    \u2502   \u2514\u2500\u2500 mysql\n|    \u2502       \u2514\u2500\u2500 terragrunt.hcl\n|    \u2514\u2500\u2500 dev\n|        \u251c\u2500\u2500 env.hcl\n|        \u251c\u2500\u2500 ec2\n|        \u2502   \u2514\u2500\u2500 terragrunt.hcl\n|        \u2514\u2500\u2500 network\n|            \u2514\u2500\u2500 terragrunt.hcl\n\u2514\u2500\u2500 modules\n   \u251c\u2500\u2500 ec2\n   \u2502   \u251c\u2500\u2500 main.tf\n   \u2502   \u251c\u2500\u2500 outputs.tf\n   \u2502   \u2514\u2500\u2500 variables.tf\n   \u2514\u2500\u2500 network\n       \u251c\u2500\u2500 main.tf\n       \u251c\u2500\u2500 outputs.tf\n       \u2514\u2500\u2500 variables.tf<\/code><\/pre>\n\n\n\n<p>Mit Terragrunt k\u00f6nnen Code Duplikate zwischen mehreren Umgebungen sehr effektiv vermieden werden. Im Ordner <code>_env<\/code> wird die gemeinsame Code Basis parametrisiert definiert. Anschlie\u00dfend werden die Code Module aus <code>_env<\/code> in den Umgebungen (prod, dev) geladen und mit den Umgebungsspezifischen Parametern aus <code>&lt;env&gt;\/env.hcl<\/code> konfiguriert.<\/p>\n<\/div>\n<\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Nachteile von Terraform<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Wiederverwendbarkeit und Modularit\u00e4t<\/h3>\n\n\n\n<p>Terraform bietet die M\u00f6glichkeit Code in Modulen Wiederverwendbar zu organisieren. Allerdings wird das Verwalten und Verwenden vieler verschiedener Module in komplexen Infrastrukturumgebungen mit mehren Stages, wie z.B. Dev, Test und Prod, in der Handhabung herausfordernd.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">State File Management<\/h3>\n\n\n\n<p>Terraform speichert den aktuellen Status der gesamten Infrastruktur in einem gemeinsamen state file. In Umgebungen mit mehreren Modulen und Teams kann es durch ein zentrales state file zu Probleme kommen. Wenn mehrere Teammitglieder an verschiedenen Modulen arbeiten kommt es so leicht zu Race Conditions bei denen das State File zeitweise gelockt wird.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Code Duplikation und Konfiguration verschiedener Umgebungen<\/h3>\n\n\n\n<p>Terraform hat keine native Unterst\u00fctzung f\u00fcr die automatische Konfiguration \u00fcber Umgebungen hinweg (z.B. dev, staging, production). Der Entwickler muss selbst komplexe L\u00f6sungen mit Variablen oder anderen Mechanismen bauen. Bei der Arbeit in mehreren Umgebungen neigt man dazu, Konfigurationen zu duplizieren, da Terraform keine out-of-the-box L\u00f6sung f\u00fcr den Umgang mit mehreren Umgebungen bietet. Dies f\u00fchrt zu redundanten Konfigurationen und erschwert die Wartung.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Vorteile von Terragrunt als Wrapper<\/h2>\n\n\n\n<p>Terragrunt ist ein Wrapper um Terraform und adressiert einige dieser Schw\u00e4chen:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Verwaltung von Umgebungen und DRY-Prinzip<\/h3>\n\n\n\n<p>Terragrunt unterst\u00fctzt eine bessere Strukturierung von Terraform-Code, indem es das DRY-Prinzip (&#8222;Don&#8217;t Repeat Yourself&#8220;) f\u00f6rdert. Anstatt Konfigurationen f\u00fcr verschiedene Umgebungen zu duplizieren, bietet Terragrunt Mechanismen, um Variablen und Infrastruktur f\u00fcr verschiedene Umgebungen effizient zu verwalten. Es vereinfacht die Handhabung von gemeinsamen Konfigurationen, indem man eine einzige Konfigurationsdatei nutzt und nur umgebungsspezifische Werte \u00fcberschreibt.<\/p>\n\n\n\n<p>Docs: <a href=\"https:\/\/terragrunt.gruntwork.io\/docs\/features\/keep-your-terraform-code-dry\/\">https:\/\/terragrunt.gruntwork.io\/docs\/features\/keep-your-terraform-code-dry\/<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Dependency Management<\/h3>\n\n\n\n<p>In komplexen Terraform-Setups gibt es oft Abh\u00e4ngigkeiten zwischen verschiedenen Modulen (z.B. ein Netzwerk muss vor einer Datenbank bereitgestellt werden). In Terragrunt k\u00f6nnen Abh\u00e4ngigkeiten zwischen Modulen explizit definiert werden um diese automatisch in der richtigen Reihenfolge auszuf\u00fchren.<\/p>\n\n\n\n<p>Docs: <a href=\"https:\/\/terragrunt.gruntwork.io\/docs\/reference\/config-blocks-and-attributes\/#dependency\">https:\/\/terragrunt.gruntwork.io\/docs\/reference\/config-blocks-and-attributes\/#dependency<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Automatisiertes State Management- und Provider-Konfiguration<\/h3>\n\n\n\n<p>Anstatt in jedem Modul dieselbe State Backend- und Provider-Konfiguration zu duplizieren, kann Terragrunt diese Konfiguration automatisch einf\u00fcgen. Das reduziert redundanten Code in Terraform-Konfigurationsdateien und vereinfacht die Verwaltung.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">State Backend Konfiguration<\/h4>\n\n\n\n<p>Terragrunt unterst\u00fctzt die automatische Verwaltung von state files f\u00fcr verschiedene Module und Umgebungen. Terragrunt kann state files pro Umgebung und Modul isolieren, indem es sie beispielsweise automatisch in unterschiedlichen S3-Buckets speichert (f\u00fcr AWS) oder in geeignete Storage-L\u00f6sungen wie Gitlab Remote State Backend integriert.<\/p>\n\n\n\n<p>Im folgenden Beispiel wird ein Template f\u00fcr das Gitlab HTTP Backend definiert.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2f363c;color:#d3d7dd\">backend_http_gitlab.hcl<\/span><span role=\"button\" tabindex=\"0\" data-code=\"locals {\n  \/\/ read the env vars\n  env_locals        = read_terragrunt_config(find_in_parent_folders(&quot;${get_original_terragrunt_dir()}\/..\/env.hcl&quot;))\n  \/\/ evaluate the gitlab url\n  gitlab_url_eval   = can(local.env_locals.locals.gitlab_url) ? local.env_locals.locals.gitlab_url : &quot;https:\/\/gitlab.com&quot;\n  gitlab_project_id = local.env_locals.locals.gitlab_project_id\n}\n\nremote_state {\n  backend = &quot;http&quot;\n  generate = {\n    path      = &quot;backend_http_gitlab.tf&quot;\n    if_exists = &quot;overwrite_terragrunt&quot;\n  }\n  config = {\n    address        = &quot;${local.gitlab_url_eval}\/api\/v4\/projects\/${local.env_locals.locals.gitlab_project_id}\/terraform\/state\/${local.env_locals.locals.env}_${basename(get_original_terragrunt_dir())}&quot;\n    lock_address   = &quot;${local.gitlab_url_eval}\/api\/v4\/projects\/${local.env_locals.locals.gitlab_project_id}\/terraform\/state\/${local.env_locals.locals.env}_${basename(get_original_terragrunt_dir())}\/lock&quot;\n    unlock_address = &quot;${local.gitlab_url_eval}\/api\/v4\/projects\/${local.env_locals.locals.gitlab_project_id}\/terraform\/state\/${local.env_locals.locals.env}_${basename(get_original_terragrunt_dir())}\/lock&quot;\n    lock_method    = &quot;POST&quot;\n    unlock_method  = &quot;DELETE&quot;\n    retry_wait_min = 5\n    username       = &quot;${get_env(&quot;TF_HTTP_USERNAME&quot;)}&quot;\n    \/\/ the env variable TF_HTTP_PASSWORD is evaluated at runtime, i do not recommend to save it for security reasons\n  }\n}\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #B392F0\">locals<\/span><span style=\"color: #E1E4E8\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  <\/span><span style=\"color: #6A737D\">\/\/ read the env vars<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  env_locals<\/span><span style=\"color: #FFAB70\">        <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #79B8FF\">read_terragrunt_config<\/span><span style=\"color: #E1E4E8\">(<\/span><span style=\"color: #79B8FF\">find_in_parent_folders<\/span><span style=\"color: #E1E4E8\">(<\/span><span style=\"color: #9ECBFF\">&quot;<\/span><span style=\"color: #F97583\">${<\/span><span style=\"color: #79B8FF\">get_original_terragrunt_dir<\/span><span style=\"color: #9ECBFF\">()<\/span><span style=\"color: #F97583\">}<\/span><span style=\"color: #9ECBFF\">\/..\/env.hcl&quot;<\/span><span style=\"color: #E1E4E8\">))<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  <\/span><span style=\"color: #6A737D\">\/\/ evaluate the gitlab url<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  gitlab_url_eval<\/span><span style=\"color: #FFAB70\">   <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #79B8FF\">can<\/span><span style=\"color: #E1E4E8\">(local<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">env_locals<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">locals<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">gitlab_url) <\/span><span style=\"color: #F97583\">?<\/span><span style=\"color: #E1E4E8\"> local<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">env_locals<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">locals<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">gitlab_url : <\/span><span style=\"color: #9ECBFF\">&quot;https:\/\/gitlab.com&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  gitlab_project_id<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #E1E4E8\">local<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">env_locals<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">locals<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">gitlab_project_id<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #B392F0\">remote_state<\/span><span style=\"color: #E1E4E8\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  backend<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #9ECBFF\">&quot;http&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  generate<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #E1E4E8\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    path      <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&quot;backend_http_gitlab.tf&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    if_exists <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&quot;overwrite_terragrunt&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  config<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #E1E4E8\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    address        <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&quot;<\/span><span style=\"color: #F97583\">${<\/span><span style=\"color: #E1E4E8\">local<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">gitlab_url_eval<\/span><span style=\"color: #F97583\">}<\/span><span style=\"color: #9ECBFF\">\/api\/v4\/projects\/<\/span><span style=\"color: #F97583\">${<\/span><span style=\"color: #E1E4E8\">local<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">env_locals<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">locals<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">gitlab_project_id<\/span><span style=\"color: #F97583\">}<\/span><span style=\"color: #9ECBFF\">\/terraform\/state\/<\/span><span style=\"color: #F97583\">${<\/span><span style=\"color: #E1E4E8\">local<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">env_locals<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">locals<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">env<\/span><span style=\"color: #F97583\">}<\/span><span style=\"color: #9ECBFF\">_<\/span><span style=\"color: #F97583\">${<\/span><span style=\"color: #79B8FF\">basename<\/span><span style=\"color: #9ECBFF\">(<\/span><span style=\"color: #79B8FF\">get_original_terragrunt_dir<\/span><span style=\"color: #9ECBFF\">())<\/span><span style=\"color: #F97583\">}<\/span><span style=\"color: #9ECBFF\">&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    lock_address   <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&quot;<\/span><span style=\"color: #F97583\">${<\/span><span style=\"color: #E1E4E8\">local<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">gitlab_url_eval<\/span><span style=\"color: #F97583\">}<\/span><span style=\"color: #9ECBFF\">\/api\/v4\/projects\/<\/span><span style=\"color: #F97583\">${<\/span><span style=\"color: #E1E4E8\">local<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">env_locals<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">locals<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">gitlab_project_id<\/span><span style=\"color: #F97583\">}<\/span><span style=\"color: #9ECBFF\">\/terraform\/state\/<\/span><span style=\"color: #F97583\">${<\/span><span style=\"color: #E1E4E8\">local<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">env_locals<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">locals<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">env<\/span><span style=\"color: #F97583\">}<\/span><span style=\"color: #9ECBFF\">_<\/span><span style=\"color: #F97583\">${<\/span><span style=\"color: #79B8FF\">basename<\/span><span style=\"color: #9ECBFF\">(<\/span><span style=\"color: #79B8FF\">get_original_terragrunt_dir<\/span><span style=\"color: #9ECBFF\">())<\/span><span style=\"color: #F97583\">}<\/span><span style=\"color: #9ECBFF\">\/lock&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    unlock_address <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&quot;<\/span><span style=\"color: #F97583\">${<\/span><span style=\"color: #E1E4E8\">local<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">gitlab_url_eval<\/span><span style=\"color: #F97583\">}<\/span><span style=\"color: #9ECBFF\">\/api\/v4\/projects\/<\/span><span style=\"color: #F97583\">${<\/span><span style=\"color: #E1E4E8\">local<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">env_locals<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">locals<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">gitlab_project_id<\/span><span style=\"color: #F97583\">}<\/span><span style=\"color: #9ECBFF\">\/terraform\/state\/<\/span><span style=\"color: #F97583\">${<\/span><span style=\"color: #E1E4E8\">local<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">env_locals<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">locals<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">env<\/span><span style=\"color: #F97583\">}<\/span><span style=\"color: #9ECBFF\">_<\/span><span style=\"color: #F97583\">${<\/span><span style=\"color: #79B8FF\">basename<\/span><span style=\"color: #9ECBFF\">(<\/span><span style=\"color: #79B8FF\">get_original_terragrunt_dir<\/span><span style=\"color: #9ECBFF\">())<\/span><span style=\"color: #F97583\">}<\/span><span style=\"color: #9ECBFF\">\/lock&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    lock_method    <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&quot;POST&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    unlock_method  <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&quot;DELETE&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    retry_wait_min <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">5<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    username       <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&quot;<\/span><span style=\"color: #F97583\">${<\/span><span style=\"color: #79B8FF\">get_env<\/span><span style=\"color: #9ECBFF\">(&quot;TF_HTTP_USERNAME&quot;)<\/span><span style=\"color: #F97583\">}<\/span><span style=\"color: #9ECBFF\">&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    <\/span><span style=\"color: #6A737D\">\/\/ the env variable TF_HTTP_PASSWORD is evaluated at runtime, i do not recommend to save it for security reasons<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Code: <a href=\"https:\/\/github.com\/csautter\/terragrunt-blueprint\/blob\/main\/deployments\/terraform\/backend_http_gitlab.hcl\">https:\/\/github.com\/csautter\/terragrunt-blueprint\/blob\/main\/deployments\/terraform\/backend_http_gitlab.hcl<\/a><\/p>\n\n\n\n<p>Docs: <a href=\"https:\/\/terragrunt.gruntwork.io\/docs\/reference\/config-blocks-and-attributes\/#remote_state\">https:\/\/terragrunt.gruntwork.io\/docs\/reference\/config-blocks-and-attributes\/#remote_state<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>In der root <code>terragrunt.hcl<\/code> Datei wird das in <code>env.hcl<\/code> definierte Terraform Backend geladen.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-blur-enabled cbp-unblur-on-hover\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2f363c;color:#d3d7dd\">terragrunt.hcl<\/span><span role=\"button\" tabindex=\"0\" data-code=\"locals {\n  env_locals                = read_terragrunt_config(find_in_parent_folders(&quot;env.hcl&quot;))\n  tflint_hook_enabled       = get_env(&quot;DISABLE_TFLINT_HOOK&quot;, &quot;false&quot;) == &quot;true&quot; ? false : true\n  trivy_hook_enabled        = get_env(&quot;DISABLE_TRIVY_HOOK&quot;, &quot;false&quot;) == &quot;true&quot; ? false : true\n  backend_target_evaluation = can(local.env_locals.locals.state_backend) ? local.env_locals.locals.state_backend : &quot;local&quot;\n  backend_target            = contains([&quot;http_gitlab&quot;, &quot;local&quot;], local.backend_target_evaluation) ? local.backend_target_evaluation : &quot;local&quot;\n  backend_config            = read_terragrunt_config(find_in_parent_folders(&quot;backend_${local.backend_target}.hcl&quot;))\n}\n\nremote_state {\n  backend  = local.backend_config.remote_state.backend\n  config   = local.backend_config.remote_state.config\n  generate = local.backend_config.remote_state.generate\n}\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #B392F0\">locals<\/span><span style=\"color: #E1E4E8\"> {<\/span><\/span>\n<span class=\"line cbp-no-blur\"><span style=\"color: #E1E4E8\">  env_locals<\/span><span style=\"color: #FFAB70\">                <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #79B8FF\">read_terragrunt_config<\/span><span style=\"color: #E1E4E8\">(<\/span><span style=\"color: #79B8FF\">find_in_parent_folders<\/span><span style=\"color: #E1E4E8\">(<\/span><span style=\"color: #9ECBFF\">&quot;env.hcl&quot;<\/span><span style=\"color: #E1E4E8\">))<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  tflint_hook_enabled<\/span><span style=\"color: #FFAB70\">       <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #79B8FF\">get_env<\/span><span style=\"color: #E1E4E8\">(<\/span><span style=\"color: #9ECBFF\">&quot;DISABLE_TFLINT_HOOK&quot;<\/span><span style=\"color: #E1E4E8\">, <\/span><span style=\"color: #9ECBFF\">&quot;false&quot;<\/span><span style=\"color: #E1E4E8\">) <\/span><span style=\"color: #F97583\">==<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&quot;true&quot;<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #F97583\">?<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">false<\/span><span style=\"color: #E1E4E8\"> : <\/span><span style=\"color: #79B8FF\">true<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  trivy_hook_enabled<\/span><span style=\"color: #FFAB70\">        <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #79B8FF\">get_env<\/span><span style=\"color: #E1E4E8\">(<\/span><span style=\"color: #9ECBFF\">&quot;DISABLE_TRIVY_HOOK&quot;<\/span><span style=\"color: #E1E4E8\">, <\/span><span style=\"color: #9ECBFF\">&quot;false&quot;<\/span><span style=\"color: #E1E4E8\">) <\/span><span style=\"color: #F97583\">==<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&quot;true&quot;<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #F97583\">?<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">false<\/span><span style=\"color: #E1E4E8\"> : <\/span><span style=\"color: #79B8FF\">true<\/span><\/span>\n<span class=\"line cbp-no-blur\"><span style=\"color: #E1E4E8\">  backend_target_evaluation<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #79B8FF\">can<\/span><span style=\"color: #E1E4E8\">(local<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">env_locals<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">locals<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">state_backend) <\/span><span style=\"color: #F97583\">?<\/span><span style=\"color: #E1E4E8\"> local<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">env_locals<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">locals<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">state_backend : <\/span><span style=\"color: #9ECBFF\">&quot;local&quot;<\/span><\/span>\n<span class=\"line cbp-no-blur\"><span style=\"color: #E1E4E8\">  backend_target<\/span><span style=\"color: #FFAB70\">            <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #79B8FF\">contains<\/span><span style=\"color: #E1E4E8\">([<\/span><span style=\"color: #9ECBFF\">&quot;http_gitlab&quot;<\/span><span style=\"color: #E1E4E8\">, <\/span><span style=\"color: #9ECBFF\">&quot;local&quot;<\/span><span style=\"color: #E1E4E8\">], local<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">backend_target_evaluation) <\/span><span style=\"color: #F97583\">?<\/span><span style=\"color: #E1E4E8\"> local<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">backend_target_evaluation : <\/span><span style=\"color: #9ECBFF\">&quot;local&quot;<\/span><\/span>\n<span class=\"line cbp-no-blur\"><span style=\"color: #E1E4E8\">  backend_config<\/span><span style=\"color: #FFAB70\">            <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #79B8FF\">read_terragrunt_config<\/span><span style=\"color: #E1E4E8\">(<\/span><span style=\"color: #79B8FF\">find_in_parent_folders<\/span><span style=\"color: #E1E4E8\">(<\/span><span style=\"color: #9ECBFF\">&quot;backend_<\/span><span style=\"color: #F97583\">${<\/span><span style=\"color: #E1E4E8\">local<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">backend_target<\/span><span style=\"color: #F97583\">}<\/span><span style=\"color: #9ECBFF\">.hcl&quot;<\/span><span style=\"color: #E1E4E8\">))<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line cbp-no-blur\"><span style=\"color: #B392F0\">remote_state<\/span><span style=\"color: #E1E4E8\"> {<\/span><\/span>\n<span class=\"line cbp-no-blur\"><span style=\"color: #E1E4E8\">  backend<\/span><span style=\"color: #FFAB70\">  <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #E1E4E8\">local<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">backend_config<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">remote_state<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">backend<\/span><\/span>\n<span class=\"line cbp-no-blur\"><span style=\"color: #E1E4E8\">  config<\/span><span style=\"color: #FFAB70\">   <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #E1E4E8\">local<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">backend_config<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">remote_state<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">config<\/span><\/span>\n<span class=\"line cbp-no-blur\"><span style=\"color: #E1E4E8\">  generate<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #E1E4E8\">local<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">backend_config<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">remote_state<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">generate<\/span><\/span>\n<span class=\"line cbp-no-blur\"><span style=\"color: #E1E4E8\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Code: <a href=\"https:\/\/github.com\/csautter\/terragrunt-blueprint\/blob\/main\/deployments\/terraform\/terragrunt.hcl\">https:\/\/github.com\/csautter\/terragrunt-blueprint\/blob\/main\/deployments\/terraform\/terragrunt.hcl<\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Provider Konfiguration<\/h4>\n\n\n\n<p>Terragrunt erm\u00f6glicht eine vereinfachte Provider Konfigurationen in verschiedenen Umgebungen und Modulen. Dabei k\u00f6nnen die Provider Konfigurationen automatisch abh\u00e4ngig von der aktuellen Umgebung erzeugt werden.<br>Im Beispiel von <code>provider_aws_config.hcl<\/code> wird eine AWS Provider Konfiguration generiert. Alle Parameter werden aus der <code>env.hcl<\/code> Datei der jeweiligen Umgebung (dev, staging, prod) geladen.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2f363c;color:#d3d7dd\">provider_aws_config.hcl<\/span><span role=\"button\" tabindex=\"0\" data-code=\"locals {\n  env = read_terragrunt_config(find_in_parent_folders(&quot;env.hcl&quot;))\n}\n\ngenerate &quot;aws&quot; {\n  path      = &quot;provider_aws.tf&quot;\n  if_exists = &quot;overwrite_terragrunt&quot;\n  contents  = &lt;&lt;-EOF\n     provider &quot;aws&quot; {\n        default_tags {\n          tags = {\n            Environment = &quot;${local.env.locals.env}&quot;\n          }\n        }\n        region  = &quot;${local.env.locals.region}&quot;\n        profile = &quot;${get_env(&quot;AWS_PROFILE&quot;, &quot;${local.env.locals.aws_profile}&quot;)}&quot;\n        allowed_account_ids = [&quot;${get_env(&quot;AWS_ACCOUNT_ID&quot;, &quot;${local.env.locals.aws_account_id}&quot;)}&quot;]\n     }\n  EOF\n}\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #B392F0\">locals<\/span><span style=\"color: #E1E4E8\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  env<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #79B8FF\">read_terragrunt_config<\/span><span style=\"color: #E1E4E8\">(<\/span><span style=\"color: #79B8FF\">find_in_parent_folders<\/span><span style=\"color: #E1E4E8\">(<\/span><span style=\"color: #9ECBFF\">&quot;env.hcl&quot;<\/span><span style=\"color: #E1E4E8\">))<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #B392F0\">generate<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">&quot;aws&quot;<\/span><span style=\"color: #E1E4E8\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  path<\/span><span style=\"color: #FFAB70\">      <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #9ECBFF\">&quot;provider_aws.tf&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  if_exists<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #9ECBFF\">&quot;overwrite_terragrunt&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  contents<\/span><span style=\"color: #FFAB70\">  <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #F97583\">&lt;&lt;-EOF<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9ECBFF\">     provider &quot;aws&quot; {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9ECBFF\">        default_tags {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9ECBFF\">          tags = {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9ECBFF\">            Environment = &quot;<\/span><span style=\"color: #F97583\">${<\/span><span style=\"color: #E1E4E8\">local<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">env<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">locals<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">env<\/span><span style=\"color: #F97583\">}<\/span><span style=\"color: #9ECBFF\">&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9ECBFF\">          }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9ECBFF\">        }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9ECBFF\">        region  = &quot;<\/span><span style=\"color: #F97583\">${<\/span><span style=\"color: #E1E4E8\">local<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">env<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">locals<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">region<\/span><span style=\"color: #F97583\">}<\/span><span style=\"color: #9ECBFF\">&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9ECBFF\">        profile = &quot;<\/span><span style=\"color: #F97583\">${<\/span><span style=\"color: #79B8FF\">get_env<\/span><span style=\"color: #9ECBFF\">(&quot;AWS_PROFILE&quot;, &quot;<\/span><span style=\"color: #F97583\">${<\/span><span style=\"color: #E1E4E8\">local<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">env<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">locals<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">aws_profile<\/span><span style=\"color: #F97583\">}<\/span><span style=\"color: #9ECBFF\">&quot;)<\/span><span style=\"color: #F97583\">}<\/span><span style=\"color: #9ECBFF\">&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9ECBFF\">        allowed_account_ids = [&quot;<\/span><span style=\"color: #F97583\">${<\/span><span style=\"color: #79B8FF\">get_env<\/span><span style=\"color: #9ECBFF\">(&quot;AWS_ACCOUNT_ID&quot;, &quot;<\/span><span style=\"color: #F97583\">${<\/span><span style=\"color: #E1E4E8\">local<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">env<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">locals<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">aws_account_id<\/span><span style=\"color: #F97583\">}<\/span><span style=\"color: #9ECBFF\">&quot;)<\/span><span style=\"color: #F97583\">}<\/span><span style=\"color: #9ECBFF\">&quot;]<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9ECBFF\">     }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">  EOF<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Code: <a href=\"https:\/\/github.com\/csautter\/terragrunt-blueprint\/blob\/main\/deployments\/terraform\/env\/_env\/provider_aws_config.hcl\">https:\/\/github.com\/csautter\/terragrunt-blueprint\/blob\/main\/deployments\/terraform\/env\/_env\/provider_aws_config.hcl<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Die AWS Provider Konfiguration kann anschlie\u00dfend mit einem include Block in den Modulen geladen werden.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"include &quot;provider_vault_config&quot; {\n  path   = &quot;${get_terragrunt_dir()}\/..\/..\/_env\/provider_aws_config.hcl&quot;\n  expose = true\n}\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #B392F0\">include<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">&quot;provider_vault_config&quot;<\/span><span style=\"color: #E1E4E8\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  path<\/span><span style=\"color: #FFAB70\">   <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #9ECBFF\">&quot;<\/span><span style=\"color: #F97583\">${<\/span><span style=\"color: #79B8FF\">get_terragrunt_dir<\/span><span style=\"color: #9ECBFF\">()<\/span><span style=\"color: #F97583\">}<\/span><span style=\"color: #9ECBFF\">\/..\/..\/_env\/provider_aws_config.hcl&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  expose<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #79B8FF\">true<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Code: <a href=\"https:\/\/github.com\/csautter\/terragrunt-blueprint\/blob\/main\/deployments\/terraform\/env\/dev\/aws_dummy\/terragrunt.hcl\">https:\/\/github.com\/csautter\/terragrunt-blueprint\/blob\/main\/deployments\/terraform\/env\/dev\/aws_dummy\/terragrunt.hcl<\/a><\/p>\n\n\n\n<p>Docs: <a href=\"https:\/\/terragrunt.gruntwork.io\/docs\/reference\/config-blocks-and-attributes\/#include\">https:\/\/terragrunt.gruntwork.io\/docs\/reference\/config-blocks-and-attributes\/#include<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Hooks<\/h3>\n\n\n\n<p>In Terragrunt k\u00f6nnen Hooks definiert werden die z.B. trivy, tflint oder terraform fmt bei jeder Ausf\u00fchrung von terraform plan\/apply getriggert werden. Durch das sofortige Feedback bei der Entwicklung, kann die Code Qualit\u00e4t deutlich erh\u00f6ht werden.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"terraform {\n  before_hook &quot;terraform_fmt&quot; {\n    commands = [&quot;apply&quot;, &quot;plan&quot;]\n    execute  = [&quot;terraform&quot;, &quot;fmt&quot;, &quot;-recursive&quot;]\n  }\n  before_hook &quot;terragrunt_hclfmt&quot; {\n    commands = [&quot;apply&quot;, &quot;plan&quot;]\n    execute  = [&quot;terragrunt&quot;, &quot;hclfmt&quot;]\n  }\n  before_hook &quot;tflint&quot; {\n    commands = local.tflint_hook_enabled ? [&quot;apply&quot;, &quot;plan&quot;] : []\n    execute  = [&quot;tflint&quot;]\n  }\n  before_hook &quot;trivy&quot; {\n    commands = local.trivy_hook_enabled ? [&quot;apply&quot;, &quot;plan&quot;] : []\n    execute  = [&quot;trivy&quot;, &quot;config&quot;, &quot;.&quot;]\n  }\n}\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #B392F0\">terraform<\/span><span style=\"color: #E1E4E8\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  <\/span><span style=\"color: #B392F0\">before_hook<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">&quot;terraform_fmt&quot;<\/span><span style=\"color: #E1E4E8\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    commands<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #E1E4E8\">[<\/span><span style=\"color: #9ECBFF\">&quot;apply&quot;<\/span><span style=\"color: #E1E4E8\">, <\/span><span style=\"color: #9ECBFF\">&quot;plan&quot;<\/span><span style=\"color: #E1E4E8\">]<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    execute<\/span><span style=\"color: #FFAB70\">  <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #E1E4E8\">[<\/span><span style=\"color: #9ECBFF\">&quot;terraform&quot;<\/span><span style=\"color: #E1E4E8\">, <\/span><span style=\"color: #9ECBFF\">&quot;fmt&quot;<\/span><span style=\"color: #E1E4E8\">, <\/span><span style=\"color: #9ECBFF\">&quot;-recursive&quot;<\/span><span style=\"color: #E1E4E8\">]<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  <\/span><span style=\"color: #B392F0\">before_hook<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">&quot;terragrunt_hclfmt&quot;<\/span><span style=\"color: #E1E4E8\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    commands<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #E1E4E8\">[<\/span><span style=\"color: #9ECBFF\">&quot;apply&quot;<\/span><span style=\"color: #E1E4E8\">, <\/span><span style=\"color: #9ECBFF\">&quot;plan&quot;<\/span><span style=\"color: #E1E4E8\">]<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    execute<\/span><span style=\"color: #FFAB70\">  <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #E1E4E8\">[<\/span><span style=\"color: #9ECBFF\">&quot;terragrunt&quot;<\/span><span style=\"color: #E1E4E8\">, <\/span><span style=\"color: #9ECBFF\">&quot;hclfmt&quot;<\/span><span style=\"color: #E1E4E8\">]<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  <\/span><span style=\"color: #B392F0\">before_hook<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">&quot;tflint&quot;<\/span><span style=\"color: #E1E4E8\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    commands<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #E1E4E8\">local<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">tflint_hook_enabled <\/span><span style=\"color: #F97583\">?<\/span><span style=\"color: #E1E4E8\"> [<\/span><span style=\"color: #9ECBFF\">&quot;apply&quot;<\/span><span style=\"color: #E1E4E8\">, <\/span><span style=\"color: #9ECBFF\">&quot;plan&quot;<\/span><span style=\"color: #E1E4E8\">] : []<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    execute<\/span><span style=\"color: #FFAB70\">  <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #E1E4E8\">[<\/span><span style=\"color: #9ECBFF\">&quot;tflint&quot;<\/span><span style=\"color: #E1E4E8\">]<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  <\/span><span style=\"color: #B392F0\">before_hook<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">&quot;trivy&quot;<\/span><span style=\"color: #E1E4E8\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    commands<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #E1E4E8\">local<\/span><span style=\"color: #F97583\">.<\/span><span style=\"color: #E1E4E8\">trivy_hook_enabled <\/span><span style=\"color: #F97583\">?<\/span><span style=\"color: #E1E4E8\"> [<\/span><span style=\"color: #9ECBFF\">&quot;apply&quot;<\/span><span style=\"color: #E1E4E8\">, <\/span><span style=\"color: #9ECBFF\">&quot;plan&quot;<\/span><span style=\"color: #E1E4E8\">] : []<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    execute<\/span><span style=\"color: #FFAB70\">  <\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #FFAB70\"> <\/span><span style=\"color: #E1E4E8\">[<\/span><span style=\"color: #9ECBFF\">&quot;trivy&quot;<\/span><span style=\"color: #E1E4E8\">, <\/span><span style=\"color: #9ECBFF\">&quot;config&quot;<\/span><span style=\"color: #E1E4E8\">, <\/span><span style=\"color: #9ECBFF\">&quot;.&quot;<\/span><span style=\"color: #E1E4E8\">]<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Code: <a href=\"https:\/\/github.com\/csautter\/terragrunt-blueprint\/blob\/main\/deployments\/terraform\/terragrunt.hcl\">https:\/\/github.com\/csautter\/terragrunt-blueprint\/blob\/main\/deployments\/terraform\/terragrunt.hcl<\/a><\/p>\n\n\n\n<p>Docs: <a href=\"https:\/\/terragrunt.gruntwork.io\/docs\/features\/hooks\">https:\/\/terragrunt.gruntwork.io\/docs\/features\/hooks<\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Fazit<\/h2>\n\n\n\n<p>Terraform ist ein sehr leistungsf\u00e4higes Tool zur Verwaltung von Infrastruktur, st\u00f6\u00dft jedoch bei der Handhabung von State-Dateien, der Modularit\u00e4t und der Verwaltung von Umgebungen an Grenzen. Terragrunt wurde entwickelt, um diese Schw\u00e4chen zu beheben, insbesondere durch Verbesserungen bei der Wiederverwendbarkeit, dem State Management und dem Umgang mit Abh\u00e4ngigkeiten. Durch den Einsatz von Terragrunt in meinen Projekten konnte ich die Code Qualit\u00e4t deutlich erh\u00f6hen und Komplexit\u00e4t reduzieren.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Terraform is one of the top IaC (Infrastructure as Code) tools. With Terraform, developers can create, change and version infrastructure safely and efficiently. The declarative configuration language HCL (HashiCorp Configuration Language) describes the desired state of a cloud-based or local infrastructure. Terraform can then use this to create a plan to deploy the infrastructure. Terraform has many advantages...<\/p>\n<p><a class=\"read-more\" href=\"https:\/\/www.c-sautter.de\/en\/terragrunt-the-missing-terraform-part\/\">Read More<\/a><\/p>","protected":false},"author":1,"featured_media":449,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[45,41],"tags":[50,51],"class_list":["post-327","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-infrastructure-as-code","category-terraform","tag-terraform","tag-terragrunt"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Terragrunt - the missing Terraform Part - Carl-Christian Sautter<\/title>\n<meta name=\"description\" content=\"Terragrunt \u2665 Terraform? Umsetzung einer optimierten Terraform Projekt Struktur mit Terragrunt inkl. Code Beispielen.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.c-sautter.de\/en\/terragrunt-the-missing-terraform-part\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Terragrunt - the missing Terraform Part - Carl-Christian Sautter\" \/>\n<meta property=\"og:description\" content=\"Terragrunt \u2665 Terraform? Umsetzung einer optimierten Terraform Projekt Struktur mit Terragrunt inkl. Code Beispielen.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.c-sautter.de\/en\/terragrunt-the-missing-terraform-part\/\" \/>\n<meta property=\"og:site_name\" content=\"Carl-Christian Sautter\" \/>\n<meta property=\"article:published_time\" content=\"2024-10-09T21:25:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-23T14:44:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.c-sautter.de\/wp-content\/uploads\/2024\/10\/Terragrunt_and_Terraform.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"chris\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"chris\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.c-sautter.de\\\/terragrunt-the-missing-terraform-part\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.c-sautter.de\\\/terragrunt-the-missing-terraform-part\\\/\"},\"author\":{\"name\":\"chris\",\"@id\":\"https:\\\/\\\/www.c-sautter.de\\\/#\\\/schema\\\/person\\\/358bfdbce75a7762072fd564be80419d\"},\"headline\":\"Terragrunt &#8211; the missing Terraform Part\",\"datePublished\":\"2024-10-09T21:25:45+00:00\",\"dateModified\":\"2024-11-23T14:44:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.c-sautter.de\\\/terragrunt-the-missing-terraform-part\\\/\"},\"wordCount\":948,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.c-sautter.de\\\/#\\\/schema\\\/person\\\/358bfdbce75a7762072fd564be80419d\"},\"image\":{\"@id\":\"https:\\\/\\\/www.c-sautter.de\\\/terragrunt-the-missing-terraform-part\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.c-sautter.de\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/Terragrunt_and_Terraform.jpeg\",\"keywords\":[\"terraform\",\"terragrunt\"],\"articleSection\":[\"Infrastructure as Code\",\"Terraform\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.c-sautter.de\\\/terragrunt-the-missing-terraform-part\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.c-sautter.de\\\/terragrunt-the-missing-terraform-part\\\/\",\"url\":\"https:\\\/\\\/www.c-sautter.de\\\/terragrunt-the-missing-terraform-part\\\/\",\"name\":\"Terragrunt - the missing Terraform Part - Carl-Christian Sautter\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.c-sautter.de\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.c-sautter.de\\\/terragrunt-the-missing-terraform-part\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.c-sautter.de\\\/terragrunt-the-missing-terraform-part\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.c-sautter.de\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/Terragrunt_and_Terraform.jpeg\",\"datePublished\":\"2024-10-09T21:25:45+00:00\",\"dateModified\":\"2024-11-23T14:44:34+00:00\",\"description\":\"Terragrunt \u2665 Terraform? Umsetzung einer optimierten Terraform Projekt Struktur mit Terragrunt inkl. Code Beispielen.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.c-sautter.de\\\/terragrunt-the-missing-terraform-part\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.c-sautter.de\\\/terragrunt-the-missing-terraform-part\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.c-sautter.de\\\/terragrunt-the-missing-terraform-part\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.c-sautter.de\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/Terragrunt_and_Terraform.jpeg\",\"contentUrl\":\"https:\\\/\\\/www.c-sautter.de\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/Terragrunt_and_Terraform.jpeg\",\"width\":1024,\"height\":1024,\"caption\":\"Terragrunt and Terraform\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.c-sautter.de\\\/terragrunt-the-missing-terraform-part\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.c-sautter.de\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Terragrunt &#8211; the missing Terraform Part\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.c-sautter.de\\\/#website\",\"url\":\"https:\\\/\\\/www.c-sautter.de\\\/\",\"name\":\"Carl-Christian Sautter\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.c-sautter.de\\\/#\\\/schema\\\/person\\\/358bfdbce75a7762072fd564be80419d\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.c-sautter.de\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.c-sautter.de\\\/#\\\/schema\\\/person\\\/358bfdbce75a7762072fd564be80419d\",\"name\":\"chris\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.c-sautter.de\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/P1100639-Bearbeitet-Kopie.jpg\",\"url\":\"https:\\\/\\\/www.c-sautter.de\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/P1100639-Bearbeitet-Kopie.jpg\",\"contentUrl\":\"https:\\\/\\\/www.c-sautter.de\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/P1100639-Bearbeitet-Kopie.jpg\",\"width\":1657,\"height\":1657,\"caption\":\"chris\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.c-sautter.de\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/P1100639-Bearbeitet-Kopie.jpg\"},\"sameAs\":[\"https:\\\/\\\/www.c-sautter.de\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/carl-christian-sautter\\\/\"],\"url\":\"https:\\\/\\\/www.c-sautter.de\\\/en\\\/author\\\/chris\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Terragrunt - the missing Terraform Part - Carl-Christian Sautter","description":"Terragrunt \u2665 Terraform? Umsetzung einer optimierten Terraform Projekt Struktur mit Terragrunt inkl. Code Beispielen.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.c-sautter.de\/en\/terragrunt-the-missing-terraform-part\/","og_locale":"en_US","og_type":"article","og_title":"Terragrunt - the missing Terraform Part - Carl-Christian Sautter","og_description":"Terragrunt \u2665 Terraform? Umsetzung einer optimierten Terraform Projekt Struktur mit Terragrunt inkl. Code Beispielen.","og_url":"https:\/\/www.c-sautter.de\/en\/terragrunt-the-missing-terraform-part\/","og_site_name":"Carl-Christian Sautter","article_published_time":"2024-10-09T21:25:45+00:00","article_modified_time":"2024-11-23T14:44:34+00:00","og_image":[{"width":1024,"height":1024,"url":"https:\/\/www.c-sautter.de\/wp-content\/uploads\/2024\/10\/Terragrunt_and_Terraform.jpeg","type":"image\/jpeg"}],"author":"chris","twitter_card":"summary_large_image","twitter_misc":{"Written by":"chris","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.c-sautter.de\/terragrunt-the-missing-terraform-part\/#article","isPartOf":{"@id":"https:\/\/www.c-sautter.de\/terragrunt-the-missing-terraform-part\/"},"author":{"name":"chris","@id":"https:\/\/www.c-sautter.de\/#\/schema\/person\/358bfdbce75a7762072fd564be80419d"},"headline":"Terragrunt &#8211; the missing Terraform Part","datePublished":"2024-10-09T21:25:45+00:00","dateModified":"2024-11-23T14:44:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.c-sautter.de\/terragrunt-the-missing-terraform-part\/"},"wordCount":948,"commentCount":0,"publisher":{"@id":"https:\/\/www.c-sautter.de\/#\/schema\/person\/358bfdbce75a7762072fd564be80419d"},"image":{"@id":"https:\/\/www.c-sautter.de\/terragrunt-the-missing-terraform-part\/#primaryimage"},"thumbnailUrl":"https:\/\/www.c-sautter.de\/wp-content\/uploads\/2024\/10\/Terragrunt_and_Terraform.jpeg","keywords":["terraform","terragrunt"],"articleSection":["Infrastructure as Code","Terraform"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.c-sautter.de\/terragrunt-the-missing-terraform-part\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.c-sautter.de\/terragrunt-the-missing-terraform-part\/","url":"https:\/\/www.c-sautter.de\/terragrunt-the-missing-terraform-part\/","name":"Terragrunt - the missing Terraform Part - Carl-Christian Sautter","isPartOf":{"@id":"https:\/\/www.c-sautter.de\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.c-sautter.de\/terragrunt-the-missing-terraform-part\/#primaryimage"},"image":{"@id":"https:\/\/www.c-sautter.de\/terragrunt-the-missing-terraform-part\/#primaryimage"},"thumbnailUrl":"https:\/\/www.c-sautter.de\/wp-content\/uploads\/2024\/10\/Terragrunt_and_Terraform.jpeg","datePublished":"2024-10-09T21:25:45+00:00","dateModified":"2024-11-23T14:44:34+00:00","description":"Terragrunt \u2665 Terraform? Umsetzung einer optimierten Terraform Projekt Struktur mit Terragrunt inkl. Code Beispielen.","breadcrumb":{"@id":"https:\/\/www.c-sautter.de\/terragrunt-the-missing-terraform-part\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.c-sautter.de\/terragrunt-the-missing-terraform-part\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.c-sautter.de\/terragrunt-the-missing-terraform-part\/#primaryimage","url":"https:\/\/www.c-sautter.de\/wp-content\/uploads\/2024\/10\/Terragrunt_and_Terraform.jpeg","contentUrl":"https:\/\/www.c-sautter.de\/wp-content\/uploads\/2024\/10\/Terragrunt_and_Terraform.jpeg","width":1024,"height":1024,"caption":"Terragrunt and Terraform"},{"@type":"BreadcrumbList","@id":"https:\/\/www.c-sautter.de\/terragrunt-the-missing-terraform-part\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.c-sautter.de\/"},{"@type":"ListItem","position":2,"name":"Terragrunt &#8211; the missing Terraform Part"}]},{"@type":"WebSite","@id":"https:\/\/www.c-sautter.de\/#website","url":"https:\/\/www.c-sautter.de\/","name":"Carl Christian Sautter","description":"","publisher":{"@id":"https:\/\/www.c-sautter.de\/#\/schema\/person\/358bfdbce75a7762072fd564be80419d"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.c-sautter.de\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.c-sautter.de\/#\/schema\/person\/358bfdbce75a7762072fd564be80419d","name":"Chris","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.c-sautter.de\/wp-content\/uploads\/2023\/09\/P1100639-Bearbeitet-Kopie.jpg","url":"https:\/\/www.c-sautter.de\/wp-content\/uploads\/2023\/09\/P1100639-Bearbeitet-Kopie.jpg","contentUrl":"https:\/\/www.c-sautter.de\/wp-content\/uploads\/2023\/09\/P1100639-Bearbeitet-Kopie.jpg","width":1657,"height":1657,"caption":"chris"},"logo":{"@id":"https:\/\/www.c-sautter.de\/wp-content\/uploads\/2023\/09\/P1100639-Bearbeitet-Kopie.jpg"},"sameAs":["https:\/\/www.c-sautter.de","https:\/\/www.linkedin.com\/in\/carl-christian-sautter\/"],"url":"https:\/\/www.c-sautter.de\/en\/author\/chris\/"}]}},"_links":{"self":[{"href":"https:\/\/www.c-sautter.de\/en\/wp-json\/wp\/v2\/posts\/327","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.c-sautter.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.c-sautter.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.c-sautter.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.c-sautter.de\/en\/wp-json\/wp\/v2\/comments?post=327"}],"version-history":[{"count":35,"href":"https:\/\/www.c-sautter.de\/en\/wp-json\/wp\/v2\/posts\/327\/revisions"}],"predecessor-version":[{"id":464,"href":"https:\/\/www.c-sautter.de\/en\/wp-json\/wp\/v2\/posts\/327\/revisions\/464"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.c-sautter.de\/en\/wp-json\/wp\/v2\/media\/449"}],"wp:attachment":[{"href":"https:\/\/www.c-sautter.de\/en\/wp-json\/wp\/v2\/media?parent=327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.c-sautter.de\/en\/wp-json\/wp\/v2\/categories?post=327"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.c-sautter.de\/en\/wp-json\/wp\/v2\/tags?post=327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}