Generate skeleton terraform module from example in terraform.io docs
- Pull this repo
$ cd ~
$ git clone [email protected]:thepastelsuit/terramod.git
- Symlink to a location in your path
$ cd ~/bin
$ ln -s ~/terramod/terramod terramod
- Navigate to the root of your terraform project and run
$ cd ~/my-project
$ terramod <aws resource name>
The script takes arguments as such terramod <aws resource name> <example number from docs>
.
<aws resource name>
is found at the end of a Terraform doc page before the .html, i.e. https://www.terraform.io/docs/providers/aws/r/api_gateway_integration.html
<example number from docs>
will default to 1 and use the first example found on that doc page. Some resources in the terraform docs have multiple examples, and you can pass a different value to have terramod generate your main.tf file from that example instead.