GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Ghost---Shadow/terrafactor: Refactor autogenerated terraform code

BranchesTags
Open more actions menu

Latest commit

 

History

26 Commits
26 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
.eslintrc.js
.eslintrc.js
 
 
.gitignore
.gitignore
 
 
.npmignore
.npmignore
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
test_integration.sh
test_integration.sh
 
 
test_integration1.sh
test_integration1.sh
 
 
test_integration2.sh
test_integration2.sh
 
 

Repository files navigation

Terrafactor

Refactors terraform code generated by terraformer.

It does two things

  1. Merges all the terraform states.
  2. Some post processing

Installation

Requires nodejs

npm i -g terrafactor

Usage

terrafactor ./inputDir ./outputDir

It 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=false

Post processing

Currently it does the following postprocessing steps

  1. Replaces all hardcoded id with "${resource_type.resource_name.id}"
  2. Maintains DRY-ness by refactoring out repeated values into a variables.tf file.
  3. Generate modules containing clusters of all connected components. Then have the main.tf import all the modules. mod_0 constains all resources which have a very small cluster ( < 2 )

Planned

  1. Support for count property of terraform.

About

Refactor autogenerated terraform code

Topics

cloudhclhcl2terraformterraformer

Resources

Readme
MIT license
Activity

Stars

5 stars

Watchers

1 watching

Forks

2 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.