Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jaceq/terraeasy
Easy Terraform wrapper
https://github.com/jaceq/terraeasy
Last synced: about 1 month ago
JSON representation
Easy Terraform wrapper
- Host: GitHub
- URL: https://github.com/jaceq/terraeasy
- Owner: jaceq
- License: mit
- Created: 2023-02-17T09:50:24.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-01T10:50:29.000Z (about 1 year ago)
- Last Synced: 2024-08-02T00:26:38.722Z (4 months ago)
- Language: Shell
- Size: 19.5 KB
- Stars: 33
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-tf - terraeasy - Easy Terraform wrapper (Tools / Community providers)
README
![Terreasy](https://miro.medium.com/v2/resize:fit:786/format:webp/1*KRETsmuRToO6AXyl9NHdtQ.png)
# terraeasy
Easy Terraform wrapper## Purpose / main ideas
### 1. Make terraform DRY
Avoid repeating of terraform code across environments, put all common (across environments) resources in
`common` directory, put differentiating variables and resources to environment specific directories (eg. `stage` or `prod`)### 2. Use goodness for terraform graphs
Unlike terragrunt, idea here is NOT to split infrastructure to as many states as possible, this allows easier
consumption of resource outputs within a single apply / plan### 3. Keep it simple and expandable
It's bash, how much easier can it get? :)### 4. Got a lot of custom modules in git? Save time!
*This is optional* to use this, in `terraeasy.sh`
`terraeasy.sh` will clone / pull given git repository on every run. Idea behind this is that when there is a repository
with multiple custom terraform modules, we clone/pull it once (effectively cache) and refer to module source by relative
path (prefixed with `../.terraform-modules/`)## How does it work
`terraeasy.sh` has built in help, so just run it without any arguments for help
When you run `terraeasy.sh` for a given environment (eg. stage) it will:
1. Create working directory (`tf-working-dir` by default)
2. Create symbolic links for `*tf*` files (so eg. .tf, .tfvars) from `common` and `stage` (in this example) to `tf-working-dir`
3. Will run `terraform init -reconfigure` with `-chdir tf-working-dir`
4. Will run your command (eg. plan or apply) with `-chdir tf-working-dir` and will include `state.tfvars` from `stage` directory