Terragrunt to Terraspace: The Step by Step Migration Guide
We'll take you through a full migration of a simple Terragrunt project to a Terraspace project. You'll be able to run terragrunt apply
and terraspace up
and see no changes. This allows you to test things out incrementally.
This unique approach of using the same Terraform statefile was inspired by this community post: Migrating from terragrunt - Root modules?
The starting terraspace project structure we'll use is pretty typical:
terragrunt-project
├── terragrunt.hcl
├── us-east-1
│ ├── dev
│ │ └── demo
│ │ └── terragrunt.hcl
│ └── prod
│ └── demo
│ └── terragrunt.hcl
└── us-west-2
├── dev
│ └── demo
│ └── terragrunt.hcl
└── prod
└── demo
└── terragrunt.hcl
To deploy different environments to multiple regions:
cd us-east-1/dev/demo && terragrunt apply
cd us-east-1/prod/demo && terragrunt apply
cd us-west-2/dev/demo && terragrunt apply
cd us-west-2/prod/demo && terragrunt apply
The terraspace project structure is:
terraspace-project
├── app
│ └── stacks
│ └── demo
│ ├── main.tf
│ └── variables.tf
└── config
└── terraform
├── backend.tf
└── provider.tf
To deploy different environments to multiple regions:
TS_ENV=dev AWS_REGION=us-east-1 terraspace up demo
TS_ENV=dev AWS_REGION=us-east-1 terraspace up demo
TS_ENV=prod AWS_REGION=us-west-2 terraspace up demo
TS_ENV=prod AWS_REGION=us-west-2 terraspace up demo
If you're running through the example yourself, change the s3 bucket in the code one that is available:
This is also documented in their respective READMEs.
Links:
- Terraspace Docs: Terraspace vs Terragrunt
- Terragrunt Project Example Repo: boltops-learn/terragrunt-project
- Terraspace Project Example Repo: boltops-learn/terraspace-project
Terraform Fundamentals 101
1h 36m
Terraform HCL Fundamentals
1h 53m
Terraspace Install Guides
8m
Terraspace Fundamentals
2h 30m
Terraspace Cloud
2h 33m
Terraspace Terrafile
29m
Terraspace and Terragrunt
19m
Terraspace AWS Cloud
1h 43m
Terraspace Azure Cloud
1h 15m
Terraspace Google Cloud
1h 12m
Terraspace OnPrem
16m
Terraspace Testing
47m
Terraspace Development
24m
Get full access to these great resources
All for less than the price of coffee a day