Terraform Cascade is a terraform-like tool that allows you to manage multiple terraform projects.
It's made to be fully compatible with terraform, so you can use it as a drop-in replacement. However, it requires the terraform binary to be available in the PATH.
It works with a very opinionated design:
- Every project is inside a deep directory structure.
- To define a project, you only need to place a
backend.tf
file in that directory. - In each layer, will be executed in the following order:
- Current directory (only when it has a
backend.tf
file) - Whole
base
directory (with its layer) - Other directories (with its layer)
- Current directory (only when it has a
docker build -t cascade .
cd samples/basic/ # Some sample project that has dependencies between layers
# Full dependency tree in order
docker run -it --rm -v $(pwd):/w -v $(pwd)/tmp:/tmp -w /w cascade init --cascade-recursive
docker run -it --rm -v $(pwd):/w -v $(pwd)/tmp:/tmp -w /w cascade apply --cascade-recursive --auto-approve
# Full dependency tree in parallel
docker run -it --rm -v $(pwd):/w -v $(pwd)/tmp:/tmp -w /w/dev cascade apply --cascade-recursive --auto-approve
$ tree -a -I .terraform tmp/cascade
tmp/cascade
├── dev
│ ├── .account
│ ├── s3
│ │ └── .s3
│ └── vpc
│ ├── .vpc
│ └── eks
│ └── .eks
├── ops
│ ├── .account
│ └── vpc
│ └── .vpc
└── prod
├── .account
└── vpc
├── .vpc
└── eks
└── .eks
$ tree -a tmp/cascade/.terraform/
tmp/cascade/.terraform/
├── base.tfstate
├── dev_base.tfstate
├── dev_eks.tfstate
├── ops_base.tfstate
├── prod_base.tfstate
└── prod_eks.tfstate