0.2.1 • Published 6 years ago
terrafactor v0.2.1
Terrafactor
Refactors terraform code generated by terraformer.
It does two things
- Merges all the terraform states.
- Some post processing
Installation
Requires nodejs
npm i -g terrafactorUsage
terrafactor ./inputDir ./outputDirIt will generate three directories ./outputDir, ./outputDir_mst and ./outputDir_processed.
If you want to opt out of the modularize feature. You can run.
terrafactor ./inputDir ./outputDir --modularize=falsePost processing
Currently it does the following postprocessing steps
- Replaces all hardcoded
idwith"${resource_type.resource_name.id}" - Maintains DRY-ness by refactoring out repeated values into a
variables.tffile. - Generate modules containing clusters of all connected components. Then have the
main.tfimport all the modules.mod_0constains all resources which have a very small cluster( < 2 )
Planned
- Support for
countproperty of terraform.