https://github.com/atorrescogollo/terraform-cascade
Terraform Cascade - An opinionated terraform project orchestrator
https://github.com/atorrescogollo/terraform-cascade
cli go infrastructure-as-code terraform
Last synced: 5 months ago
JSON representation
Terraform Cascade - An opinionated terraform project orchestrator
- Host: GitHub
- URL: https://github.com/atorrescogollo/terraform-cascade
- Owner: atorrescogollo
- License: gpl-3.0
- Created: 2023-07-21T16:03:33.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-05-10T07:25:33.000Z (about 1 year ago)
- Last Synced: 2025-05-10T08:26:53.623Z (about 1 year ago)
- Topics: cli, go, infrastructure-as-code, terraform
- Language: Go
- Homepage:
- Size: 704 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Terraform Cascade

## Demo
[](https://asciinema.org/a/JPYlivXxoZvB5PvjNvOxVQb7O)
# Overview
**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**.
# Design
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:
1. **Current directory** (only when it has a `backend.tf` file)
2. **Whole `base` directory** (with its layer)
3. **Other directories** (with its layer)
# Usage
### Build
```
docker build -t cascade .
```
### Run example
```
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
```
### Generated infra
```
$ 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
```
### Generated terraform states
```
$ 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
```