Skip to content

Commit 4cc59cf

Browse files
yhakbardenis256
authored andcommitted
docs: Updating migration docs (#4711)
1 parent c170e57 commit 4cc59cf

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

docs-starlight/src/content/docs/07-migrate/04-terragrunt-stacks.mdx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar:
66
order: 4
77
---
88

9-
import { FileTree } from '@astrojs/starlight/components'
9+
import { Aside, FileTree } from '@astrojs/starlight/components'
1010

1111
## Migrating from the `terragrunt-infrastructure-live-example` repository
1212

@@ -93,7 +93,7 @@ To do this, you'll need to:
9393
## non-prod/us-east-1/stateful-ec2-asg-service/terragrunt.stack.hcl
9494
9595
unit "service" {
96-
source = "git::[email protected]:acme/infrastructure-catalog.git//units/ec2-asg-stateful-service"
96+
source = "git::[email protected]:acme/infrastructure-catalog.git//units/ec2-asg-stateful-service?ref=v1.0.0"
9797
path = "service"
9898
9999
no_dot_terragrunt_stack = true
@@ -102,7 +102,7 @@ To do this, you'll need to:
102102
}
103103
104104
unit "db" {
105-
source = "git::[email protected]:acme/infrastructure-catalog.git//units/mysql"
105+
source = "git::[email protected]:acme/infrastructure-catalog.git//units/mysql?ref=v1.0.0"
106106
path = "db"
107107
108108
no_dot_terragrunt_stack = true
@@ -111,7 +111,7 @@ To do this, you'll need to:
111111
}
112112
113113
unit "asg-sg" {
114-
source = "git::[email protected]:acme/infrastructure-catalog.git//units/security-group"
114+
source = "git::[email protected]:acme/infrastructure-catalog.git//units/security-group?ref=v1.0.0"
115115
path = "sgs/asg"
116116
117117
no_dot_terragrunt_stack = true
@@ -268,7 +268,7 @@ Then reference that `terragrunt.hcl` file in your `terragrunt.stack.hcl` files,
268268
## non-prod/us-east-1/terragrunt.stack.hcl
269269
270270
unit "mysql" {
271-
source = "git::[email protected]:acme/infrastructure-catalog.git//units/mysql"
271+
source = "git::[email protected]:acme/infrastructure-catalog.git//units/mysql?ref=v1.0.0"
272272
path = "mysql"
273273
274274
## As discussed above, this prevents Terragrunt from automatically generating the units into a `.terragrunt-stack` directory.
@@ -287,7 +287,15 @@ unit "mysql" {
287287

288288
Now, all your unit configurations can be found directly in the `terragrunt.hcl` file in the `infrastructure-catalog` repository, without having to bounce around between different included or referenced files, and you have an explicit interface for the values that can be set externally, via the `values` attribute.
289289

290-
Different environments can pin different versions of the unit, and that allows for easy atomic updates (and rollbacks) of both OpenTofu/Terraform module versions and Terragrunt unit configurations if needed.
290+
Different environments can pin different versions of the unit, and that allows for easy atomic updates (and rollbacks) of both OpenTofu/Terraform module versions _and_ Terragrunt unit configurations if needed.
291+
292+
<Aside type="tip">
293+
294+
This is one of the main reasons why we recommend using Terragrunt Stacks over the old `_envcommon` directory pattern.
295+
296+
In the old `_envcommon` directory pattern, there was no simple way to version the shared configuration referenced by all units in your `live` repository. All units always referenced the same version of the shared configuration in `_envcommon`. Now that you're using Terragrunt Stacks, you can use Git tags to version the shared configuration you reference in your `terragrunt.stack.hcl` files, and different environments can pin the version of the shared configuration they want to use.
297+
298+
</Aside>
291299

292300
### Step 6: Update your CI/CD pipeline
293301

0 commit comments

Comments
 (0)