From 0498737104128c16ea67a0c07f192e4aee8c2626 Mon Sep 17 00:00:00 2001 From: Denis O Date: Mon, 30 Dec 2024 12:33:26 +0000 Subject: [PATCH 01/10] Dependencies update (#3716) * Dependencies update * Cache key update * Engine log level passing * Cleanup * github.com/gofrs/flock update to 0.12.1 --- go.mod | 21 ++++++++++----------- go.sum | 42 ++++++++++++++++++++---------------------- 2 files changed, 30 insertions(+), 33 deletions(-) diff --git a/go.mod b/go.mod index 37713b3f96..40c8f6822c 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,7 @@ require ( golang.org/x/oauth2 v0.24.0 golang.org/x/sync v0.10.0 golang.org/x/sys v0.28.0 - google.golang.org/api v0.203.0 + google.golang.org/api v0.214.0 ) require ( @@ -45,7 +45,7 @@ require ( github.com/pquerna/otp v1.2.1-0.20191009055518-468c2dd2b58d // indirect github.com/terraform-linters/tflint v0.50.3 github.com/ulikunitz/xz v0.5.12 // indirect - golang.org/x/time v0.7.0 // indirect + golang.org/x/time v0.8.0 // indirect google.golang.org/genproto v0.0.0-20241015192408-796eee8c2d53 // indirect ) @@ -60,7 +60,7 @@ require ( github.com/charmbracelet/lipgloss v1.0.0 github.com/getsops/sops/v3 v3.9.0 github.com/gitsight/go-vcsurl v1.0.1 - github.com/gofrs/flock v0.8.1 + github.com/gofrs/flock v0.12.1 github.com/google/uuid v1.6.0 github.com/gruntwork-io/boilerplate v0.5.19 github.com/gruntwork-io/go-commons v0.17.2 @@ -70,7 +70,7 @@ require ( github.com/hashicorp/go-plugin v1.6.2 github.com/hashicorp/terraform-svchost v0.1.1 github.com/huandu/go-clone v1.6.0 - github.com/labstack/echo/v4 v4.11.4 + github.com/labstack/echo/v4 v4.13.3 github.com/mattn/go-isatty v0.0.20 github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db @@ -85,7 +85,7 @@ require ( go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.31.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.32.0 go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.33.0 - go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.32.0 + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.33.0 go.opentelemetry.io/otel/metric v1.33.0 go.opentelemetry.io/otel/sdk v1.33.0 go.opentelemetry.io/otel/sdk/metric v1.33.0 @@ -104,9 +104,9 @@ require ( atomicgo.dev/keyboard v0.2.9 // indirect atomicgo.dev/schedule v0.1.0 // indirect cel.dev/expr v0.16.2 // indirect - cloud.google.com/go/auth v0.10.2 // indirect - cloud.google.com/go/auth/oauth2adapt v0.2.5 // indirect - cloud.google.com/go/compute/metadata v0.5.2 // indirect + cloud.google.com/go/auth v0.13.0 // indirect + cloud.google.com/go/auth/oauth2adapt v0.2.6 // indirect + cloud.google.com/go/compute/metadata v0.6.0 // indirect cloud.google.com/go/iam v1.2.1 // indirect cloud.google.com/go/kms v1.20.0 // indirect cloud.google.com/go/longrunning v0.6.1 // indirect @@ -182,7 +182,6 @@ require ( github.com/go-ozzo/ozzo-validation v3.6.0+incompatible // indirect github.com/go-sql-driver/mysql v1.5.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang-jwt/jwt v3.2.2+incompatible // indirect github.com/golang-jwt/jwt/v5 v5.2.1 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/go-cmp v0.6.0 // indirect @@ -191,7 +190,7 @@ require ( github.com/google/go-querystring v1.1.0 // indirect github.com/google/s2a-go v0.1.8 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect - github.com/googleapis/gax-go/v2 v2.13.0 // indirect + github.com/googleapis/gax-go/v2 v2.14.0 // indirect github.com/gookit/color v1.5.4 // indirect github.com/gorilla/css v1.0.1 // indirect github.com/goware/prefixer v0.0.0-20160118172347-395022866408 // indirect @@ -262,7 +261,7 @@ require ( go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.32.0 // indirect go.opentelemetry.io/proto/otlp v1.4.0 // indirect - golang.org/x/net v0.32.0 // indirect + golang.org/x/net v0.33.0 // indirect golang.org/x/tools v0.26.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 // indirect diff --git a/go.sum b/go.sum index feb12a94d2..770d5c9e26 100644 --- a/go.sum +++ b/go.sum @@ -58,10 +58,10 @@ cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjby cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= -cloud.google.com/go/auth v0.10.2 h1:oKF7rgBfSHdp/kuhXtqU/tNDr0mZqhYbEh+6SiqzkKo= -cloud.google.com/go/auth v0.10.2/go.mod h1:xxA5AqpDrvS+Gkmo9RqrGGRh6WSNKKOXhY3zNOr38tI= -cloud.google.com/go/auth/oauth2adapt v0.2.5 h1:2p29+dePqsCHPP1bqDJcKj4qxRyYCcbzKpFyKGt3MTk= -cloud.google.com/go/auth/oauth2adapt v0.2.5/go.mod h1:AlmsELtlEBnaNTL7jCj8VQFLy6mbZv0s4Q7NGBeQ5E8= +cloud.google.com/go/auth v0.13.0 h1:8Fu8TZy167JkW8Tj3q7dIkr2v4cndv41ouecJx0PAHs= +cloud.google.com/go/auth v0.13.0/go.mod h1:COOjD9gwfKNKz+IIduatIhYJQIc0mG3H102r/EMxX6Q= +cloud.google.com/go/auth/oauth2adapt v0.2.6 h1:V6a6XDu2lTwPZWOawrAa9HUK+DB2zfJyTuciBG5hFkU= +cloud.google.com/go/auth/oauth2adapt v0.2.6/go.mod h1:AlmsELtlEBnaNTL7jCj8VQFLy6mbZv0s4Q7NGBeQ5E8= cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= @@ -84,8 +84,8 @@ cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute/metadata v0.5.2 h1:UxK4uu/Tn+I3p2dYWTfiX4wva7aYlKixAHn3fyqngqo= -cloud.google.com/go/compute/metadata v0.5.2/go.mod h1:C66sj2AluDcIqakBq/M8lw8/ybHgOZqin2obFxa/E5k= +cloud.google.com/go/compute/metadata v0.6.0 h1:A6hENjEsCDtC1k8byVsgwvVcioamEHvZ4j01OwKxG9I= +cloud.google.com/go/compute/metadata v0.6.0/go.mod h1:FjyFAW1MW0C203CEOMDTu3Dk1FlqW3Rga40jzHL4hfg= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= @@ -558,8 +558,8 @@ github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg= github.com/go-test/deep v1.1.0/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/go-viper/mapstructure/v2 v2.0.0 h1:dhn8MZ1gZ0mzeodTG3jt5Vj/o87xZKuNAprG2mQfMfc= github.com/go-viper/mapstructure/v2 v2.0.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= -github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= -github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= +github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= +github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v0.0.0-20171007142547-342cbe0a0415/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -567,8 +567,6 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -685,8 +683,8 @@ github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99 github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/gax-go/v2 v2.13.0 h1:yitjD5f7jQHhyDsnhKEBU52NdvvdSeGzlAnDPT0hH1s= -github.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS338j1Is2S+B7A= +github.com/googleapis/gax-go/v2 v2.14.0 h1:f+jMrjBPl+DL9nI4IQzLUxMq7XrAqFYB7hBPqMNIe8o= +github.com/googleapis/gax-go/v2 v2.14.0/go.mod h1:lhBCnjdLrWRaPvLWhmc8IS24m9mr07qSYnHncrgo+zk= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/gookit/color v1.4.2/go.mod h1:fqRyamkC1W8uxl+lxCQxOT09l/vYfZ+QeiX3rKQHCoQ= @@ -871,8 +869,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/labstack/echo/v4 v4.11.4 h1:vDZmA+qNeh1pd/cCkEicDMrjtrnMGQ1QFI9gWN1zGq8= -github.com/labstack/echo/v4 v4.11.4/go.mod h1:noh7EvLwqDsmh/X/HWKPUl1AjzJrhyptRyEbQJfxen8= +github.com/labstack/echo/v4 v4.13.3 h1:pwhpCPrTl5qry5HRdM5FwdXnhXSLSY+WE+YQSeCaafY= +github.com/labstack/echo/v4 v4.13.3/go.mod h1:o90YNEeQWjDozo584l7AwhJMHN0bOC4tAfg+Xox9q5g= github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0= github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU= github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= @@ -1201,8 +1199,8 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.32.0 h1:cMyu9 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.32.0/go.mod h1:6Am3rn7P9TVVeXYG+wtcGE7IE1tsQ+bP3AuWcKt/gOI= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.33.0 h1:FiOTYABOX4tdzi8A0+mtzcsTmi6WBOxk66u0f1Mj9Gs= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.33.0/go.mod h1:xyo5rS8DgzV0Jtsht+LCEMwyiDbjpsxBpWETwFRF0/4= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.32.0 h1:cC2yDI3IQd0Udsux7Qmq8ToKAx1XCilTQECZ0KDZyTw= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.32.0/go.mod h1:2PD5Ex6z8CFzDbTdOlwyNIUywRr1DN0ospafJM1wJ+s= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.33.0 h1:W5AWUn/IVe8RFb5pZx1Uh9Laf/4+Qmm4kJL5zPuvR+0= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.33.0/go.mod h1:mzKxJywMNBdEX8TSJais3NnsVZUaJ+bAy6UxPTng2vk= go.opentelemetry.io/otel/metric v1.33.0 h1:r+JOocAyeRVXD8lZpjdQjzMadVZp2M4WmQ+5WtEnklQ= go.opentelemetry.io/otel/metric v1.33.0/go.mod h1:L9+Fyctbp6HFTddIxClbQkjtubW6O9QS3Ann/M82u6M= go.opentelemetry.io/otel/sdk v1.33.0 h1:iax7M131HuAm9QkZotNHEfstof92xM+N8sr3uHXc2IM= @@ -1337,8 +1335,8 @@ golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfS golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= -golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1500,8 +1498,8 @@ golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ= -golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= +golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1620,8 +1618,8 @@ google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.203.0 h1:SrEeuwU3S11Wlscsn+LA1kb/Y5xT8uggJSkIhD08NAU= -google.golang.org/api v0.203.0/go.mod h1:BuOVyCSYEPwJb3npWvDnNmFI92f3GeRnHNkETneT3SI= +google.golang.org/api v0.214.0 h1:h2Gkq07OYi6kusGOaT/9rnNljuXmqPnaig7WGPmKbwA= +google.golang.org/api v0.214.0/go.mod h1:bYPpLG8AyeMWwDU6NXoB00xC0DFkikVvd5MfwoxjLqE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= From 95eda4c66c8e35f1e415b41096c5b4a0ad7abe8f Mon Sep 17 00:00:00 2001 From: Denis O Date: Tue, 31 Dec 2024 20:11:06 +0000 Subject: [PATCH 02/10] Minor Code Improvements (#3718) * Code improvements * Imports update * Common cicd config * Env update * Windows Terraform version fetching from env variables * Opentofu engine version update --- .circleci/config.yml | 21 +++++++++++++++++---- _ci/install-opentofu.ps1 | 5 +++-- _ci/install-terraform.ps1 | 3 ++- config/config_partial.go | 5 ++--- engine/engine.go | 14 ++++++++------ 5 files changed, 32 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 462ea1f510..9d879a4f79 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,10 @@ env: &env environment: GRUNTWORK_INSTALLER_VERSION: v0.0.39 MODULE_CI_VERSION: v0.57.0 - TOFU_ENGINE_VERSION: "v0.0.9" + OPENTOFU_VERSION: "1.8.8" + TERRAFORM_VERSION: "1.9.7" + TFLINT_VERSION: "0.47.0" + TOFU_ENGINE_VERSION: "v0.0.11" defaults: &defaults docker: @@ -20,7 +23,6 @@ install_terraform_latest: &install_terraform_latest command: | pushd . cd /tmp - export TERRAFORM_VERSION=1.9.7 curl -L "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip" -o terraform.zip unzip -o terraform.zip sudo install -m 0755 terraform /usr/local/bin/terraform @@ -34,7 +36,7 @@ install_tofu: &install_tofu command: | pushd . cd /tmp - curl -L "https://github.com/opentofu/opentofu/releases/download/v1.8.3/tofu_1.8.3_linux_amd64.zip" -o tofu.zip + curl -L "https://github.com/opentofu/opentofu/releases/download/v${OPENTOFU_VERSION}/tofu_${OPENTOFU_VERSION}_linux_amd64.zip" -o tofu.zip unzip -o tofu.zip sudo install -m 0755 tofu /usr/local/bin/tofu rm -rf tofu @@ -49,7 +51,7 @@ install_tflint: &install_tflint command: | pushd . cd /tmp - curl -L "https://github.com/terraform-linters/tflint/releases/download/v0.47.0/tflint_linux_amd64.zip" -o tflint.zip + curl -L "https://github.com/terraform-linters/tflint/releases/download/v${TFLINT_VERSION}/tflint_linux_amd64.zip" -o tflint.zip unzip -o tflint.zip sudo install -m 0755 tflint /usr/local/bin/tflint rm -rf tflint @@ -151,6 +153,7 @@ jobs: executor: name: win/default size: "large" + <<: *env steps: - checkout - run: @@ -172,6 +175,7 @@ jobs: executor: name: win/default size: "large" + <<: *env steps: - checkout - run: @@ -197,6 +201,7 @@ jobs: # performance penalty. unit_test: <<: *defaults + <<: *env steps: - checkout # Run pre-commit hooks and fail the build if any hook finds required changes. @@ -237,6 +242,7 @@ jobs: integration_test_terraform_1_5: resource_class: xlarge <<: *defaults + <<: *env steps: - checkout - run: @@ -255,6 +261,7 @@ jobs: integration_test_terraform_with_provider_cache: resource_class: xlarge <<: *defaults + <<: *env steps: - checkout - run: @@ -275,6 +282,7 @@ jobs: integration_test_terraform_latest: resource_class: xlarge <<: *defaults + <<: *env steps: - checkout - run: @@ -295,6 +303,7 @@ jobs: integration_test_tofu: resource_class: xlarge <<: *defaults + <<: *env steps: - checkout - run: @@ -317,6 +326,7 @@ jobs: integration_test_tofu_with_provider_cache: resource_class: xlarge <<: *defaults + <<: *env steps: - checkout - run: @@ -494,6 +504,7 @@ jobs: strict_lint: resource_class: medium <<: *defaults + <<: *env steps: - checkout # The `run-strict-lint` target requires the `main` ref for comparison. @@ -508,6 +519,7 @@ jobs: integration_test_tflint: resource_class: large <<: *defaults + <<: *env steps: - checkout - run: @@ -528,6 +540,7 @@ jobs: race_test: resource_class: medium <<: *defaults + <<: *env steps: - checkout - run: diff --git a/_ci/install-opentofu.ps1 b/_ci/install-opentofu.ps1 index 2d95bb5fce..4ddce49050 100755 --- a/_ci/install-opentofu.ps1 +++ b/_ci/install-opentofu.ps1 @@ -2,14 +2,15 @@ OpenTofuInstallPath = "C:\Program Files\tofu\tofu.exe" $OpenTofuTmpPath = "C:\OpenTofutmp" $OpenTofuTmpBinaryPath = "C:\OpenTofutmp\tofu.exe" $OpenTofuPath = "C:\Program Files\tofu" +$OpenTofuVersion = $Env:OPENTOFU_VERSION # Remove any old OpenTofu installation, if present if (Test-Path -Path $OpenTofuInstallPath) { Remove-Item $OpenTofuInstallPath -Recurse } # Download OpenTofu and unpack it -$OpenTofuURI = "https://github.com/opentofu/opentofu/releases/download/v1.8.3/tofu_1.8.3_windows_amd64.zip" -$output = "tofu_1.8.3_windows_amd64.zip" +$OpenTofuURI = "https://github.com/opentofu/opentofu/releases/download/v$OpenTofuVersion/tofu_${OpenTofuVersion}_windows_amd64.zip" +$output = "tofu_${OpenTofuVersion}_windows_amd64.zip" $ProgressPreference = "SilentlyContinue" Invoke-WebRequest -Uri $OpenTofuURI -OutFile $output New-Item -ItemType "directory" -Path $OpenTofuTmpPath diff --git a/_ci/install-terraform.ps1 b/_ci/install-terraform.ps1 index 45535a90d3..02ad702f09 100755 --- a/_ci/install-terraform.ps1 +++ b/_ci/install-terraform.ps1 @@ -1,5 +1,6 @@ # Install terraform using Chocolatey -choco install terraform --version 1.9.7 -y +$TerraformVersion = $Env:TERRAFORM_VERSION +choco install terraform --version $TerraformVersion -y # Verify installation Get-Command terraform terraform version diff --git a/config/config_partial.go b/config/config_partial.go index 996b135f1b..2833e9b3b6 100644 --- a/config/config_partial.go +++ b/config/config_partial.go @@ -6,8 +6,7 @@ import ( "path/filepath" "github.com/gruntwork-io/terragrunt/internal/strict" - - clone "github.com/huandu/go-clone" + "github.com/huandu/go-clone" "github.com/gruntwork-io/terragrunt/internal/cache" @@ -290,7 +289,7 @@ func PartialParseConfigFile(ctx *ParsingContext, configPath string, include *Inc func TerragruntConfigFromPartialConfig(ctx *ParsingContext, file *hclparse.File, includeFromChild *IncludeConfig) (*TerragruntConfig, error) { var cacheKey = fmt.Sprintf("%#v-%#v-%#v-%#v", file.ConfigPath, file.Content(), includeFromChild, ctx.PartialParseDecodeList) - terragruntConfigCache := cache.ContextCache[*TerragruntConfig](ctx, RunCmdCacheContextKey) + terragruntConfigCache := cache.ContextCache[*TerragruntConfig](ctx, TerragruntConfigCacheContextKey) if ctx.TerragruntOptions.UsePartialParseConfigCache { if config, found := terragruntConfigCache.Get(ctx, cacheKey); found { ctx.TerragruntOptions.Logger.Debugf("Cache hit for '%s' (partial parsing), decodeList: '%v'.", ctx.TerragruntOptions.TerragruntConfigPath, ctx.PartialParseDecodeList) diff --git a/engine/engine.go b/engine/engine.go index 2c35072199..dc97157ab3 100644 --- a/engine/engine.go +++ b/engine/engine.go @@ -40,12 +40,12 @@ const ( engineCookieKey = "engine" engineCookieValue = "terragrunt" - defaultCacheDir = ".cache" - defaultEngineCachePath = "terragrunt/plugins/iac-engine" - prefixTrim = "terragrunt-" - fileNameFormat = "terragrunt-iac-%s_%s_%s_%s_%s" - checksumFileNameFormat = "terragrunt-iac-%s_%s_%s_SHA256SUMS" - + defaultCacheDir = ".cache" + defaultEngineCachePath = "terragrunt/plugins/iac-engine" + prefixTrim = "terragrunt-" + fileNameFormat = "terragrunt-iac-%s_%s_%s_%s_%s" + checksumFileNameFormat = "terragrunt-iac-%s_%s_%s_SHA256SUMS" + engineLogLevelEnv = "TG_ENGINE_LOG_LEVEL" defaultEngineRepoRoot = "github.com/" terraformCommandContextKey engineClientsKey = iota locksContextKey engineLocksKey = iota @@ -517,6 +517,8 @@ func createEngine(terragruntOptions *options.TerragruntOptions) (*proto.EngineCl }) cmd := exec.Command(localEnginePath) + // pass log level to engine + cmd.Env = append(cmd.Env, fmt.Sprintf("%s=%s", engineLogLevelEnv, engineLogLevel)) client := plugin.NewClient(&plugin.ClientConfig{ Logger: logger, HandshakeConfig: plugin.HandshakeConfig{ From 1219673601bbae6606988706e404e2de94b554a1 Mon Sep 17 00:00:00 2001 From: kbcz1989 <58665245+kbcz1989@users.noreply.github.com> Date: Mon, 6 Jan 2025 15:09:10 +0100 Subject: [PATCH 03/10] Update hclfmt documentation (#3702) --- docs/_docs/01_getting-started/configuration.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/_docs/01_getting-started/configuration.md b/docs/_docs/01_getting-started/configuration.md index 87dd3f1909..52b30b0cb1 100644 --- a/docs/_docs/01_getting-started/configuration.md +++ b/docs/_docs/01_getting-started/configuration.md @@ -87,7 +87,7 @@ This allows Terragrunt to avoid resolving `dependency` on units that haven’t b You can rewrite the HCL files to a canonical format using the `hclfmt` command built into `terragrunt`. Similar to `tofu fmt`, this command applies a subset of [the OpenTofu/Terraform language style conventions](https://www.terraform.io/docs/configuration/style.html), along with other minor adjustments for readability. -This command will recursively search for hcl files and format all of them under a given directory tree. Consider the following file structure: +By default, this command will recursively search for hcl files and format all of them under a given directory tree. Consider the following file structure: ```tree root @@ -121,3 +121,9 @@ If you run `terragrunt hclfmt` at the `root`, this will update: You can set `--terragrunt-diff` option. `terragrunt hclfmt --terragrunt-diff` will output the diff in a unified format which can be redirected to your favourite diff tool. `diff` utility must be presented in PATH. Additionally, there’s a flag `--terragrunt-check`. `terragrunt hclfmt --terragrunt-check` will only verify if the files are correctly formatted **without rewriting** them. The command will return exit status 1 if any matching files are improperly formatted, or 0 if all matching `.hcl` files are correctly formatted. + +You can exclude directories from the formatting process by using the `--terragrunt-hclfmt-exclude-dir` flag. For example, `terragrunt hclfmt --terragrunt-hclfmt-exclude-dir=qa/services`. + +If you want to format a single file, you can use the `--terragrunt-hclfmt-file` flag. For example, `terragrunt hclfmt --terragrunt-hclfmt-file qa/services/services.hcl`. + +If you want to format HCL from stdin and print the result to stdout, you can use the `--terragrunt-hclfmt-stdin` flag. For example, `echo 'module "foo" {}' | terragrunt hclfmt --terragrunt-hclfmt-stdin`. From 54a810fddda0d2bfa0e0873da9d3db826fe6a09a Mon Sep 17 00:00:00 2001 From: Yann Pretot Date: Mon, 6 Jan 2025 16:38:05 +0100 Subject: [PATCH 04/10] fix: Use correct cache while parsing partial config (#3701) From c53b360ca2a7bbd50a724202537ca344347135ad Mon Sep 17 00:00:00 2001 From: Yousif Akbar <11247449+yhakbar@users.noreply.github.com> Date: Tue, 7 Jan 2025 09:42:44 -0500 Subject: [PATCH 05/10] feat: Rename `cli-options` page to `cli` --- docs/_docs/04_reference/{cli-options.md => cli.md} | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename docs/_docs/04_reference/{cli-options.md => cli.md} (99%) diff --git a/docs/_docs/04_reference/cli-options.md b/docs/_docs/04_reference/cli.md similarity index 99% rename from docs/_docs/04_reference/cli-options.md rename to docs/_docs/04_reference/cli.md index 07db1a458a..2edac2c830 100644 --- a/docs/_docs/04_reference/cli-options.md +++ b/docs/_docs/04_reference/cli.md @@ -1,14 +1,16 @@ --- layout: collection-browser-doc -title: CLI options +title: CLI category: reference categories_url: reference excerpt: >- - Learn about all CLI arguments and options you can use with Terragrunt. + Learn about all CLI commands and options you can use with Terragrunt. tags: ["CLI"] order: 401 nav_title: Documentation nav_title_link: /docs/ +redirect_from: + - /docs/reference/cli-options/ --- This page documents the CLI commands and options available with Terragrunt: From a099bc485619f68a699ef7a25810e84bf4dbe60c Mon Sep 17 00:00:00 2001 From: Yousif Akbar <11247449+yhakbar@users.noreply.github.com> Date: Tue, 7 Jan 2025 09:57:48 -0500 Subject: [PATCH 06/10] feat: Reorganizing CLI page --- docs/_docs/04_reference/cli.md | 509 ++++++++++++++------------------- 1 file changed, 207 insertions(+), 302 deletions(-) diff --git a/docs/_docs/04_reference/cli.md b/docs/_docs/04_reference/cli.md index 2edac2c830..2368129c5c 100644 --- a/docs/_docs/04_reference/cli.md +++ b/docs/_docs/04_reference/cli.md @@ -4,7 +4,7 @@ title: CLI category: reference categories_url: reference excerpt: >- - Learn about all CLI commands and options you can use with Terragrunt. + Learn about all CLI commands and flags you can use with Terragrunt. tags: ["CLI"] order: 401 nav_title: Documentation @@ -13,110 +13,12 @@ redirect_from: - /docs/reference/cli-options/ --- -This page documents the CLI commands and options available with Terragrunt: - -- [CLI commands](#cli-commands) - - [All OpenTofu/Terraform built-in commands](#all-opentofuterraform-built-in-commands) - - [run-all](#run-all) - - [plan-all (DEPRECATED: use run-all)](#plan-all-deprecated-use-run-all) - - [apply-all (DEPRECATED: use run-all)](#apply-all-deprecated-use-run-all) - - [output-all (DEPRECATED: use run-all)](#output-all-deprecated-use-run-all) - - [destroy-all (DEPRECATED: use run-all)](#destroy-all-deprecated-use-run-all) - - [validate-all (DEPRECATED: use run-all)](#validate-all-deprecated-use-run-all) - - [terragrunt-info](#terragrunt-info) - - [validate-inputs](#validate-inputs) - - [graph-dependencies](#graph-dependencies) - - [hclfmt](#hclfmt) - - [hclvalidate](#hclvalidate) - - [aws-provider-patch](#aws-provider-patch) - - [render-json](#render-json) - - [output-module-groups](#output-module-groups) - - [scaffold](#scaffold) - - [catalog](#catalog) - - [graph](#graph) - - [exec](#exec) -- [CLI options](#cli-options) - - [auth-provider-cmd](#auth-provider-cmd) - - [config](#config) - - [tfpath](#tfpath) - - [no-auto-init](#no-auto-init) - - [no-auto-approve](#no-auto-approve) - - [no-auto-retry](#no-auto-retry) - - [non-interactive](#non-interactive) - - [working-dir](#working-dir) - - [download-dir](#download-dir) - - [source](#source) - - [source-map](#source-map) - - [source-update](#source-update) - - [iam-assume-role](#iam-assume-role) - - [iam-assume-role-duration](#iam-assume-role-duration) - - [iam-assume-role-session-name](#iam-assume-role-session-name) - - [iam-assume-role-web-identity-token](#iam-assume-role-web-identity-token) - - [queue-ignore-errors](#queue-ignore-errors) - - [queue-exclude-file](#queue-exclude-file) - - [queue-exclude-dir](#queue-exclude-dir) - - [queue-include-dir](#queue-include-dir) - - [queue-strict-include](#queue-strict-include) - - [strict-validate](#strict-validate) - - [queue-ignore-dag-order](#queue-ignore-dag-order) - - [queue-exclude-external](#queue-exclude-external) - - [queue-include-external](#queue-include-external) - - [parallelism](#parallelism) - - [debug-inputs](#debug-inputs) - - [log-level](#log-level) - - [log-disable](#log-disable) - - [log-format](#log-format) - - [log-custom-format](#log-custom-format) - - [log-show-abs-paths](#log-show-abs-paths) - - [no-color](#no-color) - - [check](#check) - - [diff](#diff) - - [hclfmt-file](#hclfmt-file) - - [hclfmt-exclude-dir](#hclfmt-exclude-dir) - - [hclfmt-stdin](#hclfmt-stdin) - - [hclvalidate-json](#hclvalidate-json) - - [hclvalidate-show-config-path](#hclvalidate-show-config-path) - - [override-attr](#override-attr) - - [out](#out) - - [disable-dependent-modules](#disable-dependent-modules) - - [units-that-include](#units-that-include) - - [dependency-fetch-output-from-state](#dependency-fetch-output-from-state) - - [use-partial-parse-config-cache](#use-partial-parse-config-cache) - - [terragrunt-include-module-prefix](#terragrunt-include-module-prefix) (DEPRECATED: use [tf-forward-stdout](#tf-forward-stdout)) - - [backend-require-bootstrap](#backend-require-bootstrap) - - [disable-bucket-update](#disable-bucket-update) - - [disable-command-validation](#disable-command-validation) - - [terragrunt-json-log](#terragrunt-json-log) (DEPRECATED: use [log-format](#log-format)) - - [terragrunt-tf-logs-to-json](#terragrunt-tf-logs-to-json) (DEPRECATED: use [log-format](#log-format)) - - [provider-cache](#provider-cache) - - [provider-cache-dir](#provider-cache-dir) - - [provider-cache-hostname](#provider-cache-hostname) - - [provider-cache-port](#provider-cache-port) - - [provider-cache-token](#provider-cache-token) - - [provider-cache-registry-names](#provider-cache-registry-names) - - [out-dir](#out-dir) - - [json-out-dir](#json-out-dir) - - [terragrunt-disable-log-formatting](#terragrunt-disable-log-formatting) (DEPRECATED: use [log-format](#log-format)) - - [tf-forward-stdout](#tf-forward-stdout) - - [no-destroy-dependencies-check](#no-destroy-dependencies-check) - - [feature](#feature) - - [experiment](#experiment) - - [experiment-mode](#experiment-mode) - - [strict-control](#strict-control) - - [strict-mode](#strict-mode) - - [in-download-dir](#in-download-dir) +## Commands -## CLI commands - -Terragrunt supports the following CLI commands: +Terragrunt supports the following Commands: - [All OpenTofu/Terraform built-in commands](#all-opentofuterraform-built-in-commands) - [run-all](#run-all) -- [plan-all (DEPRECATED: use run-all)](#plan-all-deprecated-use-run-all) -- [apply-all (DEPRECATED: use run-all)](#apply-all-deprecated-use-run-all) -- [output-all (DEPRECATED: use run-all)](#output-all-deprecated-use-run-all) -- [destroy-all (DEPRECATED: use run-all)](#destroy-all-deprecated-use-run-all) -- [validate-all (DEPRECATED: use run-all)](#validate-all-deprecated-use-run-all) - [terragrunt-info](#terragrunt-info) - [validate-inputs](#validate-inputs) - [graph-dependencies](#graph-dependencies) @@ -199,121 +101,6 @@ The algorithm for determining the aggregate exit code is as follows: - If any unit throws a 2, but nothing throws a 1, Terragrunt will throw a 2. - If nothing throws a non-zero, Terragrunt will throw a 0. -### plan-all (DEPRECATED: use run-all) - -**DEPRECATED: Use `run-all plan` instead.** - -Display the plans of a `stack` by running `terragrunt plan` in each subfolder. Make sure to read [Execute OpenTofu/Terraform -commands on multiple modules at once](/docs/features/stacks) for -context. - -Example: - -```bash -terragrunt run-all plan -``` - -This will recursively search the current working directory for any folders that contain Terragrunt modules and run -`plan` in each one, concurrently, while respecting ordering defined via -[`dependency`](/docs/reference/config-blocks-and-attributes/#dependency) and -[`dependencies`](/docs/reference/config-blocks-and-attributes/#dependencies) blocks. - -**[WARNING] `run-all plan` is currently broken for certain use cases**. If you have a stack of Terragrunt modules with -dependencies between them—either via `dependency` blocks or `terraform_remote_state` data sources—and you've never -deployed them, then `run-all plan` will fail as it will not be possible to resolve the `dependency` blocks or -`terraform_remote_state` data sources! Please [see here for more -information](https://github.com/gruntwork-io/terragrunt/issues/720#issuecomment-497888756). - -### apply-all (DEPRECATED: use run-all) - -**DEPRECATED: Use `run-all apply` instead.** - -Apply a `stack` by running `terragrunt apply` in each subfolder. Make sure to read [Execute OpenTofu/Terraform -commands on multiple modules at once](/docs/features/stacks) for -context. - -Example: - -```bash -terragrunt apply-all -``` - -This will recursively search the current working directory for any folders that contain Terragrunt modules and run -`apply` in each one, concurrently, while respecting ordering defined via -[`dependency`](/docs/reference/config-blocks-and-attributes/#dependency) and -[`dependencies`](/docs/reference/config-blocks-and-attributes/#dependencies) blocks. - -**[NOTE]** Using `apply-all` silently adds the `-auto-approve` flag to the command line arguments passed to OpenTofu/Terraform -due to issues with shared `stdin` making individual approvals impossible. Please [see here for more -information](https://github.com/gruntwork-io/terragrunt/issues/386#issuecomment-358306268) - -### output-all (DEPRECATED: use run-all) - -**DEPRECATED: Use `run-all output` instead.** - -Display the outputs of a `stack` by running `terragrunt output` in each subfolder. Make sure to read [Execute OpenTofu/Terraform -commands on multiple modules at once](/docs/features/stacks) for -context. - -Example: - -```bash -terragrunt output-all -``` - -This will recursively search the current working directory for any folders that contain Terragrunt modules and run -`output` in each one, concurrently, while respecting ordering defined via -[`dependency`](/docs/reference/config-blocks-and-attributes/#dependency) and -[`dependencies`](/docs/reference/config-blocks-and-attributes/#dependencies) blocks. - -**[WARNING] `output-all` is currently broken for certain use cases**. If you have a stack of Terragrunt modules with -dependencies between them—either via `dependency` blocks or `terraform_remote_state` data sources—and you've never -deployed them, then `output-all` will fail as it will not be possible to resolve the `dependency` blocks or -`terraform_remote_state` data sources! Please [see here for more -information](https://github.com/gruntwork-io/terragrunt/issues/720#issuecomment-497888756). - -### destroy-all (DEPRECATED: use run-all) - -**DEPRECATED: Use `run-all destroy` instead.** - -Destroy a `stack` by running `terragrunt destroy` in each subfolder. Make sure to read [Execute OpenTofu/Terraform -commands on multiple modules at once](/docs/features/stacks) for -context. - -Example: - -```bash -terragrunt destroy-all -``` - -This will recursively search the current working directory for any folders that contain Terragrunt modules and run -`destroy` in each one, concurrently, while respecting ordering defined via -[`dependency`](/docs/reference/config-blocks-and-attributes/#dependency) and -[`dependencies`](/docs/reference/config-blocks-and-attributes/#dependencies) blocks. - -**[NOTE]** Using `destroy-all` silently adds the `-auto-approve` flag to the command line arguments passed to OpenTofu/Terraform -due to issues with shared `stdin` making individual approvals impossible. Please [see here for more -information](https://github.com/gruntwork-io/terragrunt/issues/386#issuecomment-358306268) - -### validate-all (DEPRECATED: use run-all) - -**DEPRECATED: Use `run-all validate` instead.** - -Validate `stack` by running `terragrunt validate` in each subfolder. Make sure to read [Execute OpenTofu/Terraform -commands on multiple modules at once](/docs/features/stacks) for -context. - -Example: - -```bash -terragrunt validate-all -``` - -This will recursively search the current working directory for any folders that contain Terragrunt modules and run -`validate` in each one, concurrently, while respecting ordering defined via -[`dependency`](/docs/reference/config-blocks-and-attributes/#dependency) and -[`dependencies`](/docs/reference/config-blocks-and-attributes/#dependencies) blocks. - ### terragrunt-info Emits limited terragrunt state on `stdout` in a JSON format and exits. @@ -752,29 +539,11 @@ Notes: Execute a command using Terragrunt. -## CLI options - -The currently available options are: - -- [CLI commands](#cli-commands) - - [All OpenTofu/Terraform built-in commands](#all-opentofuterraform-built-in-commands) - - [run-all](#run-all) - - [plan-all (DEPRECATED: use run-all)](#plan-all-deprecated-use-run-all) - - [apply-all (DEPRECATED: use run-all)](#apply-all-deprecated-use-run-all) - - [output-all (DEPRECATED: use run-all)](#output-all-deprecated-use-run-all) - - [destroy-all (DEPRECATED: use run-all)](#destroy-all-deprecated-use-run-all) - - [validate-all (DEPRECATED: use run-all)](#validate-all-deprecated-use-run-all) - - [terragrunt-info](#terragrunt-info) - - [validate-inputs](#validate-inputs) - - [graph-dependencies](#graph-dependencies) - - [hclfmt](#hclfmt) - - [aws-provider-patch](#aws-provider-patch) - - [render-json](#render-json) - - [output-module-groups](#output-module-groups) - - [scaffold](#scaffold) - - [catalog](#catalog) - - [graph](#graph) -- [CLI options](#cli-options) +## Flags + +The currently available flags are: + +- [Flags](#flags) - [auth-provider-cmd](#auth-provider-cmd) - [config](#config) - [tfpath](#tfpath) @@ -821,12 +590,9 @@ The currently available options are: - [units-that-include](#units-that-include) - [dependency-fetch-output-from-state](#dependency-fetch-output-from-state) - [use-partial-parse-config-cache](#use-partial-parse-config-cache) - - [terragrunt-include-module-prefix](#terragrunt-include-module-prefix) (DEPRECATED: use [tf-forward-stdout](#tf-forward-stdout)) - [backend-require-bootstrap](#backend-require-bootstrap) - [disable-bucket-update](#disable-bucket-update) - [disable-command-validation](#disable-command-validation) - - [terragrunt-json-log](#terragrunt-json-log) (DEPRECATED: use [log-format](#log-format)) - - [terragrunt-tf-logs-to-json](#terragrunt-tf-logs-to-json) (DEPRECATED: use [log-format](#log-format)) - [provider-cache](#provider-cache) - [provider-cache-dir](#provider-cache-dir) - [provider-cache-hostname](#provider-cache-hostname) @@ -835,7 +601,6 @@ The currently available options are: - [provider-cache-registry-names](#provider-cache-registry-names) - [out-dir](#out-dir) - [json-out-dir](#json-out-dir) - - [terragrunt-disable-log-formatting](#terragrunt-disable-log-formatting) (DEPRECATED: use [log-format](#log-format)) - [tf-forward-stdout](#tf-forward-stdout) - [no-destroy-dependencies-check](#no-destroy-dependencies-check) - [feature](#feature) @@ -1582,15 +1347,6 @@ These configurations are generally safe to cache, but due to the nature of HCL b Once this flag has been tested thoroughly, we will consider making it the default behavior. -### terragrunt-include-module-prefix - -DEPRECATED: Since this behavior has become by default, this flag has been removed. In order to get raw Terraform/OpenTofu output, use [tf-forward-stdout](#tf-forward-stdout). - -**CLI Arg**: `--terragrunt-include-module-prefix`
-**Environment Variable**: `TERRAGRUNT_INCLUDE_MODULE_PREFIX` (set to `true`)
- -When this flag is set output from OpenTofu/Terraform sub-commands is prefixed with module path. - ### backend-require-bootstrap **CLI Arg**: `--backend-require-bootstrap`
@@ -1618,25 +1374,6 @@ When this flag is set, Terragrunt does not update the remote state bucket, which When this flag is set, Terragrunt will not validate the terraform command, which can be useful when need to use non-existent commands in hooks. -### terragrunt-json-log - -DEPRECATED: Use [log-format](#log-format). - -**CLI Arg**: `--terragrunt-json-log`
-**Environment Variable**: `TERRAGRUNT_JSON_LOG` (set to `true`)
- -When this flag is set, Terragrunt will output its logs in JSON format. - -### terragrunt-tf-logs-to-json - -DEPRECATED: Use [log-format](#log-format). OpenTofu/Terraform `stdout` and `stderr` is wrapped in JSON by default with `--terragurnt-log-format json` flag if `--tf-forward-stdout` flag is not specified. -In other words, the previous behavior with the `--terragrunt-json-log --terragrunt-tf-logs-to-json` flags is now equivalent to `--log-format json` and the previous behavior with the `--terragrunt-json-log` is now equivalent to `--log-format json --tf-forward-stdout`. - -**CLI Arg**: `--terragrunt-tf-logs-to-json`
-**Environment Variable**: `TERRAGRUNT_TF_JSON_LOG` (set to `true`)
- -When this flag is set, Terragrunt will wrap OpenTofu/Terraform `stdout` and `stderr` in JSON log messages. Works only with `--terragrunt-json-log` flag. - ### provider-cache **CLI Arg**: `--provider-cache`
@@ -1788,37 +1525,6 @@ Other credential configurations will be supported in the future, but until then, **Note**: The `awsRole` configuration is only used when the `awsCredentials` configuration is not present. If both are present, the `awsCredentials` configuration will take precedence. -### terragrunt-disable-log-formatting - -DEPRECATED: Use [log-format](#log-format). - -**CLI Arg**: `--terragrunt-disable-log-formatting`
-**Environment Variable**: `TERRAGRUNT_DISABLE_LOG_FORMATTING`
-**CLI Arg Alias**: `` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
-**Environment Variable Alias**: `` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
- -If specified, logs will be displayed in key/value format. By default, logs are formatted in a human readable format. - -The example of what the log looks like without the `--terragrunt-disable-log-formatting` flag specified: - -```bash -14:19:25.081 INFO [app] Running command: tofu plan -input=false -14:19:25.174 STDOUT [app] tofu: OpenTofu used the selected providers to generate the following execution -14:19:25.174 STDOUT [app] tofu: plan. Resource actions are indicated with the following symbols: -14:19:25.174 STDOUT [app] tofu: + create -14:19:25.174 STDOUT [app] tofu: OpenTofu will perform the following actions: -``` - -The example of what the log looks like with the `--tf-forward-stdout` flag specified: - -```bash -time=2024-08-23T11:47:18+03:00 level=info prefix=app msg=Running command: tofu plan -input=false -time=2024-08-23T11:47:18+03:00 level=stdout prefix=app binary=tofu msg=OpenTofu used the selected providers to generate the following execution -time=2024-08-23T11:47:18+03:00 level=stdout prefix=app binary=tofu msg=plan. Resource actions are indicated with the following symbols: -time=2024-08-23T11:47:18+03:00 level=stdout prefix=app binary=tofu msg= + create -time=2024-08-23T11:47:18+03:00 level=stdout prefix=app binary=tofu msg=OpenTofu will perform the following actions: -``` - ### tf-forward-stdout **CLI Arg**: `--tf-forward-stdout`
@@ -1956,3 +1662,202 @@ For more information, see the [Strict Mode](/docs/reference/strict-mode) documen - [exec](#exec) Run the provided command in the download directory. + +## Deprecated Commands + +The following are deprecated commands that are no longer recommended for use. They are still available for backwards compatibility, but will be removed in a future release. + +- [Deprecated Commands](#deprecated-commands) + - [plan-all (DEPRECATED: use run-all)](#plan-all) + - [apply-all (DEPRECATED: use run-all)](#apply-all) + - [output-all (DEPRECATED: use run-all)](#output-all) + - [destroy-all (DEPRECATED: use run-all)](#destroy-all) + - [validate-all (DEPRECATED: use run-all)](#validate-all) + +### plan-all + +**DEPRECATED: Use `run-all plan` instead.** + +Display the plans of a `stack` by running `terragrunt plan` in each subfolder. Make sure to read [Execute OpenTofu/Terraform +commands on multiple modules at once](/docs/features/stacks) for +context. + +Example: + +```bash +terragrunt run-all plan +``` + +This will recursively search the current working directory for any folders that contain Terragrunt modules and run +`plan` in each one, concurrently, while respecting ordering defined via +[`dependency`](/docs/reference/config-blocks-and-attributes/#dependency) and +[`dependencies`](/docs/reference/config-blocks-and-attributes/#dependencies) blocks. + +**[WARNING] `run-all plan` is currently broken for certain use cases**. If you have a stack of Terragrunt modules with +dependencies between them—either via `dependency` blocks or `terraform_remote_state` data sources—and you've never +deployed them, then `run-all plan` will fail as it will not be possible to resolve the `dependency` blocks or +`terraform_remote_state` data sources! Please [see here for more +information](https://github.com/gruntwork-io/terragrunt/issues/720#issuecomment-497888756). + +### apply-all + +**DEPRECATED: Use `run-all apply` instead.** + +Apply a `stack` by running `terragrunt apply` in each subfolder. Make sure to read [Execute OpenTofu/Terraform +commands on multiple modules at once](/docs/features/stacks) for +context. + +Example: + +```bash +terragrunt apply-all +``` + +This will recursively search the current working directory for any folders that contain Terragrunt modules and run +`apply` in each one, concurrently, while respecting ordering defined via +[`dependency`](/docs/reference/config-blocks-and-attributes/#dependency) and +[`dependencies`](/docs/reference/config-blocks-and-attributes/#dependencies) blocks. + +**[NOTE]** Using `apply-all` silently adds the `-auto-approve` flag to the command line arguments passed to OpenTofu/Terraform +due to issues with shared `stdin` making individual approvals impossible. Please [see here for more +information](https://github.com/gruntwork-io/terragrunt/issues/386#issuecomment-358306268) + +### output-all + +**DEPRECATED: Use `run-all output` instead.** + +Display the outputs of a `stack` by running `terragrunt output` in each subfolder. Make sure to read [Execute OpenTofu/Terraform +commands on multiple modules at once](/docs/features/stacks) for +context. + +Example: + +```bash +terragrunt output-all +``` + +This will recursively search the current working directory for any folders that contain Terragrunt modules and run +`output` in each one, concurrently, while respecting ordering defined via +[`dependency`](/docs/reference/config-blocks-and-attributes/#dependency) and +[`dependencies`](/docs/reference/config-blocks-and-attributes/#dependencies) blocks. + +**[WARNING] `output-all` is currently broken for certain use cases**. If you have a stack of Terragrunt modules with +dependencies between them—either via `dependency` blocks or `terraform_remote_state` data sources—and you've never +deployed them, then `output-all` will fail as it will not be possible to resolve the `dependency` blocks or +`terraform_remote_state` data sources! Please [see here for more +information](https://github.com/gruntwork-io/terragrunt/issues/720#issuecomment-497888756). + +### destroy-all + +**DEPRECATED: Use `run-all destroy` instead.** + +Destroy a `stack` by running `terragrunt destroy` in each subfolder. Make sure to read [Execute OpenTofu/Terraform +commands on multiple modules at once](/docs/features/stacks) for +context. + +Example: + +```bash +terragrunt destroy-all +``` + +This will recursively search the current working directory for any folders that contain Terragrunt modules and run +`destroy` in each one, concurrently, while respecting ordering defined via +[`dependency`](/docs/reference/config-blocks-and-attributes/#dependency) and +[`dependencies`](/docs/reference/config-blocks-and-attributes/#dependencies) blocks. + +**[NOTE]** Using `destroy-all` silently adds the `-auto-approve` flag to the command line arguments passed to OpenTofu/Terraform +due to issues with shared `stdin` making individual approvals impossible. Please [see here for more +information](https://github.com/gruntwork-io/terragrunt/issues/386#issuecomment-358306268) + +### validate-all + +**DEPRECATED: Use `run-all validate` instead.** + +Validate `stack` by running `terragrunt validate` in each subfolder. Make sure to read [Execute OpenTofu/Terraform +commands on multiple modules at once](/docs/features/stacks) for +context. + +Example: + +```bash +terragrunt validate-all +``` + +This will recursively search the current working directory for any folders that contain Terragrunt modules and run +`validate` in each one, concurrently, while respecting ordering defined via +[`dependency`](/docs/reference/config-blocks-and-attributes/#dependency) and +[`dependencies`](/docs/reference/config-blocks-and-attributes/#dependencies) blocks. + +## Deprecated Flags + +The following are deprecated flags that are no longer recommended for use. They are still available for backwards compatibility, but will be removed in a future release. + +- [Deprecated Flags](#deprecated-flags) + - [terragrunt-include-module-prefix](#terragrunt-include-module-prefix) + - [terragrunt-json-log](#terragrunt-json-log) + - [terragrunt-tf-logs-to-json](#terragrunt-tf-logs-to-json) (DEPRECATED: use [log-format](#log-format)) + - [terragrunt-disable-log-formatting](#terragrunt-disable-log-formatting) (DEPRECATED: use [log-format](#log-format)) + +### terragrunt-include-module-prefix + +**DEPRECATED: Since this behavior has become by default, this flag has been removed. In order to get raw Terraform/OpenTofu output, use [tf-forward-stdout](#tf-forward-stdout).** + +**CLI Arg**: `--terragrunt-include-module-prefix`
+**Environment Variable**: `TERRAGRUNT_INCLUDE_MODULE_PREFIX` (set to `true`)
+ +When this flag is set output from OpenTofu/Terraform sub-commands is prefixed with module path. + +### terragrunt-json-log + +**DEPRECATED: Use [log-format](#log-format).** + +**CLI Arg**: `--terragrunt-json-log`
+**Environment Variable**: `TERRAGRUNT_JSON_LOG` (set to `true`)
+ +When this flag is set, Terragrunt will output its logs in JSON format. + +### terragrunt-tf-logs-to-json + +**DEPRECATED: Use [log-format](#log-format).** + +**OpenTofu/Terraform `stdout` and `stderr` are wrapped in JSON by default when using the `--terragrunt-log-format json` flag if the `--tf-forward-stdout` flag is not specified.** + +**In other words, the behavior when using the deprecated `--terragrunt-json-log --terragrunt-tf-logs-to-json` flags is now equivalent to `--log-format json` and the previous behavior with the `--terragrunt-json-log` is now equivalent to `--log-format json --tf-forward-stdout`.** + +**CLI Arg**: `--terragrunt-tf-logs-to-json`
+**Environment Variable**: `TERRAGRUNT_TF_JSON_LOG` (set to `true`)
+ +When this flag is set, Terragrunt will wrap OpenTofu/Terraform `stdout` and `stderr` in JSON log messages. Works only with `--terragrunt-json-log` flag. + +### terragrunt-disable-log-formatting + +**DEPRECATED: Use [log-format](#log-format).** + +**CLI Arg**: `--terragrunt-disable-log-formatting`
+**Environment Variable**: `TERRAGRUNT_DISABLE_LOG_FORMATTING`
+**CLI Arg Alias**: `` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+ +If specified, logs will be displayed in key/value format. By default, logs are formatted in a human readable format. + +The example of what the log looks like without the `--terragrunt-disable-log-formatting` flag specified: + +```bash +14:19:25.081 INFO [app] Running command: tofu plan -input=false +14:19:25.174 STDOUT [app] tofu: OpenTofu used the selected providers to generate the following execution +14:19:25.174 STDOUT [app] tofu: plan. Resource actions are indicated with the following symbols: +14:19:25.174 STDOUT [app] tofu: + create +14:19:25.174 STDOUT [app] tofu: OpenTofu will perform the following actions: +``` + +The example of what the log looks like with the `--tf-forward-stdout` flag specified: + +```bash +time=2024-08-23T11:47:18+03:00 level=info prefix=app msg=Running command: tofu plan -input=false +time=2024-08-23T11:47:18+03:00 level=stdout prefix=app binary=tofu msg=OpenTofu used the selected providers to generate the following execution +time=2024-08-23T11:47:18+03:00 level=stdout prefix=app binary=tofu msg=plan. Resource actions are indicated with the following symbols: +time=2024-08-23T11:47:18+03:00 level=stdout prefix=app binary=tofu msg= + create +time=2024-08-23T11:47:18+03:00 level=stdout prefix=app binary=tofu msg=OpenTofu will perform the following actions: +``` + From 7c268f761f250579cb211e9c91d666d54d78cd2f Mon Sep 17 00:00:00 2001 From: Yousif Akbar <11247449+yhakbar@users.noreply.github.com> Date: Tue, 7 Jan 2025 10:57:02 -0500 Subject: [PATCH 07/10] fix: Removing unnecessary docs files --- .../add-to-opentofu-project.md | 462 ----------------- docs/_docs/02_features/auto-retry.md | 57 --- ...rm-commands-on-multiple-units-at-once.html | 465 ------------------ ...form-commands-on-multiple-units-at-once.md | 443 ----------------- .../work-with-multiple-aws-accounts.md | 52 -- docs/_docs/04_reference/cli.md | 9 +- 6 files changed, 5 insertions(+), 1483 deletions(-) delete mode 100644 docs/_docs/01_getting-started/add-to-opentofu-project.md delete mode 100644 docs/_docs/02_features/auto-retry.md delete mode 100644 docs/_docs/02_features/execute-terraform-commands-on-multiple-units-at-once.html delete mode 100644 docs/_docs/02_features/execute-terraform-commands-on-multiple-units-at-once.md delete mode 100644 docs/_docs/02_features/work-with-multiple-aws-accounts.md diff --git a/docs/_docs/01_getting-started/add-to-opentofu-project.md b/docs/_docs/01_getting-started/add-to-opentofu-project.md deleted file mode 100644 index 720b93382c..0000000000 --- a/docs/_docs/01_getting-started/add-to-opentofu-project.md +++ /dev/null @@ -1,462 +0,0 @@ ---- -layout: collection-browser-doc -title: Add to OpenTofu Project -category: getting-started -excerpt: Add Terragrunt to an existing OpenTofu/Terraform project. -tags: ["tofu", "opentofu", "terraform", "tf"] -order: 105 -nav_title: Documentation -nav_title_link: /docs/ ---- - -## Add `terragrunt.hcl` to your project - -If you are currently using OpenTofu or Terraform, and you want to start using Terragrunt in your project, simply run the following where your OpenTofu project is located: - -```shell -touch terragrunt.hcl -``` - -This creates an empty Terragrunt configuration file in the directory where you are using OpenTofu. You can now start using `terragrunt` instead of `tofu` or `terraform` to run your OpenTofu/Terraform commands as if you were simply using OpenTofu or Terraform. - -Depending on why you're looking to adopt Terragrunt, this may be all you need to do! - -With just this empty file, you've already made it so that you no longer need to run `tofu init` or `terraform init` before running `tofu apply` or `terraform apply`. Terragrunt will automatically run `init` for you if necessary. This is a feature called [Auto-init](/docs/features/auto-init/). - -This might not be very impressive so far, so you may be wondering _why_ one might want to start using Terragrunt to manage their OpenTofu/Terraform projects. A quick overview of the main benefits of using Terragrunt are covered in the [Quick start](/docs/getting-started/quick-start/), and there is a comprehensive list of features in the [Features](/docs#features) section. - -## Tutorial - -What follows is a gentle step-by-step guide to integrating Terragrunt to an existing OpenTofu/Terraform project. - -For the sake of this tutorial, a minimal set of OpenTofu configurations will be used so that you can follow along. Following these steps will give you an idea of how to integrate Terragrunt into an existing project, even if yours is more complex. - -This tutorial will assume the following: - -1. You have OpenTofu [installed](https://opentofu.org/docs/intro/install/). -2. You have a basic understanding of OpenTofu or Terraform. -3. You are using a Unix-like operating system. - -If you start to feel lost, or don't understand a concept, consider reading the [Terminology](/docs/getting-started/terminology/) page before continuing with this tutorial. It has a brief overview of most of the common terms used when discussing Terragrunt. - -### Step 1: Create a new Terragrunt project - -Let's say you have the following `main.tf` in directory `foo`: - -```hcl -# foo/main.tf -resource "local_file" "file" { - content = "Hello, World!" - filename = "${path.module}/hi.txt" -} -``` - -As we learned above, making this project integrated with Terragrunt is as simple as creating a `terragrunt.hcl` file in the same directory: - -```bash -touch foo/terragrunt.hcl -``` - -You can now run `terragrunt` commands within the `foo` directory, as if you were using `tofu` or `terraform`. - -```bash -$ cd foo -$ terragrunt apply -auto-approve -18:44:26.066 STDOUT tofu: Initializing the backend... -18:44:26.067 STDOUT tofu: Initializing provider plugins... -18:44:26.067 STDOUT tofu: - Finding latest version of hashicorp/local... -18:44:26.717 STDOUT tofu: - Installing hashicorp/local v2.5.2... -18:44:27.033 STDOUT tofu: - Installed hashicorp/local v2.5.2 (signed, key ID 0C0AF313E5FD9F80) -18:44:27.033 STDOUT tofu: Providers are signed by their developers. -18:44:27.033 STDOUT tofu: If you'd like to know more about provider signing, you can read about it here: -18:44:27.033 STDOUT tofu: https://opentofu.org/docs/cli/plugins/signing/ -18:44:27.034 STDOUT tofu: OpenTofu has created a lock file .terraform.lock.hcl to record the provider -18:44:27.034 STDOUT tofu: selections it made above. Include this file in your version control repository -18:44:27.034 STDOUT tofu: so that OpenTofu can guarantee to make the same selections by default when -18:44:27.034 STDOUT tofu: you run "tofu init" in the future. -18:44:27.034 STDOUT tofu: OpenTofu has been successfully initialized! -18:44:27.035 STDOUT tofu: -18:44:27.035 STDOUT tofu: You may now begin working with OpenTofu. Try running "tofu plan" to see -18:44:27.035 STDOUT tofu: any changes that are required for your infrastructure. All OpenTofu commands -18:44:27.035 STDOUT tofu: should now work. -18:44:27.035 STDOUT tofu: If you ever set or change modules or backend configuration for OpenTofu, -18:44:27.035 STDOUT tofu: rerun this command to reinitialize your working directory. If you forget, other -18:44:27.035 STDOUT tofu: commands will detect it and remind you to do so if necessary. -18:44:27.362 STDOUT tofu: OpenTofu used the selected providers to generate the following execution -18:44:27.362 STDOUT tofu: plan. Resource actions are indicated with the following symbols: -18:44:27.362 STDOUT tofu: + create -18:44:27.362 STDOUT tofu: OpenTofu will perform the following actions: -18:44:27.362 STDOUT tofu: # local_file.file will be created -18:44:27.362 STDOUT tofu: + resource "local_file" "file" { -18:44:27.362 STDOUT tofu: + content = "Hello, World!" -18:44:27.362 STDOUT tofu: + content_base64sha256 = (known after apply) -18:44:27.362 STDOUT tofu: + content_base64sha512 = (known after apply) -18:44:27.362 STDOUT tofu: + content_md5 = (known after apply) -18:44:27.362 STDOUT tofu: + content_sha1 = (known after apply) -18:44:27.362 STDOUT tofu: + content_sha256 = (known after apply) -18:44:27.362 STDOUT tofu: + content_sha512 = (known after apply) -18:44:27.362 STDOUT tofu: + directory_permission = "0777" -18:44:27.362 STDOUT tofu: + file_permission = "0777" -18:44:27.362 STDOUT tofu: + filename = "./hi.txt" -18:44:27.362 STDOUT tofu: + id = (known after apply) -18:44:27.362 STDOUT tofu: } -18:44:27.362 STDOUT tofu: Plan: 1 to add, 0 to change, 0 to destroy. -18:44:27.362 STDOUT tofu: -18:44:27.383 STDOUT tofu: local_file.file: Creating... -18:44:27.384 STDOUT tofu: local_file.file: Creation complete after 0s [id=0a0a9f2a6772942557ab5355d76af442f8f65e01] -18:44:27.392 STDOUT tofu: -18:44:27.392 STDOUT tofu: Apply complete! Resources: 1 added, 0 changed, 0 destroyed. -18:44:27.392 STDOUT tofu: -``` - -You might notice that this is a little more verbose than the output you're used to seeing from running `tofu` or `terraform` directly. This is because Terragrunt does a bit of work behind the scenes to make sure that you can scale your OpenTofu/Terraform usage without running into common problems. As you get more comfortable with using Terragrunt on larger projects, you may find the extra information helpful. - -If you would prefer that Terragrunt output look more like the output from `tofu` or `terraform`, you can use the `--log-format bare` flag (or set the environment variable `TG_LOG_FORMAT=bare`) to reduce the verbosity of the output. - -e.g. - -```bash -$ terragrunt --log-format bare apply -local_file.file: Refreshing state... [id=0a0a9f2a6772942557ab5355d76af442f8f65e01] - -No changes. Your infrastructure matches the configuration. - -OpenTofu has compared your real infrastructure against your configuration and -found no differences, so no changes are needed. - -Apply complete! Resources: 0 added, 0 changed, 0 destroyed. -``` - -The way dynamicity is handled in OpenTofu is via `variable` configuration blocks. Let's add one to our `main.tf` so that we can control the content of the file we're creating: - -```hcl -# foo/main.tf -variable "content" {} - -resource "local_file" "file" { - content = var.content - filename = "${path.module}/hi.txt" -} -``` - -Now, just like when using `tofu` alone, you can pass in the value for the `content` variable using the `-var` flag: - -```bash -terragrunt apply -auto-approve -var 'content=Hello, Terragrunt!' -``` - -This is a common pattern when working with Infrastructure as Code (IaC). You typically create IaC that is relatively static, and then as you need to make configurations dynamic, you add variables to your configuration files to introduce dynamicity. - -### Step 2: Add a new Terragrunt unit - -In the context of Terragrunt, a "unit" is a directory that contains a `terragrunt.hcl` file, and it represents a single piece of infrastructure. You can think of a unit as a single instance of an OpenTofu/Terraform module. - -Let's create a copy of the `foo` directory and call it `bar`: - -```bash -cd .. -cp -r foo bar -``` - -We now have two identical units in our project, `foo` and `bar`. We also have identical code in each of these directories, which is not ideal if we want to be able to avoid duplicating effort when we make changes to our infrastructure. - -### Step 3: Create a shared module - -To avoid this duplication, we can introduce a new `shared` directory, and reference that directory from both `foo` and `bar`. This way, we can make changes to our infrastructure in one place and have those changes apply to both units. - -Let's create a new directory called `shared`: - -```bash -mkdir shared -``` - -Now, move the `main.tf` file from `foo` to `shared`: - -```bash -mv foo/main.tf shared/main.tf -``` - -Finally, let's update the `foo` and `bar` directories to reference the `shared` directory. Update the `main.tf` files in both `foo` and `bar` to look like this: - -```hcl -# foo/main.tf and bar/main.tf -variable "content" {} - -module "shared" { - source = "../shared" - - content = var.content -} -``` - -There's now one place where the logic for the resource `local_file.file` is defined, and both `foo` and `bar` reference that logic. You can imagine that as your infrastructure grows, it can become more and more advantageous to put repeated logic into shared modules like this. - -This setup does have some problems, however. While you could keep navigating to the different units and running `terragrunt apply` in each one with the appropriate `-var` flags, this can quickly become tedious, as you have to know which units require which set of vars applied. You might decide to work around this by creating a file named `terraform.tfvars` in each unit directory, but this also comes with some limitations that Terragrunt can help you avoid. - -### Step 4: Use Terragrunt to manage your units - -Luckily, Terragrunt has a built-in feature to control the inputs passed to your OpenTofu/Terraform configurations. This feature is called (aptly enough) [inputs](/docs/reference/config-blocks-and-attributes/#inputs). - -Let's add inputs to both `terragrunt.hcl` files in the `foo` and `bar` directories: - -```hcl -# foo/terragrunt.hcl -inputs = { - content = "Hello from foo, Terragrunt!" -} -``` - -```hcl -# bar/terragrunt.hcl -inputs = { - content = "Hello from bar, Terragrunt!" -} -``` - -Furthermore, you don't have to maintain the extra `main.tf` files just to instantiate the `module` blocks. You can use the `terraform` block to handle this for you. Update the `terragrunt.hcl` files in `foo` and `bar` to look like this: - -```hcl -# foo/terragrunt.hcl -terraform { - source = "../shared" -} - -inputs = { - content = "Hello from foo, Terragrunt!" -} -``` - -```hcl -# bar/terragrunt.hcl -terraform { - source = "../shared" -} - -inputs = { - content = "Hello from bar, Terragrunt!" -} -``` - -And you can delete the `main.tf` files from both `foo` and `bar`: - -```bash -rm foo/main.tf bar/main.tf -``` - -This saves you some duplicated content, as you no longer need to maintain that extra `content` variable in each `main.tf` file. You can imagine that for especially large modules, the ability to define inputs in the `terragrunt.hcl` file can save you a lot of time and effort. The patterns for your infrastructure are exclusively defined in `.tf` files now, and the `terragrunt.hcl` files are used to manage the instances of those patterns as units. - -If you run `terragrunt apply -auto-approve` in the `foo` and `bar` directories, you'll see that the `content` variable is set to the value you defined in the `inputs` block of the `terragrunt.hcl` file. You might also notice that there's now a special `.terragrunt-cache` directory generated for you in each unit directory. This is where Terragrunt copies the contents of modules, and performs any necessary additional code generation to make sure that your OpenTofu/Terraform code is ready to be run. - -The `.terragrunt-cache` directory is typically added to `.gitignore` files, similar to the `.terraform` directory that OpenTofu generates. - -### Step 5: Use Terragrunt to manage your stacks - -In the context of Terragrunt, a "stack" is a collection of units that are managed together. You can think of a stack as a single environment, such as `dev`, `staging`, or `prod`, or an entire project. - -One of the main reasons users adopt Terragrunt is how it can help manage the complexity of managing multiple units across multiple environments. - -e.g. Let's say we wanted to update both our `foo` and `bar` environments simultaneously. - -In the directory above `foo` and `bar`, run the following: - -```bash -$ terragrunt run-all apply -auto-approve -08:42:00.150 INFO The stack at . will be processed in the following order for command apply: -Group 1 -- Module ./bar -- Module ./foo - - -Are you sure you want to run 'terragrunt apply' in each folder of the stack described above? (y/n) y -08:43:10.702 STDOUT [foo] tofu: local_file.file: Refreshing state... [id=c4ae21736a6297f44ea86791e528338e9d14a0e9] -08:43:10.702 STDOUT [bar] tofu: local_file.file: Refreshing state... [id=f855394a0316da09618c8b1fde7b91e00e759f80] -08:43:10.708 STDOUT [bar] tofu: No changes. Your infrastructure matches the configuration. -08:43:10.708 STDOUT [bar] tofu: OpenTofu has compared your real infrastructure against your configuration and -08:43:10.708 STDOUT [bar] tofu: found no differences, so no changes are needed. -08:43:10.708 STDOUT [foo] tofu: No changes. Your infrastructure matches the configuration. -08:43:10.708 STDOUT [foo] tofu: OpenTofu has compared your real infrastructure against your configuration and -08:43:10.708 STDOUT [foo] tofu: found no differences, so no changes are needed. -08:43:10.716 STDOUT [foo] tofu: -08:43:10.716 STDOUT [foo] tofu: Apply complete! Resources: 0 added, 0 changed, 0 destroyed. -08:43:10.716 STDOUT [foo] tofu: -08:43:10.720 STDOUT [bar] tofu: -08:43:10.720 STDOUT [bar] tofu: Apply complete! Resources: 0 added, 0 changed, 0 destroyed. -08:43:10.720 STDOUT [bar] tofu: -``` - -This is where that additional verbosity in Terragrunt logging is really handy. You can see that Terragrunt concurrently ran `apply -auto-approve` in both the `foo` and `bar` units. The extra logging for Terragrunt also included information on the names of the units that were processed, and disambiguated the output from each unit. - -Similar to the `tofu` CLI, there is a prompt to confirm that you are sure you want to run the command in each unit when performing a command that's potentially destructive. You can skip this prompt by using the `--non-interactive` flag, just as you would with `-auto-approve` in OpenTofu. - -```bash -terragrunt run-all --non-interactive apply -auto-approve -``` - -### Step 6: Use Terragrunt to manage your DAG - -In the context of Terragrunt, a "DAG" is a Directed Acyclic Graph that represents the dependencies between units in your stack. Terragrunt uses the DAG to determine the order in which to run commands across your stack. - -For example, let's say that the `content` of the `bar` unit depended on the `content` of the `foo` unit. You can express this dependency first by adding an `output` block to the `shared` module: - -```hcl -# shared/output.tf -output "content" { - value = local_file.file.content -} -``` - -Then, you can update the `bar` unit to depend on the `foo` unit by using the `dependencies` block in the `terragrunt.hcl` file: - -```hcl -# bar/terragrunt.hcl -terraform { - source = "../shared" -} - -dependency "foo" { - config_path = "../foo" -} - -inputs = { - content = "Foo content: ${dependency.foo.outputs.content}" -} -``` - -Being good citizens of the IaC world, we should run a `plan` before an `apply` to see what changes Terragrunt will make to our infrastructure (note that you will get an error here. This is expected, and we'll fix it in the next step): - -```bash -$ terragrunt run-all plan -08:57:09.271 INFO The stack at . will be processed in the following order for command plan: -Group 1 -- Module ./foo - -Group 2 -- Module ./bar - -... - -08:57:09.936 ERROR [bar] Module ./bar has finished with an error -08:57:09.936 ERROR error occurred: - -* ./foo/terragrunt.hcl is a dependency of ./bar/terragrunt.hcl but detected no outputs. Either the target module has not been applied yet, or the module has no outputs. If this is expected, set the skip_outputs flag to true on the dependency block. - -08:57:09.936 ERROR Unable to determine underlying exit code, so Terragrunt will exit with error code 1 -``` - -Oh no! We got an error. This is because the way in which dependencies are resolved by default in Terragrunt is to run `terragrunt output` within the dependency for use in the dependent unit. In this case, the `foo` unit has not been applied yet, so there are no outputs to fetch. - -You should notice, however, that Terragrunt has already figured out the order in which to run the `plan` command across the units in your stack. This is what we mean when we say that Terragrunt uses a DAG to determine the order in which to run commands across your stack. Terragrunt analyzes the dependencies across your units, and determines the order in which to run updates so that outputs are ready to be used as inputs in dependent units. - -If you instead decided to run `terragrunt run-all apply -auto-approve`, you would instead see Terragrunt complete the `apply` in the `foo` unit first, and then complete the `apply` in the `bar` unit, as it's aware that the `bar` unit might need some outputs from the `foo` unit. - -### Step 7: Use mocks to handle unavailable outputs - -In this scenario, most Terragrunt users leverage `mock_outputs` to handle unavailable outputs (see [limitations on accessing exposed config](https://terragrunt.gruntwork.io/docs/reference/config-blocks-and-attributes/#limitations-on-accessing-exposed-config)). Given that it's expected that the `foo` unit won't be able to provide outputs until it's applied, you can use the `mock_outputs` block to provide a placeholder value for the `content` output during the `plan` phase. - -```hcl -# bar/terragrunt.hcl -terraform { - source = "../shared" -} - -dependency "foo" { - config_path = "../foo" - mock_outputs = { - content = "Mocked content from foo" - } -} - -inputs = { - content = "Foo content: ${dependency.foo.outputs.content}" -} -``` - -Re-running the `plan` command should now complete successfully: - -```bash -$ terragrunt run-all plan -09:29:03.461 INFO The stack at . will be processed in the following order for command plan: -Group 1 -- Module ./foo - -Group 2 -- Module ./bar - -... - -09:29:03.644 WARN [bar] Config ./foo/terragrunt.hcl is a dependency of ./bar/terragrunt.hcl that has no outputs, but mock outputs provided and returning those in dependency output. - -... - -09:29:03.898 STDOUT [bar] tofu: + resource "local_file" "file" { -09:29:03.898 STDOUT [bar] tofu: + content = "Foo content: Mocked content from foo" -09:29:03.898 STDOUT [bar] tofu: + content_base64sha256 = (known after apply) -09:29:03.898 STDOUT [bar] tofu: + content_base64sha512 = (known after apply) -09:29:03.898 STDOUT [bar] tofu: + content_md5 = (known after apply) -09:29:03.898 STDOUT [bar] tofu: + content_sha1 = (known after apply) -09:29:03.898 STDOUT [bar] tofu: + content_sha256 = (known after apply) -09:29:03.898 STDOUT [bar] tofu: + content_sha512 = (known after apply) -09:29:03.898 STDOUT [bar] tofu: + directory_permission = "0777" -09:29:03.898 STDOUT [bar] tofu: + file_permission = "0777" -09:29:03.898 STDOUT [bar] tofu: + filename = "./hi.txt" -09:29:03.898 STDOUT [bar] tofu: + id = (known after apply) -09:29:03.898 STDOUT [bar] tofu: } -``` - -If you're concerned about the `mock_outputs` attribute resulting in invalid configurations, note that during an apply, the outputs of `foo` will be known, and Terragrunt won't use `mock_outputs` to resolve the outputs of `foo`. - -```bash -$ terragrunt run-all --non-interactive apply -auto-approve - -... - -09:31:21.587 STDOUT [bar] tofu: + resource "local_file" "file" { -09:31:21.587 STDOUT [bar] tofu: + content = "Foo content: Hello from foo, Terragrunt!" -09:31:21.587 STDOUT [bar] tofu: + content_base64sha256 = (known after apply) -09:31:21.587 STDOUT [bar] tofu: + content_base64sha512 = (known after apply) -09:31:21.587 STDOUT [bar] tofu: + content_md5 = (known after apply) -09:31:21.587 STDOUT [bar] tofu: + content_sha1 = (known after apply) -09:31:21.587 STDOUT [bar] tofu: + content_sha256 = (known after apply) -09:31:21.587 STDOUT [bar] tofu: + content_sha512 = (known after apply) -09:31:21.587 STDOUT [bar] tofu: + directory_permission = "0777" -09:31:21.587 STDOUT [bar] tofu: + file_permission = "0777" -09:31:21.587 STDOUT [bar] tofu: + filename = "./hi.txt" -09:31:21.587 STDOUT [bar] tofu: + id = (known after apply) -09:31:21.587 STDOUT [bar] tofu: } - -... -``` - -You can also be explicit about the fact that you only want to use `mock_outputs` during the `plan` phase by specifying that in your `mock_outputs` configuration: - -```hcl -# bar/terragrunt.hcl -terraform { - source = "../shared" -} - -dependency "foo" { - config_path = "../foo" - mock_outputs = { - content = "Mocked content from foo" - } - - mock_outputs_allowed_terraform_commands = ["plan"] -} - -inputs = { - content = "Foo content: ${dependency.foo.outputs.content}" -} -``` - -Something a little subtle just happened there. Note that the `inputs` attribute is dynamic. This addresses some of the limitations mentioned earlier about using `terraform.tfvars` files to manage inputs for units. Given that the `bar` unit is dependent on output values from the `foo` unit, you wouldn't be able to use a `terraform.tfvars` file to populate this variable without some additional tooling to populate it dynamically. - -Terragrunt was spawned organically out of supporting Gruntwork customers using Terraform at scale, and features in the product are designed to address common problems like these that arise when managing OpenTofu/Terraform projects at scale in production. - -### Step 8: Continue learning and exploring - -Hopefully, following this simple tutorial has given you confidence in integrating Terragrunt into your existing OpenTofu/Terraform projects. Starting small, and gradually introducing more complex Terragrunt features is a great way to learn how Terragrunt can help you manage your infrastructure more effectively. - -There are many more features and capabilities in Terragrunt. You can find more information on them in the [Features](/docs#features) section of the documentation. - -If you need help with a particular problem, take a look at the resources available to you in the [Support](/docs/community/support/) section. diff --git a/docs/_docs/02_features/auto-retry.md b/docs/_docs/02_features/auto-retry.md deleted file mode 100644 index 7087565b07..0000000000 --- a/docs/_docs/02_features/auto-retry.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -layout: collection-browser-doc -title: Auto-retry -category: features -categories_url: features -excerpt: Auto-Retry is a feature of terragrunt that will automatically address situations where an OpenTofu/Terraform command needs to be re-run. -tags: ["CLI"] -order: 250 -nav_title: Documentation -nav_title_link: /docs/ ---- - -## Auto-Retry - -*Auto-Retry* is a feature of `terragrunt` that will automatically address situations where a `tofu`/`terraform` command needs to be re-run. - -OpenTofu/Terraform can fail with transient errors which can be addressed by simply retrying the command again. In the event `terragrunt` finds one of these errors, the command will be re-run again automatically. - -### Example - -```shell -$ terragrunt apply -... -Initializing provider plugins... -- Checking for available provider plugins on https://releases.hashicorp.com... -Error installing provider "template": error fetching checksums: Get https://releases.hashicorp.com/terraform-provider-template/1.0.0/terraform-provider-template_1.0.0_SHA256SUMS: net/http: TLS handshake timeout. -``` - -Terragrunt sees this error, and knows it is a transient error that can be addressed by re-running the `apply` command. - -Terragrunt has a small list of default known errors built-in. You can override these defaults with your own custom retryable errors in your `terragrunt.hcl` configuration: - -```hcl -retryable_errors = [ - "a regex to match the error", - "another regex" -] -``` - -E.g: - -```hcl -retryable_errors = [ - "(?s).*Error installing provider.*tcp.*connection reset by peer.*", - "(?s).*ssh_exchange_identification.*Connection closed by remote host.*" -] -``` - -By default, `auto-retry` tries a maximum of three times to re-run a command, pausing for five seconds between each retry, at which point it will deem the error as not transient, and accept the `tofu`/`terraform` failure. -However, you can override these defaults. For example, the following retries up to five times, with 60 seconds in between each retry: - -```hcl -retry_max_attempts = 5 -retry_sleep_interval_sec = 60 -``` - -To disable `auto-retry`, use the `--no-auto-retry` command line option or set the `TG_NO_AUTO_RETRY` environment variable to `true`. diff --git a/docs/_docs/02_features/execute-terraform-commands-on-multiple-units-at-once.html b/docs/_docs/02_features/execute-terraform-commands-on-multiple-units-at-once.html deleted file mode 100644 index b79dc560bb..0000000000 --- a/docs/_docs/02_features/execute-terraform-commands-on-multiple-units-at-once.html +++ /dev/null @@ -1,465 +0,0 @@ - - - - - - -02_features/execute-terraform-commands-on-multiple-units-at-once.html - - - - - - -
- -

layout: collection-browser-doc -title: Execute OpenTofu/Terraform commands on multiple units at once -category: features -categoriesurl: features -excerpt: Learn how to avoid tedious tasks of running commands on each unit separately. -tags: ["DRY", "Unit", "Modules", "Use cases", "CLI"] -order: 220 -navtitle: Documentation

- -

navtitlelink: /docs/

- -

Execute OpenTofu/Terraform commands on multiple units at once

- - - -

Motivation

- -

Let’s say your infrastructure is defined across multiple OpenTofu/Terraform units:

- -

tree -root -├── backend-app -│ └── main.tf -├── frontend-app -│ └── main.tf -├── mysql -│ └── main.tf -├── redis -│ └── main.tf -└── vpc - └── main.tf -

- -

There is one unit to deploy a frontend-app, another to deploy a backend-app, another for the MySQL database, and so on. To deploy such an environment, you’d have to manually run tofu apply/terraform apply in each of the subfolder, wait for it to complete, and then run tofu apply/terraform apply in the next subfolder. How do you avoid this tedious and time-consuming process?

- -

The run-all command

- -

To be able to deploy multiple OpenTofu/Terraform units in a single command, add a terragrunt.hcl file to each unit:

- -

tree -root -├── backend-app -│ ├── main.tf -│ └── terragrunt.hcl -├── frontend-app -│ ├── main.tf -│ └── terragrunt.hcl -├── mysql -│ ├── main.tf -│ └── terragrunt.hcl -├── redis -│ ├── main.tf -│ └── terragrunt.hcl -└── vpc - ├── main.tf - └── terragrunt.hcl -

- -

Now you can go into the root folder and deploy all the units within it by using the run-all command with -apply:

- -

bash -cd root -terragrunt run-all apply -

- -

When you run this command, Terragrunt will recursively look through all the subfolders of the current working directory, find all folders with a terragrunt.hcl file, and run terragrunt apply in each of those folders concurrently.

- -

Similarly, to undeploy all the OpenTofu/Terraform units, you can use the run-all command with destroy:

- -

bash -cd root -terragrunt run-all destroy -

- -

To see the currently applied outputs of all of the subfolders, you can use the run-all command with output:

- -

bash -cd root -terragrunt run-all output -

- -

Finally, if you make some changes to your project, you could evaluate the impact by using run-all command with plan:

- -

Note: It is important to realize that you could get errors running run-all plan if you have dependencies between your -projects and some of those dependencies haven’t been applied yet.

- -

Ex: If unit A depends on unit B and unit B hasn’t been applied yet, then run-all plan will show the plan for B, but exit with an error when trying to show the plan for A.

- -

bash -cd root -terragrunt run-all plan -

- -

If your units have dependencies between them, for example, you can’t deploy the backend-app until MySQL and redis are deployed—you’ll need to express those dependencies in your Terragrunt configuration as explained in the next section.

- -

Additional note: If your units have dependencies between them, and you run a terragrunt run-all destroy command, Terragrunt will destroy all the units under the current working directory, as well as each of the unit dependencies (that is, units you depend on via dependencies and dependency blocks)! If you wish to use exclude dependencies from being destroyed, add the --queue-exclude-external flag, or use the --queue-exclude-dir once for each directory you wish to exclude.

- -

Passing outputs between units

- -

Consider the following file structure:

- -

tree -root -├── backend-app -│ ├── main.tf -│ └── terragrunt.hcl -├── mysql -│ ├── main.tf -│ └── terragrunt.hcl -├── redis -│ ├── main.tf -│ └── terragrunt.hcl -└── vpc - ├── main.tf - └── terragrunt.hcl -

- -

Suppose that you wanted to pass in the VPC ID of the VPC that is created from the vpc unit in the folder structure above to the mysql unit as an input variable. Or if you wanted to pass in the subnet IDs of the private subnet that is allocated as part of the vpc unit.

- -

You can use the dependency block to extract the output variables to access another unit’s output variables in the terragrunt inputs attribute.

- -

For example, suppose the vpc unit outputs the ID under the name vpc_id. To access that output, you would specify in mysql/terragrunt.hcl:

- -

```hcl -dependency "vpc" { - config_path = "../vpc" -}

- -

inputs = { - vpcid = dependency.vpc.outputs.vpcid -} -```

- -

When you apply this unit, the output will be read from the vpc unit and passed in as an input to the mysql unit right before calling tofu apply/terraform apply.

- -

You can also specify multiple dependency blocks to access multiple different unit output variables. For example, in the above folder structure, you might want to reference the domain output of the redis and mysql units for use as inputs in the backend-app unit. To access those outputs, you would specify in backend-app/terragrunt.hcl:

- -

```hcl -dependency "mysql" { - config_path = "../mysql" -}

- -

dependency "redis" { - config_path = "../redis" -}

- -

inputs = { - mysqlurl = dependency.mysql.outputs.domain - redisurl = dependency.redis.outputs.domain -} -```

- -

Note that each dependency is automatically considered a dependency in Terragrunt. This means that when you run run-all apply on a config that has dependency blocks, Terragrunt will not attempt to deploy the config until all the units referenced in dependency blocks have been applied. So for the above example, the order for the run-all apply command would be:

- -
    -
  1. Deploy the VPC

  2. -
  3. Deploy MySQL and Redis in parallel

  4. -
  5. Deploy the backend-app

  6. -
- -

If any of the units failed to deploy, then Terragrunt will not attempt to deploy the units that depend on them.

- -

Note: Not all blocks are able to access outputs passed by dependency blocks. See the section on Configuration parsing order for more information.

- -

Unapplied dependency and mock outputs

- -

Terragrunt will return an error indicating the dependency hasn’t been applied yet if the unit referenced in a dependency block has not been applied yet. This is because you cannot actually fetch outputs out of an unapplied unit, even if there are no resources being created in the unit.

- -

This is most problematic when running commands that do not modify state (e.g run-all plan and run-all validate) on a completely new setup where no infrastructure has been deployed. You won’t be able to plan or validate a unit if you can’t determine the inputs. If the unit depends on the outputs of another unit that hasn’t been applied yet, you won’t be able to compute the inputs unless the dependencies are all applied. However, in real life usage, you would want to run run-all validate or run-all plan on a completely new set of infrastructure.

- -

To address this, you can provide mock outputs to use when a unit hasn’t been applied yet. This is configured using the mock_outputs attribute on the dependency block and it corresponds to a map that will be injected in place of the actual dependency outputs if the target config hasn’t been applied yet.

- -

For example, in the previous example with a mysql unit and vpc unit, suppose you wanted to place in a temporary, dummy value for the vpc_id during a run-all validate for the mysql unit. You can specify in mysql/terragrunt.hcl:

- -

```hcl -dependency "vpc" { - config_path = "../vpc"

- -

mockoutputs = { - vpcid = "temporary-dummy-id" - } -}

- -

inputs = { - vpcid = dependency.vpc.outputs.vpcid -} -```

- -

You can now run validate on this config before the vpc unit is applied because Terragrunt will use the map {vpc_id = "temporary-dummy-id"} as the outputs attribute on the dependency instead of erroring out.

- -

What if you wanted to restrict this behavior to only the validate command? For example, you might not want to use the defaults for a plan operation because the plan doesn’t give you any indication of what is actually going to be created.

- -

You can use the mock_outputs_allowed_terraform_commands attribute to indicate that the mock_outputs should only be used when running those OpenTofu/Terraform commands. So to restrict the mock_outputs to only when validate is being run, you can modify the above terragrunt.hcl file to:

- -

```hcl -dependency "vpc" { - config_path = "../vpc"

- -

mockoutputs = { - vpcid = "temporary-dummy-id" - } - mockoutputsallowedterraformcommands = ["validate"] -}

- -

inputs = { - vpcid = dependency.vpc.outputs.vpcid -} -```

- -

Note that indicating validate means that the mock_outputs will be used either with validate or with run-all validate.

- -

You can also use skip_outputs on the dependency block to specify the dependency without pulling in the outputs:

- -

hcl -dependency "vpc" { - config_path = "../vpc" - skip_outputs = true -} -

- -

When skip_outputs is used with mock_outputs, mocked outputs will be returned without pulling in the outputs from remote states. This can be useful when you disable the backend initialization (remote_state.disable_init) in CI for example.

- -

```hcl -dependency "vpc" { - configpath = "../vpc" - mockoutputs = { - vpc_id = "temporary-dummy-id" - }

- -

skip_outputs = true -} -```

- -

You can also use mock_outputs_merge_strategy_with_state on the dependency block to merge the mocked outputs and the state outputs :

- -

```hcl -dependency "vpc" { - configpath = "../vpc" - mockoutputs = { - vpcid = "temporary-dummy-id" - newoutput = "temporary-dummy-value" - }

- -

mockoutputsmergestrategywith_state = "shallow" -} -```

- -

If the state outputs only contains vpc_id, this value will be preserved. And new_output which is not existing, the mock value will be used.

- -

Dependencies between units

- -

You can also specify dependencies explicitly. Consider the following file structure:

- -

tree -root -├── backend-app -│ ├── main.tf -│ └── terragrunt.hcl -├── frontend-app -│ ├── main.tf -│ └── terragrunt.hcl -├── mysql -│ ├── main.tf -│ └── terragrunt.hcl -├── redis -│ ├── main.tf -│ └── terragrunt.hcl -└── vpc - ├── main.tf - └── terragrunt.hcl -

- -

Let’s assume you have the following dependencies between OpenTofu/Terraform units:

- -
    -
  • backend-app depends on mysql, redis, and vpc

  • -
  • frontend-app depends on backend-app and vpc

  • -
  • mysql depends on vpc

  • -
  • redis depends on vpc

  • -
  • vpc has no dependencies

  • -
- -

You can express these dependencies in your terragrunt.hcl config files using a dependencies block. For example, in backend-app/terragrunt.hcl you would specify:

- -

hcl -dependencies { - paths = ["../vpc", "../mysql", "../redis"] -} -

- -

Similarly, in frontend-app/terragrunt.hcl, you would specify:

- -

hcl -dependencies { - paths = ["../vpc", "../backend-app"] -} -

- -

Once you’ve specified the dependencies in each terragrunt.hcl file, when you run the terragrunt run-all apply or terragrunt run-all destroy, Terragrunt will ensure that the dependencies are applied or destroyed, respectively, in the correct order. For the example at the start of this section, the order for the run-all apply command would be:

- -
    -
  1. Deploy the VPC

  2. -
  3. Deploy MySQL and Redis in parallel

  4. -
  5. Deploy the backend-app

  6. -
  7. Deploy the frontend-app

  8. -
- -

If any of the units fail to deploy, then Terragrunt will not attempt to deploy the units that depend on them. Once you’ve fixed the error, it’s usually safe to re-run the run-all apply or run-all destroy command again, since it’ll be a no-op for the units that already deployed successfully, and should only affect the ones that had an error the last time around.

- -

To check all of your dependencies and validate the code in them, you can use the run-all validate command.

- -

To check the dependency graph you can use the graph-dependencies command (similar to the terraform graph command), -the graph is output in DOT format The typical program that can read this format is GraphViz, but many web services are also available to read this format.

- -

bash -terragrunt graph-dependencies | dot -Tsvg > graph.svg -

- -

In the example above it'll generate this graph

- -

terragrunt graph-dependencies

- -

Note that this graph shows the dependency relationship in the direction of the arrow (top down), however terragrunt will run the action -in reverse order (bottom up)

- -

Note: During execution of destroy command, Terragrunt will try to find all dependent units and show a confirmation prompt with a list of all detected dependencies, because once resources will be destroyed, any commands on dependent units will fail with missing dependencies. For example, if destroy was called on the redis unit, you will be asked to confirm the action because backend-app depends on redis. You can avoid the prompt by using --non-interactive.

- -

Testing multiple units locally

- -

If you are using Terragrunt to configure remote OpenTofu/Terraform configurations and all of your units have the source parameter set to a Git URL, but you want to test with a local checkout of the code, you can use the --source parameter:

- -

bash -cd root -terragrunt run-all plan --source /source/modules -

- -

If you set the --source parameter, the run-all commands will assume that parameter is pointing to a folder on your local file system that has a local checkout of all of your OpenTofu/Terraform modules. For each unit that is being processed via a run-all command, Terragrunt will read in the source parameter in that unit’s terragrunt.hcl file, parse out the path (the portion after the double-slash), and append the path to the --source parameter to create the final local path for that unit.

- -

For example, consider the following terragrunt.hcl file:

- -

hcl -terraform { - source = "git::git@github.com:acme/infrastructure-modules.git//networking/vpc?ref=v0.0.1" -} -

- -

If you run terragrunt run-all apply --source /source/infrastructure-modules, then the local path Terragrunt will compute for the module above will be /source/infrastructure-modules//networking/vpc.

- -

Limiting the unit execution parallelism

- -

By default Terragrunt will not impose a limit on the number of units it executes when it traverses the dependency graph, -meaning that if it finds 5 units it'll run OpenTofu/Terraform 5 times in parallel once in each unit. Sometimes -this might create a problem if there are a lot of units in the dependency graph like hitting a rate limit on some -cloud provider.

- -

To limit the maximum number of unit executions at any given time use the --parallelism [number] flag

- -

sh -terragrunt run-all apply --parallelism 4 -

- -

Saving OpenTofu/Terraform plan output

- -

Terragrunt enables you to save the execution plan to a designated directory in binary or JSON format, which is helpful for reviewing and reusing the plan at a later time. -To save the plan, use the --out-dir flag (or TG_OUT_DIR environment variable) as demonstrated below:

- -

sh -$ terragrunt run-all plan --out-dir /tmp/tfplan -$ tree /tmp/tfplan -/tmp/tfplan -├── app1 -│   └── tfplan.tfplan -├── app2 -│   └── tfplan.tfplan -├── app3 -│   └── tfplan.tfplan -└── project-2 - └── project-2-app1 - └── tfplan.tfplan -$ terragrunt run-all apply --out-dir /tmp/tfplan -

- -

For planning a destroy operation, use the following commands:

- -

sh -terragrunt run-all plan -destroy --out-dir /tmp/tfplan -terragrunt run-all apply --out-dir /tmp/tfplan -

- -

To save plan in json format use --json-out-dir flag (or TG_JSON_OUT_DIR environment variable):

- -

```sh -$ terragrunt run-all plan --json-out-dir /tmp/json -$ tree /tmp/json -/tmp/json -├── app1 -│   └── tfplan.json -├── app2 -│   └── tfplan.json -├── app3 -│   └── tfplan.json -└── project-2 - └── project-2-app1 - └── tfplan.json

- -

combine binary and json plans

- -

$ terragrunt run-all plan --out-dir /tmp/all --json-out-dir /tmp/all -$ tree /tmp/all -/tmp/all -├── app1 -│   ├── tfplan.json -│   └── tfplan.tfplan -├── app2 -│   ├── tfplan.json -│   └── tfplan.tfplan -├── app3 -│   ├── tfplan.json -│   └── tfplan.tfplan -└── project-2 - └── project-2-app1 - ├── tfplan.json - └── tfplan.tfplan -```

- -

Notes:

- -
    -
  • The plan for each unit will be saved the same hierarchy as the unit structure.
  • -
  • The file name for the plans are tfplan.tfplan for the plan binary and tfplan.json for the plan JSON.
  • -
  • JSON plan files can't be used with terragrunt run-all apply command, only binary plan files can be used.
  • -
  • Output directories can be combined which will lead to saving both binary and JSON plans.
  • -
- - - diff --git a/docs/_docs/02_features/execute-terraform-commands-on-multiple-units-at-once.md b/docs/_docs/02_features/execute-terraform-commands-on-multiple-units-at-once.md deleted file mode 100644 index e03a601888..0000000000 --- a/docs/_docs/02_features/execute-terraform-commands-on-multiple-units-at-once.md +++ /dev/null @@ -1,443 +0,0 @@ ---- -layout: collection-browser-doc -title: Execute OpenTofu/Terraform commands on multiple units at once -category: features -categories_url: features -excerpt: Learn how to avoid tedious tasks of running commands on each unit separately. -tags: ["DRY", "Unit", "Modules", "Use cases", "CLI"] -order: 220 -nav_title: Documentation -nav_title_link: /docs/ ---- - -## Execute OpenTofu/Terraform commands on multiple units at once - -- [Execute OpenTofu/Terraform commands on multiple units at once](#execute-opentofuterraform-commands-on-multiple-units-at-once) - - [Motivation](#motivation) - - [The run-all command](#the-run-all-command) - - [Passing outputs between units](#passing-outputs-between-units) - - [Unapplied dependency and mock outputs](#unapplied-dependency-and-mock-outputs) - - [Dependencies between units](#dependencies-between-units) - - [Testing multiple units locally](#testing-multiple-units-locally) - - [Limiting the unit execution parallelism](#limiting-the-unit-execution-parallelism) - - [Saving OpenTofu/Terraform plan output](#saving-opentofuterraform-plan-output) - -### Motivation - -Let’s say your infrastructure is defined across multiple OpenTofu/Terraform units: - -```tree -root -├── backend-app -│ └── main.tf -├── frontend-app -│ └── main.tf -├── mysql -│ └── main.tf -├── redis -│ └── main.tf -└── vpc - └── main.tf -``` - -There is one unit to deploy a frontend-app, another to deploy a backend-app, another for the MySQL database, and so on. To deploy such an environment, you’d have to manually run `tofu apply`/`terraform apply` in each of the subfolder, wait for it to complete, and then run `tofu apply`/`terraform apply` in the next subfolder. How do you avoid this tedious and time-consuming process? - -### The run-all command - -To be able to deploy multiple OpenTofu/Terraform units in a single command, add a `terragrunt.hcl` file to each unit: - -```tree -root -├── backend-app -│ ├── main.tf -│ └── terragrunt.hcl -├── frontend-app -│ ├── main.tf -│ └── terragrunt.hcl -├── mysql -│ ├── main.tf -│ └── terragrunt.hcl -├── redis -│ ├── main.tf -│ └── terragrunt.hcl -└── vpc - ├── main.tf - └── terragrunt.hcl -``` - -Now you can go into the `root` folder and deploy all the units within it by using the `run-all` command with -`apply`: - -```bash -cd root -terragrunt run-all apply -``` - -When you run this command, Terragrunt will recursively look through all the subfolders of the current working directory, find all folders with a `terragrunt.hcl` file, and run `terragrunt apply` in each of those folders concurrently. - -Similarly, to undeploy all the OpenTofu/Terraform units, you can use the `run-all` command with `destroy`: - -```bash -cd root -terragrunt run-all destroy -``` - -To see the currently applied outputs of all of the subfolders, you can use the `run-all` command with `output`: - -```bash -cd root -terragrunt run-all output -``` - -Finally, if you make some changes to your project, you could evaluate the impact by using `run-all` command with `plan`: - -Note: It is important to realize that you could get errors running `run-all plan` if you have dependencies between your -projects and some of those dependencies haven’t been applied yet. - -*Ex: If unit A depends on unit B and unit B hasn’t been applied yet, then run-all plan will show the plan for B, but exit with an error when trying to show the plan for A.* - -```bash -cd root -terragrunt run-all plan -``` - -If your units have dependencies between them, for example, you can’t deploy the backend-app until MySQL and redis are deployed—you’ll need to express those dependencies in your Terragrunt configuration as explained in the next section. - -Additional note: If your units have dependencies between them, and you run a `terragrunt run-all destroy` command, Terragrunt will destroy all the units under the current working directory, *as well as each of the unit dependencies* (that is, units you depend on via `dependencies` and `dependency` blocks)! If you wish to use exclude dependencies from being destroyed, add the `--queue-exclude-external` flag, or use the `--queue-exclude-dir` once for each directory you wish to exclude. - -### Passing outputs between units - -Consider the following file structure: - -```tree -root -├── backend-app -│ ├── main.tf -│ └── terragrunt.hcl -├── mysql -│ ├── main.tf -│ └── terragrunt.hcl -├── redis -│ ├── main.tf -│ └── terragrunt.hcl -└── vpc - ├── main.tf - └── terragrunt.hcl -``` - -Suppose that you wanted to pass in the VPC ID of the VPC that is created from the `vpc` unit in the folder structure above to the `mysql` unit as an input variable. Or if you wanted to pass in the subnet IDs of the private subnet that is allocated as part of the `vpc` unit. - -You can use the `dependency` block to extract the output variables to access another unit’s output variables in the terragrunt `inputs` attribute. - -For example, suppose the `vpc` unit outputs the ID under the name `vpc_id`. To access that output, you would specify in `mysql/terragrunt.hcl`: - -```hcl -dependency "vpc" { - config_path = "../vpc" -} - -inputs = { - vpc_id = dependency.vpc.outputs.vpc_id -} -``` - -When you apply this unit, the output will be read from the `vpc` unit and passed in as an input to the `mysql` unit right before calling `tofu apply`/`terraform apply`. - -You can also specify multiple `dependency` blocks to access multiple different unit output variables. For example, in the above folder structure, you might want to reference the `domain` output of the `redis` and `mysql` units for use as `inputs` in the `backend-app` unit. To access those outputs, you would specify in `backend-app/terragrunt.hcl`: - -```hcl -dependency "mysql" { - config_path = "../mysql" -} - -dependency "redis" { - config_path = "../redis" -} - -inputs = { - mysql_url = dependency.mysql.outputs.domain - redis_url = dependency.redis.outputs.domain -} -``` - -Note that each `dependency` is automatically considered a dependency in Terragrunt. This means that when you run `run-all apply` on a config that has `dependency` blocks, Terragrunt will not attempt to deploy the config until all the units referenced in `dependency` blocks have been applied. So for the above example, the order for the `run-all apply` command would be: - -1. Deploy the VPC - -2. Deploy MySQL and Redis in parallel - -3. Deploy the backend-app - -If any of the units failed to deploy, then Terragrunt will not attempt to deploy the units that depend on them. - -**Note**: Not all blocks are able to access outputs passed by `dependency` blocks. See the section on [Configuration parsing order]({{site.baseurl}}/docs/getting-started/configuration/#configuration-parsing-order) for more information. - -#### Unapplied dependency and mock outputs - -Terragrunt will return an error indicating the dependency hasn’t been applied yet if the unit referenced in a `dependency` block has not been applied yet. This is because you cannot actually fetch outputs out of an unapplied unit, even if there are no resources being created in the unit. - -This is most problematic when running commands that do not modify state (e.g `run-all plan` and `run-all validate`) on a completely new setup where no infrastructure has been deployed. You won’t be able to `plan` or `validate` a unit if you can’t determine the `inputs`. If the unit depends on the outputs of another unit that hasn’t been applied yet, you won’t be able to compute the `inputs` unless the dependencies are all applied. However, in real life usage, you would want to run `run-all validate` or `run-all plan` on a completely new set of infrastructure. - -To address this, you can provide mock outputs to use when a unit hasn’t been applied yet. This is configured using the `mock_outputs` attribute on the `dependency` block and it corresponds to a map that will be injected in place of the actual dependency outputs if the target config hasn’t been applied yet. - -For example, in the previous example with a `mysql` unit and `vpc` unit, suppose you wanted to place in a temporary, dummy value for the `vpc_id` during a `run-all validate` for the `mysql` unit. You can specify in `mysql/terragrunt.hcl`: - -```hcl -dependency "vpc" { - config_path = "../vpc" - - mock_outputs = { - vpc_id = "temporary-dummy-id" - } -} - -inputs = { - vpc_id = dependency.vpc.outputs.vpc_id -} -``` - -You can now run `validate` on this config before the `vpc` unit is applied because Terragrunt will use the map `{vpc_id = "temporary-dummy-id"}` as the `outputs` attribute on the dependency instead of erroring out. - -What if you wanted to restrict this behavior to only the `validate` command? For example, you might not want to use the defaults for a `plan` operation because the plan doesn’t give you any indication of what is actually going to be created. - -You can use the `mock_outputs_allowed_terraform_commands` attribute to indicate that the `mock_outputs` should only be used when running those OpenTofu/Terraform commands. So to restrict the `mock_outputs` to only when `validate` is being run, you can modify the above `terragrunt.hcl` file to: - -```hcl -dependency "vpc" { - config_path = "../vpc" - - mock_outputs = { - vpc_id = "temporary-dummy-id" - } - mock_outputs_allowed_terraform_commands = ["validate"] -} - -inputs = { - vpc_id = dependency.vpc.outputs.vpc_id -} -``` - -Note that indicating `validate` means that the `mock_outputs` will be used either with `validate` or with `run-all validate`. - -You can also use `skip_outputs` on the `dependency` block to specify the dependency without pulling in the outputs: - -```hcl -dependency "vpc" { - config_path = "../vpc" - skip_outputs = true -} -``` - -When `skip_outputs` is used with `mock_outputs`, mocked outputs will be returned without pulling in the outputs from remote states. This can be useful when you disable the backend initialization (`remote_state.disable_init`) in CI for example. - -```hcl -dependency "vpc" { - config_path = "../vpc" - mock_outputs = { - vpc_id = "temporary-dummy-id" - } - - skip_outputs = true -} -``` - -You can also use `mock_outputs_merge_strategy_with_state` on the `dependency` block to merge the mocked outputs and the state outputs : - -```hcl -dependency "vpc" { - config_path = "../vpc" - mock_outputs = { - vpc_id = "temporary-dummy-id" - new_output = "temporary-dummy-value" - } - - mock_outputs_merge_strategy_with_state = "shallow" -} -``` - -If the state outputs only contains `vpc_id`, this value will be preserved. And `new_output` which is not existing, the mock value will be used. - -### Dependencies between units - -You can also specify dependencies explicitly. Consider the following file structure: - -```tree -root -├── backend-app -│ ├── main.tf -│ └── terragrunt.hcl -├── frontend-app -│ ├── main.tf -│ └── terragrunt.hcl -├── mysql -│ ├── main.tf -│ └── terragrunt.hcl -├── redis -│ ├── main.tf -│ └── terragrunt.hcl -└── vpc - ├── main.tf - └── terragrunt.hcl -``` - -Let’s assume you have the following dependencies between OpenTofu/Terraform units: - -- `backend-app` depends on `mysql`, `redis`, and `vpc` - -- `frontend-app` depends on `backend-app` and `vpc` - -- `mysql` depends on `vpc` - -- `redis` depends on `vpc` - -- `vpc` has no dependencies - -You can express these dependencies in your `terragrunt.hcl` config files using a `dependencies` block. For example, in `backend-app/terragrunt.hcl` you would specify: - -``` hcl -dependencies { - paths = ["../vpc", "../mysql", "../redis"] -} -``` - -Similarly, in `frontend-app/terragrunt.hcl`, you would specify: - -``` hcl -dependencies { - paths = ["../vpc", "../backend-app"] -} -``` - -Once you’ve specified the dependencies in each `terragrunt.hcl` file, when you run the `terragrunt run-all apply` or `terragrunt run-all destroy`, Terragrunt will ensure that the dependencies are applied or destroyed, respectively, in the correct order. For the example at the start of this section, the order for the `run-all apply` command would be: - -1. Deploy the VPC - -2. Deploy MySQL and Redis in parallel - -3. Deploy the backend-app - -4. Deploy the frontend-app - -If any of the units fail to deploy, then Terragrunt will not attempt to deploy the units that depend on them. Once you’ve fixed the error, it’s usually safe to re-run the `run-all apply` or `run-all destroy` command again, since it’ll be a no-op for the units that already deployed successfully, and should only affect the ones that had an error the last time around. - -To check all of your dependencies and validate the code in them, you can use the `run-all validate` command. - -To check the dependency graph you can use the `graph-dependencies` command (similar to the `terraform graph` command), -the graph is output in DOT format The typical program that can read this format is GraphViz, but many web services are also available to read this format. - -```bash -terragrunt graph-dependencies | dot -Tsvg > graph.svg -``` - -In the example above it'll generate this graph - -![terragrunt graph-dependencies]({{site.baseurl}}/assets/img/collections/documentation/graph.png) - -Note that this graph shows the dependency relationship in the direction of the arrow (top down), however terragrunt will run the action -in reverse order (bottom up) - -**Note:** During execution of `destroy` command, Terragrunt will try to find all dependent units and show a confirmation prompt with a list of all detected dependencies, because once resources will be destroyed, any commands on dependent units will fail with missing dependencies. For example, if `destroy` was called on the `redis` unit, you will be asked to confirm the action because `backend-app` depends on `redis`. You can avoid the prompt by using `--non-interactive`. - -### Testing multiple units locally - -If you are using Terragrunt to configure [remote OpenTofu/Terraform configurations]({{site.baseurl}}/docs/features/keep-your-terraform-code-dry/#remote-terraform-configurations) and all of your units have the `source` parameter set to a Git URL, but you want to test with a local checkout of the code, you can use the `--source` parameter: - -```bash -cd root -terragrunt run-all plan --source /source/modules -``` - -If you set the `--source` parameter, the `run-all` commands will assume that parameter is pointing to a folder on your local file system that has a local checkout of all of your OpenTofu/Terraform modules. For each unit that is being processed via a `run-all` command, Terragrunt will read in the `source` parameter in that unit’s `terragrunt.hcl` file, parse out the path (the portion after the double-slash), and append the path to the `--source` parameter to create the final local path for that unit. - -For example, consider the following `terragrunt.hcl` file: - -``` hcl -terraform { - source = "git::git@github.com:acme/infrastructure-modules.git//networking/vpc?ref=v0.0.1" -} -``` - -If you run `terragrunt run-all apply --source /source/infrastructure-modules`, then the local path Terragrunt will compute for the module above will be `/source/infrastructure-modules//networking/vpc`. - -### Limiting the unit execution parallelism - -By default Terragrunt will not impose a limit on the number of units it executes when it traverses the dependency graph, -meaning that if it finds 5 units it'll run OpenTofu/Terraform 5 times in parallel once in each unit. Sometimes -this might create a problem if there are a lot of units in the dependency graph like hitting a rate limit on some -cloud provider. - -To limit the maximum number of unit executions at any given time use the `--parallelism [number]` flag - -```sh -terragrunt run-all apply --parallelism 4 -``` - -### Saving OpenTofu/Terraform plan output - -Terragrunt enables you to save the execution plan to a designated directory in binary or JSON format, which is helpful for reviewing and reusing the plan at a later time. -To save the plan, use the `--out-dir` flag (or `TG_OUT_DIR` environment variable) as demonstrated below: - -```sh -$ terragrunt run-all plan --out-dir /tmp/tfplan -$ tree /tmp/tfplan -/tmp/tfplan -├── app1 -│   └── tfplan.tfplan -├── app2 -│   └── tfplan.tfplan -├── app3 -│   └── tfplan.tfplan -└── project-2 - └── project-2-app1 - └── tfplan.tfplan -$ terragrunt run-all apply --out-dir /tmp/tfplan -``` - -For planning a destroy operation, use the following commands: - -```sh -terragrunt run-all plan -destroy --out-dir /tmp/tfplan -terragrunt run-all apply --out-dir /tmp/tfplan -``` - -To save plan in json format use `--json-out-dir` flag (or `TG_JSON_OUT_DIR` environment variable): - -```sh -$ terragrunt run-all plan --json-out-dir /tmp/json -$ tree /tmp/json -/tmp/json -├── app1 -│   └── tfplan.json -├── app2 -│   └── tfplan.json -├── app3 -│   └── tfplan.json -└── project-2 - └── project-2-app1 - └── tfplan.json - -# combine binary and json plans -$ terragrunt run-all plan --out-dir /tmp/all --json-out-dir /tmp/all -$ tree /tmp/all -/tmp/all -├── app1 -│   ├── tfplan.json -│   └── tfplan.tfplan -├── app2 -│   ├── tfplan.json -│   └── tfplan.tfplan -├── app3 -│   ├── tfplan.json -│   └── tfplan.tfplan -└── project-2 - └── project-2-app1 - ├── tfplan.json - └── tfplan.tfplan -``` - -Notes: - -- The plan for each unit will be saved the same hierarchy as the unit structure. -- The file name for the plans are `tfplan.tfplan` for the plan binary and `tfplan.json` for the plan JSON. -- JSON plan files can't be used with `terragrunt run-all apply` command, only binary plan files can be used. -- Output directories can be combined which will lead to saving both binary and JSON plans. diff --git a/docs/_docs/02_features/work-with-multiple-aws-accounts.md b/docs/_docs/02_features/work-with-multiple-aws-accounts.md deleted file mode 100644 index 8109809e4d..0000000000 --- a/docs/_docs/02_features/work-with-multiple-aws-accounts.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -layout: collection-browser-doc -title: Work with multiple AWS accounts -category: features -categories_url: features -excerpt: Learn how the Terragrunt may help you to work with multiple AWS accounts. -tags: ["AWS", "Use cases", "CLI", "AWS IAM"] -order: 225 -nav_title: Documentation -nav_title_link: /docs/ ---- - -## Work with multiple AWS accounts - -### Motivation - -The most secure way to manage infrastructure in AWS is to use [multiple AWS accounts](https://aws.amazon.com/organizations/getting-started/best-practices/). You define all your IAM users in one account (e.g., the "security" account) and deploy all of your infrastructure into a number of other accounts (e.g., the "dev", "stage", and "prod" accounts). To access those accounts, you login to the security account and [assume an IAM role](http://docs.aws.amazon.com/cli/latest/userguide/cli-roles.html) in the other accounts. - -There are a few ways to assume IAM roles when using AWS CLI tools, such as OpenTofu/Terraform: - -1. One option is to create a named [profile](http://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html), each with a different [role_arn](http://docs.aws.amazon.com/cli/latest/userguide/cli-roles.html) parameter. You then tell OpenTofu/Terraform which profile to use via the `AWS_PROFILE` environment variable. The downside to using profiles is that you have to store your AWS credentials in plaintext on your hard drive. - -2. Another option is to use environment variables and the [AWS CLI](https://aws.amazon.com/cli/). You first set the credentials for the security account (the one where your IAM users are defined) as the environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` and run `aws sts assume-role --role-arn `. This gives you back a blob of JSON that contains new `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` values you can set as environment variables to allow OpenTofu/Terraform to use that role. The advantage of this approach is that you can store your AWS credentials in a secret store and never write them to disk in plaintext. The disadvantage is that assuming an IAM role requires several tedious steps. Worse yet, the credentials you get back from the `assume-role` command are only good for up to 1 hour, so you have to repeat this process often. - -3. A final option is to modify your AWS provider with the [assume_role configuration](https://www.terraform.io/docs/providers/aws/#assume-role) and your S3 backend with the [role_arn parameter](https://opentofu.org/docs/language/settings/backends/s3/#assume-role-configuration). You can then set the credentials for the security account (the one where your IAM users are defined) as the environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` and when you run `terraform apply` or `terragrunt apply`, OpenTofu/Terraform / Terragrunt will assume the IAM role you specify automatically. The advantage of this approach is that you can store your AWS credentials in a secret store and never write them to disk in plaintext, and you get fresh credentials on every run of `apply`, without the complexity of calling `assume-role`. The disadvantage is that you have to modify all your OpenTofu/Terraform / Terragrunt code to set the `role_arn` param and your OpenTofu/Terraform backend configuration will change (and prompt you to manually confirm the update\!) every time you change the IAM role you’re using. - -To avoid these frustrating trade-offs, you can configure Terragrunt to assume an IAM role for you, as described next. - -### Configuring Terragrunt to assume an IAM role - -To tell Terragrunt to assume an IAM role, just set the `--iam-assume-role` command line argument: - -```bash -terragrunt apply --iam-assume-role "arn:aws:iam::ACCOUNT_ID:role/ROLE_NAME" -``` - -Alternatively, you can set the `TG_IAM_ASSUME_ROLE` environment variable: - -```bash -export TG_IAM_ROLE="arn:aws:iam::ACCOUNT_ID:role/ROLE_NAME" -terragrunt apply -``` - -Additionally, you can specify an `iam_role` property in the terragrunt config: - -```hcl -iam_role = "arn:aws:iam::ACCOUNT_ID:role/ROLE_NAME" -``` - -Terragrunt will resolve the value of the option by first looking for the cli argument, then looking for the environment variable, then defaulting to the value specified in the config file. - -Terragrunt will call the `sts assume-role` API on your behalf and expose the credentials it gets back as environment variables when running OpenTofu/Terraform. The advantage of this approach is that you can store your AWS credentials in a secret store and never write them to disk in plaintext, you get fresh credentials on every run of Terragrunt, without the complexity of calling `assume-role` yourself, and you don’t have to modify your OpenTofu/Terraform code or backend configuration at all. diff --git a/docs/_docs/04_reference/cli.md b/docs/_docs/04_reference/cli.md index 2368129c5c..4e8947bdcd 100644 --- a/docs/_docs/04_reference/cli.md +++ b/docs/_docs/04_reference/cli.md @@ -15,7 +15,7 @@ redirect_from: ## Commands -Terragrunt supports the following Commands: +Terragrunt supports the following commands: - [All OpenTofu/Terraform built-in commands](#all-opentofuterraform-built-in-commands) - [run-all](#run-all) @@ -35,8 +35,9 @@ Terragrunt supports the following Commands: ### All OpenTofu/Terraform built-in commands Terragrunt is an orchestration tool for OpenTofu/Terraform, so except for a few of the special commands defined in these docs, -Terragrunt forwards all other commands to OpenTofu/Terraform. For example, when you run `terragrunt apply`, Terragrunt executes -`tofu apply`/`terraform apply`. +Terragrunt forwards all other commands to OpenTofu/Terraform. + +For example, when you run `terragrunt apply`, Terragrunt executes `tofu apply`/`terraform apply`. Examples: @@ -48,7 +49,7 @@ terragrunt destroy # etc ``` -Run `terraform --help` to get the full list. +Run `tofu/terraform --help` to get the full list of available OpenTofu/Terraform commands respectively. ### run-all From d7dcc272de2271bef96f188159996b0fc13521d2 Mon Sep 17 00:00:00 2001 From: Yousif Akbar <11247449+yhakbar@users.noreply.github.com> Date: Tue, 7 Jan 2025 12:21:17 -0500 Subject: [PATCH 08/10] feat: Adding migration guide --- .../05_migration_guides/renamed-flags.md | 163 ++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 docs/_docs/05_migration_guides/renamed-flags.md diff --git a/docs/_docs/05_migration_guides/renamed-flags.md b/docs/_docs/05_migration_guides/renamed-flags.md new file mode 100644 index 0000000000..c0d8222378 --- /dev/null +++ b/docs/_docs/05_migration_guides/renamed-flags.md @@ -0,0 +1,163 @@ +--- +layout: collection-browser-doc +title: CLI Redesign +category: migrate +categories_url: migrate +excerpt: Migration guide to adopt changes from RFC 3445 +tags: ["migration", "community"] +order: 503 +nav_title: Documentation +nav_title_link: /docs/ +--- + +## Background + +As part of the redesign in [#3445](https://github.com/gruntwork-io/terragrunt/issues/3445), several CLI adjustments have been made to improve user experience and consistency. This guide will help you understand the changes and how to adapt to them. + +Note that this guide is being written while work is in progress (WIP), so some of the changes may not be fully implemented yet. We'll do our best to keep this guide up to date as the changes are finalized. + +The high-level changes made as a part of that RFC that require migration for current users are as follows: + +- The `terragrunt-` prefix has been removed from all flags. +- All environment variables have had their prefixes renamed to `TG_` instead of `TERRAGRUNT_`. +- A new `run` command has been introduced to the CLI that also handles the responsibilities of deprecated `run-all` and `graph` commands. +- **WIP:** Arguments are no longer sent to `tofu` / `terraform` by default. +- **WIP:** A new `backend` command has been introduced to support users in interacting with backends. +- **WIP:** Infrequently used commands have been reorganized into a structure that makes it easier to find them. + +## Migration guide + +All of the changes you need to make to adopt to this new CLI design involve changing how you invoke Terragrunt. + +### Remove `terragrunt-` prefix from flags + +If you are currently using flags that are prefixed with `terragrunt-`, you will need to stop using that flag, and use a differently named one instead (usually the same exact flag with `terragrunt-` removed from the beginning, but not always). + +For example, if you are using the `--terragrunt-non-interactive` flag, you will need to switch to the [`--non-interactive`](/docs/reference/cli/#non-interactive) flag instead. + +Before: + +```bash +terragrunt plan --terragrunt-non-interactive +``` + +After: + +```bash +terragrunt plan --non-interactive +``` + +Sometimes, the flag change might be slightly more involved than simply removing the `terragrunt-` prefix. + +For example, if you are using the `--terragrunt-debug` flag, you will need to switch to the [`--debug-inputs`](/docs/reference/cli/#debug-inputs) flag instead. + +Before: + +```bash +terragrunt plan --terragrunt-debug +``` + +After: + +```bash +terragrunt plan --debug-inputs +``` + +You can find the new flag names in the [CLI reference](/docs/reference/cli/) (including the deprecated flags they replace). + +### Update environment variables + +If you are currently using environment variables to configure Terragrunt, you will need to stop using that environment variable, and use a differently named one instead (usually the same exact environment variable with `TERRAGRUNT_` replaced with `TG_`, but not always). + +For example, if you are using the `TERRAGRUNT_NON_INTERACTIVE` environment variable, you will need to switch to the [`TG_NON_INTERACTIVE`](/docs/reference/cli/#non-interactive) environment variable instead. + +Before: + +```bash +export TERRAGRUNT_NON_INTERACTIVE=true +``` + +After: + +```bash +export TG_NON_INTERACTIVE=true +``` + +Sometimes, the environment variable change might be slightly more involved than simply replacing `TERRAGRUNT_` with `TG_`. + +For example, if you are using the `TERRAGRUNT_DEBUG` environment variable, you will need to switch to the [`TG_DEBUG_INPUTS`](/docs/reference/cli/#debug-inputs) environment variable instead. + +Before: + +```bash +export TERRAGRUNT_DEBUG=true +``` + +After: + +```bash +export TG_DEBUG_INPUTS=true +``` + +You can find the new environment variable names in the [CLI reference](/docs/reference/cli/) (including the deprecated environment variables they replace). + +### Use the new `run` command + +The `run` command has been introduced to the CLI to handle the responsibility currently held by the default command in Terragrunt. + +If you want to tell Terragrunt that what you are running is a command in the orchestrated IaC tool (OpenTofu/Terraform), you can use the `run` command to explicitly indicate this. + +For example, if you are currently using the `terragrunt` command to run `plan`, you can switch to the `run plan` command instead. + +Before: + +```bash +terragrunt plan +``` + +After: + +```bash +terragrunt run plan +``` + +Note that certain shortcuts will be supported out of the box, such as `terragrunt plan`, so you can continue to use most `run` commands without the `run` keyword, as you were doing before. + +For example, the following command will continue to work as expected: + +```bash +terragrunt plan +``` + +The commands that will not receive shortcuts are OpenTofu/Terraform commands that are not recommended for usage with Terragrunt, or have a conflict with the Terragrunt CLI API. + +For example, the `workspace` command will not receive a shortcut, as you are encouraged not to use workspaces when working with Terragrunt. Terragrunt manages state isolation for you, so you don't need to use workspaces. + +If you would like to explicitly run a command that does not have a shortcut, you can use the `run` command to do so: + +```bash +terragrunt run workspace ls +``` + +Similarly, commands like `graph` won't be supported as a shortcut, as `graph` is a now deprecated command in the Terragrunt CLI. Supporting it as a shortcut would be misleading, so you can use the `run` command to run it explicitly: + +```bash +terragrunt run graph +``` + +In addition to allowing for explicit invocation of OpenTofu/Terraform instead of using shortcuts, the `run` command also takes on the responsibilities of the now deprecated `run-all` and `graph` commands using flags. + +For example, if you are currently using the `terragrunt run-all` command, you can switch to the `run` command with the `--all` flag instead. + +Before: + +```bash +terragrunt run-all plan +``` + +After: + +```bash +terragrunt run --all plan +``` + From 83e2783908cb8dea619e025eb14c6367f9356129 Mon Sep 17 00:00:00 2001 From: Jake Hebert Date: Tue, 7 Jan 2025 12:24:14 -0600 Subject: [PATCH 09/10] Feat/add subscribe banner (#3731) * feat(docs): add home page subscribe banner * fix(docs): update contact form to support hubspot tracking data but use manual API submission to better control form state * chore(docs): add integrity check to home page hubspot script --- docs/_pages/index/_form.html | 89 ++++++++++++ docs/_pages/index/_header.html | 32 +++-- docs/_pages/index/index.html | 5 +- docs/assets/css/global.scss | 232 ++++++++++++++++++++++++-------- docs/assets/css/pages/home.scss | 221 +++++++++++++++++++++++++++++- 5 files changed, 504 insertions(+), 75 deletions(-) create mode 100644 docs/_pages/index/_form.html diff --git a/docs/_pages/index/_form.html b/docs/_pages/index/_form.html new file mode 100644 index 0000000000..2cdd0741c1 --- /dev/null +++ b/docs/_pages/index/_form.html @@ -0,0 +1,89 @@ +
+
+ +
+
+ + + + diff --git a/docs/_pages/index/_header.html b/docs/_pages/index/_header.html index fb1464a9a2..d55c4edf6b 100644 --- a/docs/_pages/index/_header.html +++ b/docs/_pages/index/_header.html @@ -2,19 +2,31 @@ {% include navbar.html %}
- Hero + Hero
-

DRY and maintainable OpenTofu/Terraform code.

- - Terragrunt is a flexible orchestration tool that allows - Infrastructure as Code to scale. - - Get Started -
+

DRY and maintainable OpenTofu/Terraform code.

+ + Terragrunt is a flexible orchestration tool that allows Infrastructure + as Code to scale. + + Get Started +
-
- Shape +
+ Shape
diff --git a/docs/_pages/index/index.html b/docs/_pages/index/index.html index cb723abd5c..7076d7eeff 100644 --- a/docs/_pages/index/index.html +++ b/docs/_pages/index/index.html @@ -5,8 +5,7 @@ ---
- {% include_relative _header.html %} - {% include_relative _key-features.html %} - {% include_relative _built_by.html %} + {% include_relative _header.html %} {% include_relative _form.html %} {% + include_relative _key-features.html %} {% include_relative _built_by.html %} {% include links-n-use-cases.html %}
diff --git a/docs/assets/css/global.scss b/docs/assets/css/global.scss index cdff33c7b8..dc0508f348 100644 --- a/docs/assets/css/global.scss +++ b/docs/assets/css/global.scss @@ -43,7 +43,10 @@ body { padding-top: 40px; padding-bottom: 60px; - h1, h2, h3, h4 { + h1, + h2, + h3, + h4 { text-align: center; font-weight: bold; font-size: 44px; @@ -76,7 +79,8 @@ body { letter-spacing: 2px; line-height: 1; - &:focus, &:hover { + &:focus, + &:hover { transform: translateY(1px); box-shadow: 0 2px 8px 0 rgba(22, 62, 122, 0.53); } @@ -87,7 +91,8 @@ body { } .btn-primary { - &:focus, &:hover { + &:focus, + &:hover { color: #fff; } } @@ -96,20 +101,23 @@ body { background: #fff; color: #2d7ef4; - &:focus, &:hover { + &:focus, + &:hover { color: #2d7ef4; background: #fff; } } -.btn-lg, .btn-group-lg > .btn { +.btn-lg, +.btn-group-lg > .btn { height: 60px; border-radius: 30px; padding: 20px 30px; min-width: 200px; } -.btn-sm, .btn-group-sm > .btn { +.btn-sm, +.btn-group-sm > .btn { height: 40px; border-radius: 30px; padding: 5px 15px; @@ -119,7 +127,8 @@ body { } .btn-info { - &:focus, &:hover { + &:focus, + &:hover { color: #fff; } } @@ -137,7 +146,8 @@ body { .btn-light { background: #fff; - &:focus, &:hover { + &:focus, + &:hover { color: #13cfe7; background: #fff; } @@ -173,7 +183,8 @@ body { } .btn-primary { - &:focus, &:hover { + &:focus, + &:hover { background: #80cdfc; background: -webkit-linear-gradient(-45deg, #80cdfc, #579ff7); background: linear-gradient(135deg, #80cdfc, #579ff7); @@ -187,7 +198,8 @@ body { } .btn-info { - &:focus, &:hover { + &:focus, + &:hover { background: #ff024a; background: -webkit-linear-gradient(-45deg, #ff024a, #ff2f19); background: linear-gradient(135deg, #ff024a, #ff2f19); @@ -235,7 +247,9 @@ body { text-decoration: none; color: #2d7ef4; - &:hover, &:active, &:focus { + &:hover, + &:active, + &:focus { text-decoration: none; } @@ -256,7 +270,7 @@ body { // CODE // ------------------------------------------------------- .code-snippet { - font-family: 'Fira Mono', monospace; + font-family: "Fira Mono", monospace; pre { background: #f0f0f1; @@ -276,7 +290,7 @@ body { } .highlighter-rouge.language-plaintext .highlight { - background: #F5F3FD; + background: #f5f3fd; code { color: #545492; @@ -284,11 +298,11 @@ body { } pre[class*="language-"] { - background: #F5F3FD; + background: #f5f3fd; } code.highlighter-rouge.language-plaintext { - background: #F5F3FD; + background: #f5f3fd; color: #5b4de5; border-radius: 4px; padding-left: 8px; @@ -302,7 +316,12 @@ code { font-size: 87%; } -p code, h1 code, h2 code, h3 code, h4 code, h5 code { +p code, +h1 code, +h2 code, +h3 code, +h4 code, +h5 code { background: rgba(91, 77, 229, 0.1); color: #5b4de5; border-radius: 4px; @@ -313,13 +332,18 @@ p code, h1 code, h2 code, h3 code, h4 code, h5 code { // // GRADIENTS // ------------------------------------------------------- -.gradient-primary.gradient-vertical, .sub-page .navbar-default, .index-page .section-hero, .section-bg-blue, .how-it-works .section-hero { +.gradient-primary.gradient-vertical, +.sub-page .navbar-default, +.index-page .section-hero, +.section-bg-blue, +.how-it-works .section-hero { background: #4eb9fb; background: -webkit-linear-gradient(top, #4eb9fb, #2683f5); background: linear-gradient(to bottom, #4eb9fb, #2683f5); } -.gradient-primary.gradient-diagonal, .btn-primary { +.gradient-primary.gradient-diagonal, +.btn-primary { background: #4eb9fb; background: -webkit-linear-gradient(-45deg, #4eb9fb, #2683f5); background: linear-gradient(135deg, #4eb9fb, #2683f5); @@ -365,7 +389,8 @@ p code, h1 code, h2 code, h3 code, h4 code, h5 code { background: linear-gradient(135deg, #ff024a, #ff2f19); } } -.gradient-steel.gradient-vertical, .sub-page .section-hero { +.gradient-steel.gradient-vertical, +.sub-page .section-hero { background: #1a232d; background: -webkit-linear-gradient(top, #1a232d, #2e3b4a); background: linear-gradient(to bottom, #1a232d, #2e3b4a); @@ -432,7 +457,7 @@ p code, h1 code, h2 code, h3 code, h4 code, h5 code { } .section-blue { - background-color: #0FC0EF; + background-color: #0fc0ef; color: #fff; } @@ -501,7 +526,9 @@ p code, h1 code, h2 code, h3 code, h4 code, h5 code { } .sub-page .section-hero { - background: url('../img/bg-header-squares.png') center bottom no-repeat, linear-gradient(#1a232d, #2e3b4a); + background: + url("../img/bg-header-squares.png") center bottom no-repeat, + linear-gradient(#1a232d, #2e3b4a); } @media only screen { @@ -511,7 +538,7 @@ p code, h1 code, h2 code, h3 code, h4 code, h5 code { } .index-page .main .section-dark { - background-image: url('../img/bg-content-squares.png'); + background-image: url("../img/bg-content-squares.png"); background-position: center top; background-repeat: no-repeat; } @@ -532,7 +559,8 @@ p code, h1 code, h2 code, h3 code, h4 code, h5 code { bottom: -260px; right: 6px; z-index: 980; - background: url('../img/infrastructure-cube-icons/infrastructure-endcap.png') right bottom no-repeat; + background: url("../img/infrastructure-cube-icons/infrastructure-endcap.png") + right bottom no-repeat; background-size: 224px 305px; } } @@ -567,7 +595,8 @@ p code, h1 code, h2 code, h3 code, h4 code, h5 code { padding-bottom: 0; margin-bottom: -30px; - h1, h2 { + h1, + h2 { margin-bottom: 0; line-height: 1.4; } @@ -576,78 +605,142 @@ p code, h1 code, h2 code, h3 code, h4 code, h5 code { // // HEADING // ---------------------------------------------- -h1, .h1, h2, .h2, h3, .h3 { +h1, +.h1, +h2, +.h2, +h3, +.h3 { font-weight: 200; } .section-colorful-bg { - h1, .h1, h2, .h2, h3, .h3, h4, .h4 { + h1, + .h1, + h2, + .h2, + h3, + .h3, + h4, + .h4 { color: #ffffff; } } -h1, .h1 { +h1, +.h1 { margin-top: 38.88px; margin-bottom: 27px; line-height: 1.15; } -h2, .h2 { +h2, +.h2 { margin-top: 32.4px; margin-bottom: 21.6px; line-height: 1.21; } -h3, .h3 { +h3, +.h3 { margin-top: 27px; margin-bottom: 19.44px; line-height: 1.27; } -h4, .h4 { +h4, +.h4 { margin-top: 23.76px; margin-bottom: 17.28px; line-height: 1.33; } -h5, .h5 { +h5, +.h5 { margin-top: 20.52px; margin-bottom: 15.12px; line-height: 1.4; } -h6, .h6 { +h6, +.h6 { margin-top: 18.36px; margin-bottom: 14.04px; line-height: 1.45; } @media all and (max-width: 992px) { - h1, .h1 { + h1, + .h1 { font-size: 44px; } - h2, .h2 { + h2, + .h2 { font-size: 38px; } - h3, .h3 { + h3, + .h3 { font-size: 36px; } - h4, .h4 { + h4, + .h4 { font-size: 32px; } - h5, .h5 { + h5, + .h5 { font-size: 26px; } - h6, .h6 { + h6, + .h6 { font-size: 20px; } } +@media all and (max-width: 430px) { + h1, + h2, + h3, + h4, + h5, + h6 { + word-wrap: break-word; + } + h1, + .h1 { + font-size: 40px; + } + + h2, + .h2 { + font-size: 34px; + } + + h3, + .h3 { + font-size: 32px; + } + + h4, + .h4 { + font-size: 28px; + } + + h5, + .h5 { + font-size: 22px; + } + + h6, + .h6 { + font-size: 16px; + } +} + .h2-tag-style { font-size: 16px; text-transform: uppercase; @@ -666,11 +759,23 @@ h6, .h6 { } .section > .container > .row > div[class*="col-"] > { - p:first-child, h1:first-child, h2:first-child, h3:first-child, h4:first-child, h5:first-child, h6:first-child { + p:first-child, + h1:first-child, + h2:first-child, + h3:first-child, + h4:first-child, + h5:first-child, + h6:first-child { margin-top: 0; } - p:last-child, h1:last-child, h2:last-child, h3:last-child, h4:last-child, h5:last-child, h6:last-child { + p:last-child, + h1:last-child, + h2:last-child, + h3:last-child, + h4:last-child, + h5:last-child, + h6:last-child { margin-bottom: 0; } } @@ -733,9 +838,9 @@ footer hr { .navbar-nav > li > .dropdown-menu { margin-top: -20px; border-top-width: 2px; - border-right: 2px solid #194C5F; - border-bottom: 2px solid #194C5F; - border-left: 2px solid #194C5F; + border-right: 2px solid #194c5f; + border-bottom: 2px solid #194c5f; + border-left: 2px solid #194c5f; } .navbar-nav { @@ -746,7 +851,7 @@ footer hr { span { margin-right: 12px; padding: 0; - background: linear-gradient(101.84deg, #FE3162 2.31%, #FF4F47 98.56%); + background: linear-gradient(101.84deg, #fe3162 2.31%, #ff4f47 98.56%); border-radius: 3.5px; font-weight: 600; min-width: 52px; @@ -772,10 +877,11 @@ footer hr { } .close { - opacity: 1.0; + opacity: 1; } -.navbar-default, .navbar-collapse { +.navbar-default, +.navbar-collapse { border: none; } @@ -814,7 +920,8 @@ footer hr { margin-bottom: 19px; margin-left: 20px; - &:hover, &:focus { + &:hover, + &:focus { color: #fff; } } @@ -892,7 +999,8 @@ label { p a:not(.btn) { text-decoration: underline; - &:hover, &:focus { + &:hover, + &:focus { text-decoration: underline; } @@ -902,7 +1010,7 @@ p a:not(.btn) { } a.caret-right::after { - font-family: 'FontAwesome'; + font-family: "FontAwesome"; content: "\f0da"; margin-left: 4px; } @@ -910,7 +1018,8 @@ a.caret-right::after { .section-blue a { color: #fff; - &:hover, &:focus { + &:hover, + &:focus { color: rgba(255, 255, 255, 0.7); } } @@ -919,13 +1028,13 @@ a.caret-right::after { // TEXT-DECORATION // ------------------------------------------------------- -.new-badge{ +.new-badge { background: #ee4f5d; padding: 0px 10px; border-radius: 3px; display: inline-block; color: #fff; - font-family: 'Source Sans Pro', sans-serif; + font-family: "Source Sans Pro", sans-serif; font-size: 16px; font-weight: 800; } @@ -946,7 +1055,8 @@ a.caret-right::after { text-decoration: none; } - &:focus, &:active { + &:focus, + &:active { text-decoration: none; } @@ -981,7 +1091,7 @@ a.caret-right::after { width: 100%; bottom: -34px; z-index: 990; - background-image: url('../img/hr-boxes.png'); + background-image: url("../img/hr-boxes.png"); background-position: center bottom; background-repeat: no-repeat; background-size: 80px 55px; @@ -1008,7 +1118,8 @@ a.caret-right::after { a { color: rgba(100, 123, 156, 0.8); - &:hover, &:focus { + &:hover, + &:focus { color: #647b9c; } } @@ -1039,11 +1150,17 @@ a.caret-right::after { font-size: 14px; } - a, ul > li > a { + a, + ul > li > a { color: #fff; } - a:hover, ul > li > a:hover, a:active, ul > li > a:active, a:focus, ul > li > a:focus { + a:hover, + ul > li > a:hover, + a:active, + ul > li > a:active, + a:focus, + ul > li > a:focus { color: #fff; text-decoration: none; } @@ -1154,7 +1271,6 @@ a.caret-right::after { } } - .terragrunt-logo { align-items: center; } diff --git a/docs/assets/css/pages/home.scss b/docs/assets/css/pages/home.scss index 33d0c7c875..797b3d68dd 100644 --- a/docs/assets/css/pages/home.scss +++ b/docs/assets/css/pages/home.scss @@ -35,7 +35,7 @@ body.index-page { right: -100px; width: 250px; height: 400px; - background: url('/assets/img/home/t-o-3@3x.png'); + background: url("/assets/img/home/t-o-3@3x.png"); background-position: top left; background-size: 250px 400px; background-repeat: no-repeat; @@ -80,6 +80,10 @@ body.index-page { padding: 15px; max-width: 600px; position: relative; + + display: flex; + flex-direction: column; + justify-content: center; h1 { line-height: 1; @@ -95,6 +99,7 @@ body.index-page { .btn { min-width: 250px; + width: fit-content; } } } @@ -151,6 +156,155 @@ body.index-page { transform: translateX(-50%); } } + + .section-newsletter { + z-index: 30; + background-color: #f8f9fa; + padding: 60px 0 80px; + width: 100%; + + .container { + max-width: 650px; + margin: 0 auto; + padding: 0 15px; + } + + .newsletter-content { + max-width: 800px; + margin: 0 auto; + text-align: center; + + .subtitle { + font-size: 22px; + line-height: 1.23; + margin-bottom: 30px; + } + + .form-container { + position: relative; + height: 45px; + margin: 0 auto; + max-width: 500px; + + .custom-form { + transition: opacity 0.3s ease, transform 0.3s ease; + + .form-group { + display: flex; + gap: 10px; + margin: 0 auto; + } + + .custom-input { + flex: 1; + height: 45px; + padding: 10px 15px; + border: 1px solid #ddd; + border-radius: 4px; + font-size: 16px; + + &:focus { + outline: none; + border-color: #007bff; + } + } + + .btn { + height: 45px; + padding: 0 25px; + white-space: nowrap; + position: relative; + transition: all 0.3s ease; + + .button-text { + transition: opacity 0.2s ease; + } + + .button-loader { + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + width: 20px; + height: 20px; + border: 2px solid rgba(255,255,255,0.3); + border-radius: 50%; + border-top-color: #fff; + opacity: 0; + display: none; + animation: spin 0.8s linear infinite; + } + + &.loading { + pointer-events: none; + + .button-text { + opacity: 0; + } + + .button-loader { + opacity: 1; + display: block; + } + } + } + } + + .success-message { + position: absolute; + top: 0; + left: 0; + right: 0; + opacity: 0; + transform: translateY(10px); + transition: all 0.3s ease; + text-align: center; + pointer-events: none; + + .checkmark { + display: inline-block; + width: 30px; + height: 30px; + background: #28a745; + border-radius: 50%; + color: white; + line-height: 30px; + margin-bottom: 10px; + transform: scale(0); + transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); + } + + p { + margin: 0; + color: #28a745; + font-size: 16px; + } + } + + &.success { + .custom-form { + opacity: 0; + transform: translateY(-10px); + pointer-events: none; + } + + .success-message { + opacity: 1; + transform: translateY(0); + pointer-events: auto; + + .checkmark { + transform: scale(1); + } + } + } + } + + .hidden { + display: none; + } + } + } } @media all and (max-width: 1600px) { @@ -160,6 +314,7 @@ body.index-page { } .index-page__header .img-container .header-shapes-hero { + pointer-events: none; left: 15px; } } @@ -216,7 +371,7 @@ body.index-page { .text-container { text-align: center; - max-width: 700px; + max-width: 100%; .subtitle { font-size: 16px; @@ -234,7 +389,8 @@ body.index-page { } img { - &.custom-width, &.custom-width-2 { + &.custom-width, + &.custom-width-2 { display: none; } } @@ -254,6 +410,53 @@ body.index-page { } } } + + .index-page__header { + .index-page__header-form { + .custom-form { + .form-group { + flex-direction: column; + gap: 15px; + } + + .btn { + width: 100%; + } + } + } + } + + .section-newsletter { + padding: 40px 0; + + .newsletter-content { + .subtitle { + font-size: 16px; + padding: 0 20px; + } + + .form-container { + height: auto; + padding: 0 20px; + + .custom-form { + .form-group { + flex-direction: column; + gap: 15px; + } + + .btn { + width: 100%; + } + } + + .success-message { + position: relative; + margin-top: 20px; + } + } + } + } } } @@ -270,7 +473,17 @@ body.index-page { } @media all and (max-width: 480px) { - body.index-page .index-page__key-features .index-page__key-feature .code-snippet pre { + body.index-page + .index-page__key-features + .index-page__key-feature + .code-snippet + pre { font-size: 10px; } } + +@keyframes spin { + to { + transform: translate(-50%, -50%) rotate(360deg); + } +} From dc99e42670bb6629d27dab196becb154f30020e3 Mon Sep 17 00:00:00 2001 From: Yousif Akbar <11247449+yhakbar@users.noreply.github.com> Date: Tue, 7 Jan 2025 14:37:36 -0500 Subject: [PATCH 10/10] fix: Reorganizing commands --- docs/_docs/04_reference/cli.md | 742 +++++++++--------- .../{renamed-flags.md => cli-redesign.md} | 0 2 files changed, 373 insertions(+), 369 deletions(-) rename docs/_docs/05_migration_guides/{renamed-flags.md => cli-redesign.md} (100%) diff --git a/docs/_docs/04_reference/cli.md b/docs/_docs/04_reference/cli.md index 4e8947bdcd..e8169c63c4 100644 --- a/docs/_docs/04_reference/cli.md +++ b/docs/_docs/04_reference/cli.md @@ -15,26 +15,37 @@ redirect_from: ## Commands -Terragrunt supports the following commands: +The main commands available in Terragrunt are: -- [All OpenTofu/Terraform built-in commands](#all-opentofuterraform-built-in-commands) -- [run-all](#run-all) -- [terragrunt-info](#terragrunt-info) -- [validate-inputs](#validate-inputs) -- [graph-dependencies](#graph-dependencies) -- [hclfmt](#hclfmt) -- [hclvalidate](#hclvalidate) -- [aws-provider-patch](#aws-provider-patch) -- [render-json](#render-json) -- [output-module-groups](#output-module-groups) -- [scaffold](#scaffold) -- [catalog](#catalog) -- [graph](#graph) -- [exec](#exec) +- [Main commands](#main-commands) + - [OpenTofu shortcuts](#opentofu-shortcuts) + - [run](#run) + - [exec](#exec) + - [run-all](#run-all) + - [graph](#graph) + +The commands relevant to managing an IaC catalog are: -### All OpenTofu/Terraform built-in commands +- [Catalog commands](#catalog-commands) + - [catalog](#catalog) + - [scaffold](#scaffold) -Terragrunt is an orchestration tool for OpenTofu/Terraform, so except for a few of the special commands defined in these docs, +The commands used for managing Terragrunt configuration itself are: + +- [Configuration commands](#configuration-commands) + - [graph-dependencies](#graph-dependencies) + - [hclfmt](#hclfmt) + - [hclvalidate](#hclvalidate) + - [output-module-groups](#output-module-groups) + - [render-json](#render-json) + - [terragrunt-info](#terragrunt-info) + - [validate-inputs](#validate-inputs) + +### Main commands + +#### OpenTofu shortcuts + +Terragrunt is an orchestration tool for OpenTofu/Terraform, so with the exception of a few special commands defined in these docs, Terragrunt forwards all other commands to OpenTofu/Terraform. For example, when you run `terragrunt apply`, Terragrunt executes `tofu apply`/`terraform apply`. @@ -51,7 +62,63 @@ terragrunt destroy Run `tofu/terraform --help` to get the full list of available OpenTofu/Terraform commands respectively. -### run-all +**[WARNING] The [CLI Redesign](https://github.com/gruntwork-io/terragrunt/issues/3445) is currently underway, and that will result in some changes to the shortcuts available in Terragrunt. In the future, you may need to use the `run` command to execute OpenTofu/Terraform commands that don't have a shortcut. For more information read [the migration guide](/docs/migrate/cli-redesign/).** + +#### run + +Run the provided OpenTofu/Terraform command against the unit in the current working directory. + +Example: + +```bash +terragrunt run plan +``` + +Note that the `run` command is a more explicit way to run OpenTofu/Terraform commands, and it is recommended to use it when you need to run OpenTofu/Terraform commands that don't have a shortcut in Terragrunt. + +The `run` command also supports the following flags that can be used to drive runs in multiple units: + +- [`--all`](#all): Run the provided OpenTofu/Terraform command against all units in the current stack. This is equivalent to the deprecated `run-all` command. +- [`--graph`](#graph): Run the provided OpenTofu/Terraform command against the graph of dependencies for the unit in the current working directory. This is equivalent to the deprecated `graph` command. + +You may, at times, need to explicitly separate the flags used for Terragrunt from those used for OpenTofu/Terraform. In those circumstances, you can use the argument `--` to separate the Terragrunt flags from the OpenTofu/Terraform flags. + +Example: + +```bash +terragrunt run plan -- -no-color +``` + +#### exec + +Execute an arbitrary command orchestrated by Terragrunt. + +In contrast to the `run` command, which will always invoke OpenTofu/Terraform, the `exec` command allows for execution of any arbitrary command via Terragrunt. + +This can be useful, as it allows you full control over the process that is being orchestrated by Terragrunt, while taking advantage of Terragrunt's features such as dependency resolution, inputs, and more. + +Example: + +```bash +terragrunt exec -- echo "Hello, Terragrunt!" +``` + +When using `exec`, you will have almost the exact same context that you have when using `run`, including inputs. + +Example: + +```hcl +inputs = { + message = "Hello, Terragrunt!" +} +``` + +```bash +$ terragrunt exec -- env | grep 'TF_VAR_message' +TF_VAR_message=Hello, Terragrunt! +``` + +#### run-all Runs the provided OpenTofu/Terraform command against a [stack](/docs/getting-started/terminology/#stack). The command will recursively find terragrunt [units](/docs/getting-started/terminology/#unit) in the current directory @@ -102,87 +169,126 @@ The algorithm for determining the aggregate exit code is as follows: - If any unit throws a 2, but nothing throws a 1, Terragrunt will throw a 2. - If nothing throws a non-zero, Terragrunt will throw a 0. -### terragrunt-info +#### graph -Emits limited terragrunt state on `stdout` in a JSON format and exits. +Run the provided OpenTofu/Terraform command against the graph of dependencies for the module in the current working directory. The graph consists of all modules that depend on the module in the current working directory via a `depends_on` or `dependencies` block, plus all the modules that depend on those modules, and all the modules that depend on those modules, and so on, recursively up the tree, up to the Git repository root, or the path specified via the optional `--terragrunt-graph-root` argument. + +The Command will be executed following the order of dependencies: so it'll run on the module in the current working directory first, then on modules that depend on it directly, then on the modules that depend on those modules, and so on. Note that if the command is `destroy`, it will execute in the opposite order of the dependencies. Example: +Having below dependencies: +[![dependency-graph](/assets/img/collections/documentation/dependency-graph.png){: width="80%" }]({{site.baseurl}}/assets/img/collections/documentation/dependency-graph.png) -```bash -terragrunt terragrunt-info -``` +Running `terragrunt graph apply` in `eks` module will lead to the following execution order: -Might produce output such as: +```text +Group 1 +- Module project/eks -```json -{ - "ConfigPath": "/example/path/terragrunt.hcl", - "DownloadDir": "/example/path/.terragrunt-cache", - "IamRole": "", - "TerraformBinary": "terraform", - "TerraformCommand": "terragrunt-info", - "WorkingDir": "/example/path" -} -``` +Group 2 +- Module project/services/eks-service-1 +- Module project/services/eks-service-2 -### validate-inputs +Group 3 +- Module project/services/eks-service-2-v2 +- Module project/services/eks-service-3 +- Module project/services/eks-service-5 -Emits information about the input variables that are configured with the given -terragrunt configuration. Specifically, this command will print out unused -inputs (inputs that are not defined as an OpenTofu/Terraform variable in the -corresponding module) and undefined required inputs (required OpenTofu/Terraform -variables that are not currently being passed in). +Group 4 +- Module project/services/eks-service-3-v2 +- Module project/services/eks-service-4 -Example: +Group 5 +- Module project/services/eks-service-3-v3 +``` -```bash -> terragrunt validate-inputs -The following inputs passed in by terragrunt are unused: +Notes: - - foo - - bar +- `lambda` modules aren't included in the graph, because they are not dependent on `eks` module. +- execution is from bottom up based on dependencies + +Running `terragrunt graph destroy` in `eks` module will lead to the following execution order: +```text +Group 1 +- Module project/services/eks-service-2-v2 +- Module project/services/eks-service-3-v3 +- Module project/services/eks-service-4 +- Module project/services/eks-service-5 -The following required inputs are missing: +Group 2 +- Module project/services/eks-service-3-v2 - - baz +Group 3 +- Module project/services/eks-service-3 + +Group 4 +- Module project/services/eks-service-1 +- Module project/services/eks-service-2 +Group 5 +- Module project/eks ``` -Note that this only checks for variables passed in in the following ways: +Notes: -- Configured `inputs` attribute. +- execution is in reverse order, first are destroyed "top" modules and in the end `eks` +- `lambda` modules aren't affected at all -- var files defined on `terraform.extra_arguments` blocks using `required_var_files` and `optional_var_files`. +Running `terragrunt graph apply` in `services/eks-service-3`: -- `-var-file` and `-var` CLI arguments defined on `terraform.extra_arguments` using `arguments`. +```text +Group 1 +- Module project/services/eks-service-3 -- `-var-file` and `-var` CLI arguments passed to terragrunt. +Group 2 +- Module project/services/eks-service-3-v2 +- Module project/services/eks-service-4 -- Automatically loaded var files (`terraform.tfvars`, `terraform.tfvars.json`, `*.auto.tfvars`, `*.auto.tfvars.json`) +Group 3 +- Module project/services/eks-service-3-v3 -- `TF_VAR` environment variables defined on `terraform.extra_arguments` blocks. +``` -- `TF_VAR` environment variables defined in the environment. +Notes: -Be aware that other ways to pass variables to `tofu`/`terraform` are not checked by this command. +- in execution are included only services dependent from `eks-service-3` -Additionally, there are **two modes** in which the `validate-inputs` command can be run: **relaxed** (default) and **strict**. +Running `terragrunt graph destroy` in `services/eks-service-3`: -If you run the `validate-inputs` command without flags, relaxed mode will be enabled by default. In relaxed mode, any unused variables -that are passed, but not used by the underlying OpenTofu/Terraform configuration, will generate a warning, but not an error. Missing required variables will _always_ return an error, whether `validate-inputs` is running in relaxed or strict mode. +```text +Group 1 +- Module project/services/eks-service-3-v3 +- Module project/services/eks-service-4 -To enable strict mode, you can pass the `--strict-validate` flag like so: +Group 2 +- Module project/services/eks-service-3-v2 -```bash -> terragrunt validate-inputs --strict-validate +Group 3 +- Module project/services/eks-service-3 ``` -When running in strict mode, `validate-inputs` will return an error if there are unused inputs. +Notes: -This command will exit with an error if terragrunt detects any unused inputs or undefined required inputs. +- destroy will be executed only on subset of services dependent from `eks-service-3` + +### Catalog commands + +#### catalog + +Launch the user interface for searching and managing your module catalog. -### graph-dependencies +More details in [catalog section](https://terragrunt.gruntwork.io/docs/features/catalog/). + +#### scaffold + +Generate Terragrunt files from existing OpenTofu/Terraform modules. + +More details in [scaffold section](https://terragrunt.gruntwork.io/docs/features/scaffold/). + +### Configuration commands + +#### graph-dependencies Prints the terragrunt dependency graph, in DOT format, to `stdout`. You can generate charts from DOT format using tools such as [GraphViz](http://www.graphviz.org/). @@ -225,7 +331,7 @@ digraph { } ``` -### hclfmt +#### hclfmt Recursively find hcl files and rewrite them into a canonical format. @@ -238,7 +344,7 @@ terragrunt hclfmt This will recursively search the current working directory for any folders that contain Terragrunt configuration files and run the equivalent of `tofu fmt`/`terraform fmt` on them. -### hclvalidate +#### hclvalidate Find all hcl files from the configuration stack and validate them. @@ -267,69 +373,42 @@ Example: terragrunt hclvalidate --show-config-path ``` -### aws-provider-patch - -Overwrite settings on nested AWS providers to work around several OpenTofu/Terraform bugs. Due to -[issue #13018](https://github.com/hashicorp/terraform/issues/13018) and -[issue #26211](https://github.com/hashicorp/terraform/issues/26211), the `import` command may fail if your OpenTofu/Terraform -code uses a module that has a `provider` block nested within it that sets any of its attributes to computed values. -This command is a hacky attempt at working around this problem by allowing you to temporarily hard-code those -attributes so `import` can work. +#### output-module-groups -You specify which attributes to hard-code using the [`--override-attr`](#override-attr) option, -passing it `ATTR=VALUE`, where `ATTR` is the attribute name and `VALUE` is the new value. `VALUE` is assumed to be a -json encoded string, which means that you must have quotes (e.g., `--override-attr 'region="eu-west-1"'`). -Additionally, note that `ATTR` can specify attributes within a nested block by specifying `.`, where -`` is the block name. +Output groups of modules ordered for apply (or destroy) as a list of list in JSON. -For example, let's say you had a `provider` block in a module that looked like this: +Example: -```hcl -provider "aws" { - region = var.aws_region - allowed_account_ids = var.allowed_account_ids - assume_role { - role_arn = var.role_arn - } -} +```bash +terragrunt output-module-groups ``` -Both the `region` and `role_arn` parameters are set to dynamic values, which will trigger those OpenTofu/Terraform bugs. To work -around it, run the following command: +Optional sub-commands: -```bash -# NOTE: The single quotes around the args is to allow you to pass through the " character in the args via bash quoting -# rules. -terragrunt aws-provider-patch \ - --override-attr 'region="eu-west-1"' \ - --override-attr 'assume_role.role_arn=""' \ - --override-attr 'allowed_account_ids=["00000000"]' -``` +- apply (default) +- destroy -When you run the command above, Terragrunt will: +This will recursively search the current working directory for any folders that contain Terragrunt modules and build +the dependency graph based on [`dependency`](/docs/reference/config-blocks-and-attributes/#dependency) and +[`dependencies`](/docs/reference/config-blocks-and-attributes/#dependencies) blocks and output the graph as a JSON list of list (unless the sub-command is destroy, in which case the command will output the reverse dependency order). -1. Run `tofu init`/`terraform init` to download the code for all your modules into `.terraform/modules`. -1. Scan all the OpenTofu/Terraform code in `.terraform/modules`, find AWS `provider` blocks, and for each one, hard-code: - 1. The `region` param to `"eu-west-1"`. - 1. The `role_arn` within the `assume_role` block to `""`. - 1. The `allowed_account_ids` param to `["0000000"]`. +This can be be useful in several scenarios, such as in CICD, when determining apply order or searching for all files to apply with CLI options +such as [`--units-that-include`](#units-that-include) -The result will look like this: +This may produce output such as: -```hcl -provider "aws" { - region = "eu-west-1" - allowed_account_ids = ["0000000"] - assume_role { - role_arn = "" - } +```json +{ + "Group 1": ["stage/frontend-app"], + "Group 2": ["stage/backend-app"], + "Group 3": ["mgmt/bastion-host", "stage/search-app"], + "Group 4": ["mgmt/kms-master-key", "stage/mysql", "stage/redis"], + "Group 5": ["stage/vpc"], + "Group 6": ["mgmt/vpc"] } ``` -This should allow you to run `import` on the module and work around those OpenTofu/Terraform bugs. When you're done running -`import`, remember to delete your overridden code! E.g., Delete the `.terraform` or `.terragrunt-cache` folders. - -### render-json +#### render-json Render out the final interpreted `terragrunt.hcl` file (that is, with all the includes merged, dependencies resolved/interpolated, function calls executed, etc) as json. @@ -386,164 +465,88 @@ Example: } ``` -### output-module-groups +#### terragrunt-info -Output groups of modules ordered for apply (or destroy) as a list of list in JSON. +Emits limited terragrunt state on `stdout` in a JSON format and exits. Example: ```bash -terragrunt output-module-groups +terragrunt terragrunt-info ``` -Optional sub-commands: - -- apply (default) -- destroy - -This will recursively search the current working directory for any folders that contain Terragrunt modules and build -the dependency graph based on [`dependency`](/docs/reference/config-blocks-and-attributes/#dependency) and -[`dependencies`](/docs/reference/config-blocks-and-attributes/#dependencies) blocks and output the graph as a JSON list of list (unless the sub-command is destroy, in which case the command will output the reverse dependency order). - -This can be be useful in several scenarios, such as in CICD, when determining apply order or searching for all files to apply with CLI options -such as [`--units-that-include`](#units-that-include) - -This may produce output such as: +Might produce output such as: ```json { - "Group 1": ["stage/frontend-app"], - "Group 2": ["stage/backend-app"], - "Group 3": ["mgmt/bastion-host", "stage/search-app"], - "Group 4": ["mgmt/kms-master-key", "stage/mysql", "stage/redis"], - "Group 5": ["stage/vpc"], - "Group 6": ["mgmt/vpc"] + "ConfigPath": "/example/path/terragrunt.hcl", + "DownloadDir": "/example/path/.terragrunt-cache", + "IamRole": "", + "TerraformBinary": "terraform", + "TerraformCommand": "terragrunt-info", + "WorkingDir": "/example/path" } ``` -### scaffold - -Generate Terragrunt files from existing OpenTofu/Terraform modules. - -More details in [scaffold section](https://terragrunt.gruntwork.io/docs/features/scaffold/). - -### catalog - -Launch the user interface for searching and managing your module catalog. - -More details in [catalog section](https://terragrunt.gruntwork.io/docs/features/catalog/). - -### graph - -Run the provided OpenTofu/Terraform command against the graph of dependencies for the module in the current working directory. The graph consists of all modules that depend on the module in the current working directory via a `depends_on` or `dependencies` block, plus all the modules that depend on those modules, and all the modules that depend on those modules, and so on, recursively up the tree, up to the Git repository root, or the path specified via the optional `--terragrunt-graph-root` argument. +#### validate-inputs -The Command will be executed following the order of dependencies: so it'll run on the module in the current working directory first, then on modules that depend on it directly, then on the modules that depend on those modules, and so on. Note that if the command is `destroy`, it will execute in the opposite order of the dependencies. +Emits information about the input variables that are configured with the given +terragrunt configuration. Specifically, this command will print out unused +inputs (inputs that are not defined as an OpenTofu/Terraform variable in the +corresponding module) and undefined required inputs (required OpenTofu/Terraform +variables that are not currently being passed in). Example: -Having below dependencies: -[![dependency-graph](/assets/img/collections/documentation/dependency-graph.png){: width="80%" }]({{site.baseurl}}/assets/img/collections/documentation/dependency-graph.png) - -Running `terragrunt graph apply` in `eks` module will lead to the following execution order: - -```text -Group 1 -- Module project/eks - -Group 2 -- Module project/services/eks-service-1 -- Module project/services/eks-service-2 - -Group 3 -- Module project/services/eks-service-2-v2 -- Module project/services/eks-service-3 -- Module project/services/eks-service-5 - -Group 4 -- Module project/services/eks-service-3-v2 -- Module project/services/eks-service-4 - -Group 5 -- Module project/services/eks-service-3-v3 -``` - -Notes: - -- `lambda` modules aren't included in the graph, because they are not dependent on `eks` module. -- execution is from bottom up based on dependencies -Running `terragrunt graph destroy` in `eks` module will lead to the following execution order: +```bash +> terragrunt validate-inputs +The following inputs passed in by terragrunt are unused: -```text -Group 1 -- Module project/services/eks-service-2-v2 -- Module project/services/eks-service-3-v3 -- Module project/services/eks-service-4 -- Module project/services/eks-service-5 + - foo + - bar -Group 2 -- Module project/services/eks-service-3-v2 -Group 3 -- Module project/services/eks-service-3 +The following required inputs are missing: -Group 4 -- Module project/services/eks-service-1 -- Module project/services/eks-service-2 + - baz -Group 5 -- Module project/eks ``` -Notes: +Note that this only checks for variables passed in in the following ways: -- execution is in reverse order, first are destroyed "top" modules and in the end `eks` -- `lambda` modules aren't affected at all +- Configured `inputs` attribute. -Running `terragrunt graph apply` in `services/eks-service-3`: +- var files defined on `terraform.extra_arguments` blocks using `required_var_files` and `optional_var_files`. -```text -Group 1 -- Module project/services/eks-service-3 +- `-var-file` and `-var` CLI arguments defined on `terraform.extra_arguments` using `arguments`. -Group 2 -- Module project/services/eks-service-3-v2 -- Module project/services/eks-service-4 +- `-var-file` and `-var` CLI arguments passed to terragrunt. -Group 3 -- Module project/services/eks-service-3-v3 +- Automatically loaded var files (`terraform.tfvars`, `terraform.tfvars.json`, `*.auto.tfvars`, `*.auto.tfvars.json`) -``` +- `TF_VAR` environment variables defined on `terraform.extra_arguments` blocks. -Notes: +- `TF_VAR` environment variables defined in the environment. -- in execution are included only services dependent from `eks-service-3` +Be aware that other ways to pass variables to `tofu`/`terraform` are not checked by this command. -Running `terragrunt graph destroy` in `services/eks-service-3`: +Additionally, there are **two modes** in which the `validate-inputs` command can be run: **relaxed** (default) and **strict**. -```text -Group 1 -- Module project/services/eks-service-3-v3 -- Module project/services/eks-service-4 +If you run the `validate-inputs` command without flags, relaxed mode will be enabled by default. In relaxed mode, any unused variables +that are passed, but not used by the underlying OpenTofu/Terraform configuration, will generate a warning, but not an error. Missing required variables will _always_ return an error, whether `validate-inputs` is running in relaxed or strict mode. -Group 2 -- Module project/services/eks-service-3-v2 +To enable strict mode, you can pass the `--strict-validate` flag like so: -Group 3 -- Module project/services/eks-service-3 +```bash +> terragrunt validate-inputs --strict-validate ``` -Notes: - -- destroy will be executed only on subset of services dependent from `eks-service-3` - -### exec +When running in strict mode, `validate-inputs` will return an error if there are unused inputs. -Execute a command using Terragrunt. +This command will exit with an error if terragrunt detects any unused inputs or undefined required inputs. ## Flags -The currently available flags are: - - [Flags](#flags) - [auth-provider-cmd](#auth-provider-cmd) - [config](#config) @@ -616,9 +619,9 @@ The currently available flags are: **CLI Arg**: `--config`
-**CLI Arg Alias**: `--terragrunt-config` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-config` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_CONFIG`
-**Environment Variable Alias**: `TERRAGRUNT_CONFIG` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_CONFIG` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Requires an argument**: `--config /path/to/terragrunt.hcl`
A custom path to the `terragrunt.hcl` or `terragrunt.hcl.json` file. The @@ -629,9 +632,9 @@ explanation). This argument is not used with the `run-all` commands. ### tfpath **CLI Arg**: `--tf-path`
-**CLI Arg Alias**: `--terragrunt-tfpath` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-tfpath` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_TF_PATH`
-**Environment Variable Alias**: `TERRAGRUNT_TFPATH` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_TFPATH` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Requires an argument**: `--tfpath /path/to/tofu-or-terraform-binary`
An explicit path to the `tofu` or `terraform` binary you wish to have Terragrunt use. @@ -649,9 +652,9 @@ configuration values specified in the `terragrunt.hcl` config for both the top l ### no-auto-init **CLI Arg**: `--no-auto-init`
-**CLI Arg Alias**: `--terragrunt-no-auto-init` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-no-auto-init` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_NO_AUTO_INIT` (set to `true`)
-**Environment Variable Alias**: `TERRAGRUNT_NO_AUTO_INIT` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_NO_AUTO_INIT` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
_(Prior to Terragrunt v0.48.6, this environment variable was called `TERRAGRUNT_AUTO_INIT` (set to `false`), and is still available for backwards compatibility)_ When passed in, don't automatically run `terraform init` when other commands are run (e.g. `terragrunt apply`). Useful @@ -663,9 +666,9 @@ disabled. See [Auto-Init]({{site.baseurl}}/docs/features/auto-init#auto-init) ### no-auto-approve **CLI Arg**: `--no-auto-approve`
-**CLI Arg Alias**: `--terragrunt-no-auto-approve` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-no-auto-approve` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_NO_AUTO_APPROVE` (set to `true`)
-**Environment Variable Alias**: `TERRAGRUNT_NO_AUTO_APPROVE` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_NO_AUTO_APPROVE` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
_(Prior to Terragrunt v0.48.6, this environment variable was called `TERRAGRUNT_AUTO_APPROVE` (set to `false`), and is still available for backwards compatibility)_ **Commands**: @@ -678,9 +681,9 @@ with `run-all`. Note that due to the interactive prompts, this flag will also ** ### no-auto-retry **CLI Arg**: `--no-auto-retry`
-**CLI Arg Alias**: `--terragrunt-no-auto-retry` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-no-auto-retry` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_NO_AUTO_RETRY` (set to `true`)
-**Environment Variable Alias**: `TERRAGRUNT_NO_AUTO_RETRY` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_NO_AUTO_RETRY` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
_(Prior to Terragrunt v0.48.6, this environment variable was called `TERRAGRUNT_AUTO_RETRY` (set to `false`), and is still available for backwards compatibility)_ When passed in, don't automatically retry commands which fail with transient errors. See @@ -689,9 +692,9 @@ When passed in, don't automatically retry commands which fail with transient err ### non-interactive **CLI Arg**: `--non-interactive`
-**CLI Arg Alias**: `--terragrunt-non-interactive` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-non-interactive` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_NON_INTERACTIVE` (set to `true`)
-**Environment Variable Alias**: `TERRAGRUNT_NON_INTERACTIVE` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_NON_INTERACTIVE` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
_(Prior to Terragrunt v0.48.6, this environment variable was called `TF_INPUT` (set to `false`), and is still available for backwards compatibility. NOTE: [TF_INPUT](https://developer.hashicorp.com/terraform/cli/config/environment-variables#tf_input) is native to OpenTofu/Terraform!)_ When passed in, don't show interactive user prompts. This will default the answer for all Terragrunt (not OpenTofu/Terraform) prompts to `yes` except for @@ -716,9 +719,9 @@ Is how you would make Terragrunt apply without any user prompts from Terragrunt ### working-dir **CLI Arg**: `--working-dir`
-**CLI Arg Alias**: `--terragrunt-working-dir` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-working-dir` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_WORKING_DIR`
-**Environment Variable Alias**: `TERRAGRUNT_WORKING_DIR` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_WORKING_DIR` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Requires an argument**: `--working-dir /path/to/working-directory`
Set the directory where Terragrunt should execute the `terraform` command. Default is the current working directory. @@ -729,9 +732,9 @@ finds. ### download-dir **CLI Arg**: `--download-dir`
-**CLI Arg Alias**: `--terragrunt-download-dir` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-download-dir` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_DOWNLOAD_DIR`
-**Environment Variable Alias**: `TERRAGRUNT_DOWNLOAD` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_DOWNLOAD` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Requires an argument**: `--download-dir /path/to/dir-to-download-terraform-code`
The path where to download OpenTofu/Terraform code when using [remote OpenTofu/Terraform @@ -741,9 +744,9 @@ Default is `.terragrunt-cache` in the working directory. We recommend adding thi ### source **CLI Arg**: `--source`
-**CLI Arg Alias**: `--terragrunt-source` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-source` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_SOURCE`
-**Environment Variable Alias**: `TERRAGRUNT_SOURCE` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_SOURCE` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Requires an argument**: `--source /path/to/local-terraform-code`
Download OpenTofu/Terraform configurations from the specified source into a temporary folder, and run OpenTofu/Terraform in that temporary @@ -756,9 +759,9 @@ to the `--source` parameter you passed in. ### source-map **CLI Arg**: `--source-map`
-**CLI Arg Alias**: `--terragrunt-source-map` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-source-map` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_SOURCE_MAP` (encoded as comma separated value, e.g., `source1=dest1,source2=dest2`)
-**Environment Variable Alias**: `TERRAGRUNT_SOURCE_MAP` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_SOURCE_MAP` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Requires an argument**: `--source-map git::ssh://github.com=/path/to/local-terraform-code`
Can be supplied multiple times: `--source-map source1=dest1 --source-map source2=dest2` @@ -786,18 +789,18 @@ Note that this only performs literal matches on the URL portion. For example, a ### source-update **CLI Arg**: `--source-update`
-**CLI Arg Alias**: `--terragrunt-source-update` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-source-update` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_SOURCE_UPDATE` (set to `true`)
-**Environment Variable Alias**: `TERRAGRUNT_SOURCE_UPDATE` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_SOURCE_UPDATE` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
When passed in, delete the contents of the temporary folder before downloading OpenTofu/Terraform source code into it. ### iam-assume-role **CLI Arg**: `--iam-assume-role`
-**CLI Arg Alias**: `--terragrunt-iam-role` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-iam-role` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_IAM_ASSUME_ROLE`
-**Environment Variable Alias**: `TERRAGRUNT_IAM_ROLE` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_IAM_ROLE` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Requires an argument**: `--iam-assume-role "arn:aws:iam::ACCOUNT_ID:role/ROLE_NAME"`
Assume the specified IAM role ARN before running OpenTofu/Terraform or AWS commands. This is a convenient way to use Terragrunt @@ -806,9 +809,9 @@ and OpenTofu/Terraform with multiple AWS accounts. ### iam-assume-role-duration **CLI Arg**: `--iam-assume-role-duration`
-**CLI Arg Alias**: `--terragrunt-iam-assume-role-duration` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-iam-assume-role-duration` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_IAM_ASSUME_ROLE_DURATION`
-**Environment Variable Alias**: `TERRAGRUNT_IAM_ASSUME_ROLE_DURATION` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_IAM_ASSUME_ROLE_DURATION` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Requires an argument**: `--iam-assume-role-duration 3600`
Uses the specified duration as the session duration (in seconds) for the STS session which assumes the role defined in `--iam-assume-role`. @@ -816,9 +819,9 @@ Uses the specified duration as the session duration (in seconds) for the STS ses ### iam-assume-role-session-name **CLI Arg**: `--iam-assume-role-session-name`
-**CLI Arg Alias**: `--terragrunt-iam-assume-role-session-name` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-iam-assume-role-session-name` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_IAM_ASSUME_ROLE_SESSION_NAME`
-**Environment Variable Alias**: `TERRAGRUNT_IAM_ASSUME_ROLE_SESSION_NAME` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_IAM_ASSUME_ROLE_SESSION_NAME` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Requires an argument**: `--iam-assume-role-session-name "terragrunt-iam-role-session-name"`
Used as the session name for the STS session which assumes the role defined in `--iam-assume-role`. @@ -826,9 +829,9 @@ Used as the session name for the STS session which assumes the role defined in ` ### iam-assume-role-web-identity-token **CLI Arg**: `--iam-assume-role-web-identity-token`
-**CLI Arg Alias**: `--terragrunt-iam-web-identity-token` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-iam-web-identity-token` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_IAM_ASSUME_ROLE_WEB_IDENTITY_TOKEN`
-**Environment Variable Alias**: `TERRAGRUNT_IAM_ASSUME_ROLE_WEB_IDENTITY_TOKEN` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_IAM_ASSUME_ROLE_WEB_IDENTITY_TOKEN` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Requires an argument**: `--iam-assume-role-web-identity-token [/path/to/web-identity-token | web-identity-token-value]`
Used as the web identity token for assuming a role temporarily using the AWS Security Token Service (STS) with the [AssumeRoleWithWebIdentity](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html) API. @@ -836,18 +839,18 @@ Used as the web identity token for assuming a role temporarily using the AWS Sec ### queue-ignore-errors **CLI Arg**: `--queue-ignore-errors`
-**CLI Arg Alias**: `--terragrunt-ignore-dependency-errors` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-ignore-dependency-errors` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_QUEUE_IGNORE_ERRORS`
-**Environment Variable Alias**: `TERRAGRUNT_IGNORE_DEPENDENCY_ERRORS` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_IGNORE_DEPENDENCY_ERRORS` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
When passed in, the `*-all` commands continue processing components even if a dependency fails ### queue-exclude-file **CLI Arg**: `--queue-exclude-file`
-**CLI Arg Alias**: `--terragrunt-excludes-file` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-excludes-file` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_QUEUE_EXCLUDES_FILE`
-**Environment Variable Alias**: `TERRAGRUNT_EXCLUDES_FILE` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_EXCLUDES_FILE` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Requires an argument**: `--queue-exclude-file /path/to/file`
Path to a file with a list of directories that need to be excluded when running *-all commands, by default `.terragrunt-excludes`. Modules under these directories will be @@ -863,9 +866,9 @@ terragrunt run-all plan --queue-exclude-file <(terragrunt hclvalidate --show-con ### queue-exclude-dir **CLI Arg**: `--queue-exclude-dir`
-**CLI Arg Alias**: `--terragrunt-exclude-dir` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-exclude-dir` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_QUEUE_EXCLUDE_DIR`
-**Environment Variable Alias**: `TERRAGRUNT_EXCLUDE_DIR` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_EXCLUDE_DIR` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Requires an argument**: `--queue-exclude-dir /path/to/dirs/to/exclude*`
Can be supplied multiple times: `--queue-exclude-dir /path/to/dirs/to/exclude --queue-exclude-dir /another/path/to/dirs/to/exclude` @@ -881,9 +884,9 @@ You should consider using `TERRAGRUNT_EXCLUDE_DIR="foo/module,bar/module"` inste ### queue-include-dir **CLI Arg**: `--queue-include-dir`
-**CLI Arg Alias**: `--terragrunt-include-dir` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-include-dir` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_QUEUE_INCLUDE_DIR`
-**Environment Variable Alias**: `TERRAGRUNT_INCLUDE_DIR` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_INCLUDE_DIR` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Requires an argument**: `--queue-include-dir /path/to/dirs/to/include*`
Can be supplied multiple times: `--queue-include-dir /path/to/dirs/to/include --queue-include-dir /another/path/to/dirs/to/include` @@ -898,9 +901,9 @@ You should consider using `TERRAGRUNT_INCLUDE_DIR="foo/module,bar/module"` inste ### queue-strict-include **CLI Arg**: `--queue-strict-include`
-**CLI Arg Alias**: `--terragrunt-strict-include` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-strict-include` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_QUEUE_STRICT_INCLUDE`
-**Environment Variable Alias**: `TERRAGRUNT_STRICT_INCLUDE` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_STRICT_INCLUDE` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
When passed in, only modules under the directories passed in with [--queue-include-dir](#queue-include-dir) will be included. All dependencies of the included directories will be excluded if they are not in the included @@ -910,18 +913,18 @@ any modules during the execution of the commands. ### queue-ignore-dag-order **CLI Arg**: `--queue-ignore-dag-order`
-**CLI Arg Alias**: `--terragrunt-ignore-dependency-order` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-ignore-dependency-order` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_QUEUE_IGNORE_DAG_ORDER`
-**Environment Variable Alias**: `TERRAGRUNT_IGNORE_DEPENDENCY_ORDER` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_IGNORE_DEPENDENCY_ORDER` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
When passed in, ignore the dependencies between modules when running `*-all` commands. ### queue-exclude-external **CLI Arg**: `--queue-exclude-external`
-**CLI Arg Alias**: `--terragrunt-ignore-external-dependencies` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-ignore-external-dependencies` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_QUEUE_EXCLUDE_EXTERNAL`
-**Environment Variable Alias**: `TERRAGRUNT_IGNORE_EXTERNAL_DEPENDENCIES` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_IGNORE_EXTERNAL_DEPENDENCIES` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
When passed in, don't attempt to include any external dependencies when running `*-all` commands. Note that an external dependency is a dependency that is outside the current terragrunt working directory, and is not respective to the @@ -930,9 +933,9 @@ included directories with `queue-include-dir`. ### queue-include-external **CLI Arg**: `--queue-include-external`
-**CLI Arg Alias**: `--terragrunt-include-external-dependencies` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-include-external-dependencies` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_QUEUE_INCLUDE_EXTERNAL`
-**Environment Variable Alias**: `TERRAGRUNT_INCLUDE_EXTERNAL_DEPENDENCIES` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_INCLUDE_EXTERNAL_DEPENDENCIES` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
When passed in, include any external dependencies when running `*-all` without asking. Note that an external dependency is a dependency that is outside the current terragrunt working directory, and is not respective to the @@ -941,18 +944,18 @@ included directories with `queue-include-dir`. ### strict-validate **CLI Arg**: `--strict-validate`
-**CLI Arg Alias**: `--terragrunt-strict-validate` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-strict-validate` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_STRICT_VALIDATE`
-**Environment Variable Alias**: `TERRAGRUNT_STRICT_VALIDATE` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_STRICT_VALIDATE` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
When passed in, and running `terragrunt validate-inputs`, enables strict mode for the `validate-inputs` command. When strict mode is enabled, an error will be returned if any variables required by the underlying OpenTofu/Terraform configuration are not passed in, OR if any unused variables are passed in. By default, `terragrunt validate-inputs` runs in relaxed mode. In relaxed mode, an error is only returned when a variable required by the underlying OpenTofu/Terraform configuration is not passed in. ### parallelism **CLI Arg**: `--parallelism`
-**CLI Arg Alias**: `--terragrunt-parallelism` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-parallelism` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_PARALLELISM`
-**Environment Variable Alias**: `TERRAGRUNT_PARALLELISM` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_PARALLELISM` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
When passed in, limit the number of modules that are run concurrently to this number during \*-all commands. The exception is the `terraform init` command, which is always executed sequentially if the [terraform plugin cache](https://developer.hashicorp.com/terraform/cli/config/config-file#provider-plugin-cache) is used. This is because the terraform plugin cache is not guaranteed to be concurrency safe. @@ -960,9 +963,9 @@ The exception is the `terraform init` command, which is always executed sequenti ### debug-inputs **CLI Arg**: `--debug-inputs`
-**CLI Arg Alias**: `--terragrunt-debug` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-debug` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_DEBUG_INPUTS`
-**Environment Variable Alias**: `TERRAGRUNT_DEBUG` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_DEBUG` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
When passed in, Terragrunt will create a tfvars file that can be used to invoke the terraform module in the same way that Terragrunt invokes the module, so that you can debug issues with the terragrunt config. See @@ -971,9 +974,9 @@ that Terragrunt invokes the module, so that you can debug issues with the terrag ### log-level **CLI Arg**: `--log-level`
-**CLI Arg Alias**: `--terragrunt-log-level` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-log-level` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_LOG_LEVEL`
-**Environment Variable Alias**: `TERRAGRUNT_LOG_LEVEL` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_LOG_LEVEL` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Requires an argument**: `--log-level `
When passed it, sets logging level for terragrunt. All supported levels are: @@ -991,9 +994,9 @@ Where the first two control the logging of Terraform/OpenTofu output. ### log-format **CLI Arg**: `--log-format`
-**CLI Arg Alias**: `--terragrunt-log-format` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-log-format` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_LOG_FORMAT`
-**Environment Variable Alias**: `TERRAGRUNT_LOG_FORMAT` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_LOG_FORMAT` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Requires an argument**: `--log-format `
There are four log format presets: @@ -1006,9 +1009,9 @@ There are four log format presets: ### log-custom-format **CLI Arg**: `--log-custom-format`
-**CLI Arg Alias**: `--terragrunt-log-custom-format` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-log-custom-format` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_LOG_CUSTOM_FORMAT`
-**Environment Variable Alias**: `TERRAGRUNT_LOG_CUSTOM_FORMAT` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_LOG_CUSTOM_FORMAT` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Requires an argument**: `--log-custom-format `
This allows you to customize logging however you like. @@ -1018,27 +1021,27 @@ Make sure to read [Custom Log Format](https://terragrunt.gruntwork.io/docs/featu ### log-disable **CLI Arg**: `--log-disable`
-**CLI Arg Alias**: `--terragrunt-log-disable` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-log-disable` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_LOG_DISABLE`
-**Environment Variable Alias**: `TERRAGRUNT_LOG_DISABLE` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_LOG_DISABLE` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
Disable logging. This flag also enables [tf-forward-stdout](#tf-forward-stdout). ### log-show-abs-paths **CLI Arg**: `--log-show-abs-paths`
-**CLI Arg Alias**: `--terragrunt-log-show-abs-paths` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-log-show-abs-paths` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_LOG_SHOW_ABS_PATHS`
-**Environment Variable Alias**: `TERRAGRUNT_LOG_SHOW_ABS_PATHS` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_LOG_SHOW_ABS_PATHS` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
If specified, Terragrunt paths in logs will be absolute. By default, the paths are relative to the working directory. ### no-color **CLI Arg**: `--no-color`
-**CLI Arg Alias**: `--terragrunt-no-color` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-no-color` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_NO_COLOR`
-**Environment Variable Alias**: `TERRAGRUNT_NO_COLOR` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_NO_COLOR` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
If specified, Terragrunt output won't contain any color. @@ -1047,9 +1050,9 @@ NOTE: This option also disables OpenTofu/Terraform output colors by propagating ### check **CLI Arg**: `--check`
-**CLI Arg Alias**: `--terragrunt-check` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-check` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_CHECK` (set to `true`)
-**Environment Variable Alias**: `TERRAGRUNT_CHECK` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_CHECK` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Commands**: - [hclfmt](#hclfmt) @@ -1060,9 +1063,9 @@ command to exit with exit code 1 if there are any files that are not formatted. ### diff **CLI Arg**: `--diff`
-**CLI Arg Alias**: `--terragrunt-diff` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-diff` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_DIFF` (set to `true`)
-**Environment Variable Alias**: `TERRAGRUNT_DIFF` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_DIFF` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Commands**: - [hclfmt](#hclfmt) @@ -1072,9 +1075,9 @@ When passed in, running `hclfmt` will print diff between original and modified f ### hclfmt-file **CLI Arg**: `--file`
-**CLI Arg Alias**: `--terragrunt-hclfmt-file` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-hclfmt-file` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_FILE` (set to `true`)
-**Environment Variable Alias**: `TERRAGRUNT_HCLFMT_FILE` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_HCLFMT_FILE` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Requires an argument**: `--file /path/to/terragrunt.hcl`
**Commands**: @@ -1085,9 +1088,9 @@ When passed in, run `hclfmt` only on the specified file. ### hclfmt-exclude-dir **CLI Arg**: `--exclude-dir`
-**CLI Arg Alias**: `--terragrunt-hclfmt-exclude-dir` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-hclfmt-exclude-dir` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_EXCLUDE_DIR`
-**Environment Variable Alias**: `TERRAGRUNT_HCLFMT_EXCLUDE_DIR` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_HCLFMT_EXCLUDE_DIR` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Requires an argument**: `--exclude-dir /path/to/dir`
**Commands**: @@ -1099,9 +1102,9 @@ When passed in, `hclfmt` will ignore files in the specified directories. ### hclfmt-stdin **CLI Arg**: `--stdin`
-**CLI Arg Alias**: `--terragrunt-hclfmt-stdin` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-hclfmt-stdin` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_STDIN` (set to `true`)
-**Environment Variable Alias**: `TERRAGRUNT_HCLFMT_STDIN` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_HCLFMT_STDIN` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Commands**: - [hclfmt](#hclfmt) @@ -1111,9 +1114,9 @@ When passed in, run `hclfmt` only on hcl passed to `stdin`, result is printed to ### hclvalidate-json **CLI Arg**: `--json`
-**CLI Arg Alias**: `--terragrunt-hclvalidate-json` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-hclvalidate-json` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_JSON` (set to `true`)
-**Environment Variable Alias**: `TERRAGRUNT_HCLVALIDATE_JSON` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_HCLVALIDATE_JSON` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Commands**: - [hclvalidate](#hclvalidate) @@ -1123,9 +1126,9 @@ When passed in, render the output in the JSON format. ### hclvalidate-show-config-path **CLI Arg**: `--show-config-path`
-**CLI Arg Alias**: `--terragrunt-hclvalidate-show-config-path` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-hclvalidate-show-config-path` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_SHOW_CONFIG_PATH` (set to `true`)
-**Environment Variable Alias**: `TERRAGRUNT_HCLVALIDATE_SHOW_CONFIG_PATH` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_HCLVALIDATE_SHOW_CONFIG_PATH` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Commands**: - [hclvalidate](#hclvalidate) @@ -1135,9 +1138,9 @@ When passed in, output a list of files with invalid configuration. ### override-attr **CLI Arg**: `--override-attr`
-**CLI Arg Alias**: `--terragrunt-override-attr` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-override-attr` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_OVERRIDE_ATTR` (set to `true`)
-**Environment Variable Alias**: `TERRAGRUNT_OVERRIDE_ATTR` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_OVERRIDE_ATTR` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Requires an argument**: `--override-attr ATTR=VALUE`
Override the attribute named `ATTR` with the value `VALUE` in a `provider` block as part of the [aws-provider-patch @@ -1148,9 +1151,9 @@ block by specifying `.`, where `` is the block name: e.g., ` ### out **CLI Arg**: `--out`
-**CLI Arg Alias**: `--terragrunt-json-out` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-json-out` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_OUT` (set to `true`)
-**Environment Variable Alias**: `TERRAGRUNT_JSON_OUT` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_JSON_OUT` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Requires an argument**: `--out /path/to/terragrunt_rendered.json`
**Commands**: @@ -1161,9 +1164,9 @@ When passed in, render the json representation in this file. ### disable-dependent-modules **CLI Arg**: `--disable-dependent-modules`
-**CLI Arg Alias**: `--terragrunt-json-disable-dependent-modules` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-json-disable-dependent-modules` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_DISABLE_DEPENDENT_MODULES` (set to `true`)
-**Environment Variable Alias**: `TERRAGRUNT_JSON_DISABLE_DEPENDENT_MODULES` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_JSON_DISABLE_DEPENDENT_MODULES` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Requires an argument**: `--disable-dependent-modules`
**Commands**: @@ -1175,9 +1178,9 @@ This lead to a faster rendering process, but the output will not include any dep ### units-that-include **CLI Arg**: `--units-that-include`
-**CLI Arg Alias**: `--terragrunt-modules-that-include` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-modules-that-include` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_UNITS_THAT_INCLUDE`
-**Environment Variable Alias**: `TERRAGRUNT_MODULES_THAT_INCLUDE` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_MODULES_THAT_INCLUDE` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Requires an argument**: `--units-that-include /path/to/included-terragrunt.hcl`
**Commands**: @@ -1249,8 +1252,8 @@ only for the `include` configuration block. **CLI Arg**: `--terragrunt-queue-include-units-reading`
**Environment Variable**: `TERRAGRUNT_QUEUE_INCLUDE_UNITS_READING`
-**CLI Arg Alias**: `` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
-**Environment Variable Alias**: `` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
+**Environment Variable Alias**: `` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Commands**: - [run-all](#run-all) @@ -1317,9 +1320,9 @@ block is not evaluated until _after_ the queue has been populated with units to ### dependency-fetch-output-from-state **CLI Arg**: `--dependency-fetch-output-from-state`
-**CLI Arg Alias**: `--terragrunt-fetch-dependency-output-from-state` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-fetch-dependency-output-from-state` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_DEPENDENCY_FETCH_OUTPUT_FROM_STATE` (set to `true`)
-**Environment Variable Alias**: `TERRAGRUNT_FETCH_DEPENDENCY_OUTPUT_FROM_STATE` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_FETCH_DEPENDENCY_OUTPUT_FROM_STATE` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
When using many dependencies, this option can speed up the dependency processing by fetching dependency output directly from the state file instead of init dependencies and running terraform on them. @@ -1329,9 +1332,9 @@ Currently only AWS S3 backend is supported. ### use-partial-parse-config-cache **CLI Arg**: `--use-partial-parse-config-cache`
-**CLI Arg Alias**: `--terragrunt-use-partial-parse-config-cache` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-use-partial-parse-config-cache` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_USE_PARTIAL_PARSE_CONFIG_CACHE` (set to `true`)
-**Environment Variable Alias**: `TERRAGRUNT_USE_PARTIAL_PARSE_CONFIG_CACHE` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_USE_PARTIAL_PARSE_CONFIG_CACHE` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
This flag can be used to drastically decrease time required for parsing Terragrunt files. The effect will only show if a lot of similar includes are expected such as the root terragrunt configuration (e.g. `root.hcl`) include. NOTE: This is an experimental feature, use with caution. @@ -1351,36 +1354,36 @@ Once this flag has been tested thoroughly, we will consider making it the defaul ### backend-require-bootstrap **CLI Arg**: `--backend-require-bootstrap`
-**CLI Arg Alias**: `--terragrunt-fail-on-state-bucket-creation` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-fail-on-state-bucket-creation` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_BACKEND_REQUIRE_BOOTSTRAP` (set to `true`)
-**Environment Variable Alias**: `TERRAGRUNT_FAIL_ON_STATE_BUCKET_CREATION` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_FAIL_ON_STATE_BUCKET_CREATION` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
When this flag is set, Terragrunt will fail and exit if it is necessary to create the remote state bucket. ### disable-bucket-update **CLI Arg**: `--disable-bucket-update`
-**CLI Arg Alias**: `--terragrunt-disable-bucket-update` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-disable-bucket-update` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_DISABLE_BUCKET_UPDATE` (set to `true`)
-**Environment Variable Alias**: `TERRAGRUNT_DISABLE_BUCKET_UPDATE` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_DISABLE_BUCKET_UPDATE` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
When this flag is set, Terragrunt does not update the remote state bucket, which is useful to set if the state bucket is managed by a third party. ### disable-command-validation **CLI Arg**: `--disable-command-validation`
-**CLI Arg Alias**: `--terragrunt-disable-command-validation` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-disable-command-validation` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_DISABLE_COMMAND_VALIDATION` (set to `true`)
-**Environment Variable Alias**: `TERRAGRUNT_DISABLE_COMMAND_VALIDATION` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_DISABLE_COMMAND_VALIDATION` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
When this flag is set, Terragrunt will not validate the terraform command, which can be useful when need to use non-existent commands in hooks. ### provider-cache **CLI Arg**: `--provider-cache`
-**CLI Arg Alias**: `--terragrunt-provider-cache` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-provider-cache` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_PROVIDER_CACHE`
-**Environment Variable Alias**: `TERRAGRUNT_PROVIDER_CACHE` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_PROVIDER_CACHE` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Commands**: - [run-all](#run-all) @@ -1390,9 +1393,9 @@ Enables Terragrunt's provider caching. This forces OpenTofu/Terraform to make pr ### provider-cache-dir **CLI Arg**: `--provider-cache-dir`
-**CLI Arg Alias**: `--terragrunt-provider-cache-dir` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-provider-cache-dir` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_PROVIDER_CACHE_DIR`
-**Environment Variable Alias**: `TERRAGRUNT_PROVIDER_CACHE_DIR` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_PROVIDER_CACHE_DIR` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Commands**: - [run-all](#run-all) @@ -1402,9 +1405,9 @@ The path to the Terragrunt provider cache directory. By default, `terragrunt/pro ### provider-cache-hostname **CLI Arg**: `--provider-cache-hostname`
-**CLI Arg Alias**: `--terragrunt-provider-cache-hostname` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-provider-cache-hostname` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_PROVIDER_CACHE_HOSTNAME`
-**Environment Variable Alias**: `TERRAGRUNT_PROVIDER_CACHE_HOSTNAME` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_PROVIDER_CACHE_HOSTNAME` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Commands**: - [run-all](#run-all) @@ -1414,9 +1417,9 @@ The hostname of the Terragrunt Provider Cache server. By default, 'localhost'. M ### provider-cache-port **CLI Arg**: `--provider-cache-port`
-**CLI Arg Alias**: `--terragrunt-provider-cache-port` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-provider-cache-port` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_PROVIDER_CACHE_PORT`
-**Environment Variable Alias**: `TERRAGRUNT_PROVIDER_CACHE_PORT` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_PROVIDER_CACHE_PORT` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Commands**: - [run-all](#run-all) @@ -1426,9 +1429,9 @@ The port of the Terragrunt Provider Cache server. By default, assigned automatic ### provider-cache-token **CLI Arg**: `--provider-cache-token`
-**CLI Arg Alias**: `--terragrunt-provider-cache-token` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-provider-cache-token` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_PROVIDER_CACHE_TOKEN`
-**Environment Variable Alias**: `TERRAGRUNT_PROVIDER_CACHE_TOKEN` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_PROVIDER_CACHE_TOKEN` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Commands**: - [run-all](#run-all) @@ -1438,9 +1441,9 @@ The Token for authentication on the Terragrunt Provider Cache server. By default ### provider-cache-registry-names **CLI Arg**: `--provider-cache-registry-names`
-**CLI Arg Alias**: `--terragrunt-provider-cache-registry-names` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-provider-cache-registry-names` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_PROVIDER_CACHE_REGISTRY_NAMES`
-**Environment Variable Alias**: `TERRAGRUNT_PROVIDER_CACHE_REGISTRY_NAMES` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_PROVIDER_CACHE_REGISTRY_NAMES` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Commands**: - [run-all](#run-all) @@ -1450,9 +1453,9 @@ The list of remote registries to cached by Terragrunt Provider Cache server. By ### out-dir **CLI Arg**: `--out-dir`
-**CLI Arg Alias**: `--terragrunt-out-dir` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-out-dir` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_OUT_DIR`
-**Environment Variable Alias**: `TERRAGRUNT_OUT_DIR` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_OUT_DIR` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Commands**: - [run-all](#run-all) @@ -1462,9 +1465,9 @@ Specify the plan output directory for the `*-all` commands. Useful to save plans ### json-out-dir **CLI Arg**: `--json-out-dir`
-**CLI Arg Alias**: `--terragrunt-json-out-dir` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-json-out-dir` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_JSON_OUT_DIR`
-**Environment Variable Alias**: `TERRAGRUNT_JSON_OUT_DIR` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_JSON_OUT_DIR` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Commands**: - [run-all](#run-all) @@ -1474,9 +1477,9 @@ Specify the output directory for the `*-all` commands to store plans in JSON for ### auth-provider-cmd **CLI Arg**: `--auth-provider-cmd`
-**CLI Arg Alias**: `--terragrunt-auth-provider-cmd` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-auth-provider-cmd` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_AUTH_PROVIDER_CMD`
-**Environment Variable Alias**: `TERRAGRUNT_AUTH_PROVIDER_CMD` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_AUTH_PROVIDER_CMD` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Requires an argument**: `--auth-provider-cmd "command [arguments]"`
The command and arguments used to obtain authentication credentials dynamically. If specified, Terragrunt runs this command for every working directory before running the underlying IAC for a `terragrunt.hcl` file. @@ -1529,9 +1532,9 @@ Other credential configurations will be supported in the future, but until then, ### tf-forward-stdout **CLI Arg**: `--tf-forward-stdout`
-**CLI Arg Alias**: `--terragrunt-forward-tf-stdout` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-forward-tf-stdout` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_TF_FORWARD_STDOUT`
-**Environment Variable Alias**: `TERRAGRUNT_FORWARD_TF_STDOUT` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_FORWARD_TF_STDOUT` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
If specified, the output of Terraform/OpenTofu commands will be printed as is. By default, all logs, except when using the `output` command or `-json` flags, are integrated into the Terragrunt log. @@ -1560,9 +1563,9 @@ OpenTofu will perform the following actions: ### no-destroy-dependencies-check **CLI Arg**: `--no-destroy-dependencies-check`
-**CLI Arg Alias**: `--terragrunt-no-destroy-dependencies-check` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `--terragrunt-no-destroy-dependencies-check` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
**Environment Variable**: `TG_NO_DESTROY_DEPENDENCIES_CHECK`
-**Environment Variable Alias**: `TERRAGRUNT_NO_DESTROY_DEPENDENCIES_CHECK` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_NO_DESTROY_DEPENDENCIES_CHECK` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
If specified, Terragrunt will not check dependent modules when running `destroy` command. By default, Terragrunt checks dependent modules when running `destroy` command. @@ -1570,7 +1573,7 @@ If specified, Terragrunt will not check dependent modules when running `destroy` **CLI Arg**: `--feature`
**Environment Variable**: `TG_FEATURE`
-**Environment Variable Alias**: `TERRAGRUNT_FEATURE` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**Environment Variable Alias**: `TERRAGRUNT_FEATURE` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
Feature flags in Terragrunt allow users to dynamically control configuration behavior through CLI arguments or environment variables. @@ -1664,7 +1667,9 @@ For more information, see the [Strict Mode](/docs/reference/strict-mode) documen Run the provided command in the download directory. -## Deprecated Commands +## Deprecated + +### Deprecated Commands The following are deprecated commands that are no longer recommended for use. They are still available for backwards compatibility, but will be removed in a future release. @@ -1675,7 +1680,7 @@ The following are deprecated commands that are no longer recommended for use. Th - [destroy-all (DEPRECATED: use run-all)](#destroy-all) - [validate-all (DEPRECATED: use run-all)](#validate-all) -### plan-all +#### plan-all **DEPRECATED: Use `run-all plan` instead.** @@ -1700,7 +1705,7 @@ deployed them, then `run-all plan` will fail as it will not be possible to resol `terraform_remote_state` data sources! Please [see here for more information](https://github.com/gruntwork-io/terragrunt/issues/720#issuecomment-497888756). -### apply-all +#### apply-all **DEPRECATED: Use `run-all apply` instead.** @@ -1723,7 +1728,7 @@ This will recursively search the current working directory for any folders that due to issues with shared `stdin` making individual approvals impossible. Please [see here for more information](https://github.com/gruntwork-io/terragrunt/issues/386#issuecomment-358306268) -### output-all +#### output-all **DEPRECATED: Use `run-all output` instead.** @@ -1748,7 +1753,7 @@ deployed them, then `output-all` will fail as it will not be possible to resolve `terraform_remote_state` data sources! Please [see here for more information](https://github.com/gruntwork-io/terragrunt/issues/720#issuecomment-497888756). -### destroy-all +#### destroy-all **DEPRECATED: Use `run-all destroy` instead.** @@ -1771,7 +1776,7 @@ This will recursively search the current working directory for any folders that due to issues with shared `stdin` making individual approvals impossible. Please [see here for more information](https://github.com/gruntwork-io/terragrunt/issues/386#issuecomment-358306268) -### validate-all +#### validate-all **DEPRECATED: Use `run-all validate` instead.** @@ -1790,7 +1795,7 @@ This will recursively search the current working directory for any folders that [`dependency`](/docs/reference/config-blocks-and-attributes/#dependency) and [`dependencies`](/docs/reference/config-blocks-and-attributes/#dependencies) blocks. -## Deprecated Flags +### Deprecated Flags The following are deprecated flags that are no longer recommended for use. They are still available for backwards compatibility, but will be removed in a future release. @@ -1800,7 +1805,7 @@ The following are deprecated flags that are no longer recommended for use. They - [terragrunt-tf-logs-to-json](#terragrunt-tf-logs-to-json) (DEPRECATED: use [log-format](#log-format)) - [terragrunt-disable-log-formatting](#terragrunt-disable-log-formatting) (DEPRECATED: use [log-format](#log-format)) -### terragrunt-include-module-prefix +#### terragrunt-include-module-prefix **DEPRECATED: Since this behavior has become by default, this flag has been removed. In order to get raw Terraform/OpenTofu output, use [tf-forward-stdout](#tf-forward-stdout).** @@ -1809,7 +1814,7 @@ The following are deprecated flags that are no longer recommended for use. They When this flag is set output from OpenTofu/Terraform sub-commands is prefixed with module path. -### terragrunt-json-log +#### terragrunt-json-log **DEPRECATED: Use [log-format](#log-format).** @@ -1818,7 +1823,7 @@ When this flag is set output from OpenTofu/Terraform sub-commands is prefixed wi When this flag is set, Terragrunt will output its logs in JSON format. -### terragrunt-tf-logs-to-json +#### terragrunt-tf-logs-to-json **DEPRECATED: Use [log-format](#log-format).** @@ -1831,14 +1836,14 @@ When this flag is set, Terragrunt will output its logs in JSON format. When this flag is set, Terragrunt will wrap OpenTofu/Terraform `stdout` and `stderr` in JSON log messages. Works only with `--terragrunt-json-log` flag. -### terragrunt-disable-log-formatting +#### terragrunt-disable-log-formatting **DEPRECATED: Use [log-format](#log-format).** **CLI Arg**: `--terragrunt-disable-log-formatting`
**Environment Variable**: `TERRAGRUNT_DISABLE_LOG_FORMATTING`
-**CLI Arg Alias**: `` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
-**Environment Variable Alias**: `` (deprecated: [See migration guide](https://terragrunt.gruntwork.io/should-be-replaced))
+**CLI Arg Alias**: `` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
+**Environment Variable Alias**: `` (deprecated: [See migration guide](/docs/migrate/cli-redesign/))
If specified, logs will be displayed in key/value format. By default, logs are formatted in a human readable format. @@ -1861,4 +1866,3 @@ time=2024-08-23T11:47:18+03:00 level=stdout prefix=app binary=tofu msg=plan. Res time=2024-08-23T11:47:18+03:00 level=stdout prefix=app binary=tofu msg= + create time=2024-08-23T11:47:18+03:00 level=stdout prefix=app binary=tofu msg=OpenTofu will perform the following actions: ``` - diff --git a/docs/_docs/05_migration_guides/renamed-flags.md b/docs/_docs/05_migration_guides/cli-redesign.md similarity index 100% rename from docs/_docs/05_migration_guides/renamed-flags.md rename to docs/_docs/05_migration_guides/cli-redesign.md