|
1 year ago | |
---|---|---|
parser | 1 year ago | |
templates | 1 year ago | |
.gitignore | 1 year ago | |
README.md | 1 year ago | |
go.mod | 1 year ago | |
go.sum | 1 year ago | |
main.go | 1 year ago |
README.md
tf-parser
This program will take incoming requests from an API and generate terraform templates based off them.
What is this
Prototype for a work project, nothing special to see here.
What does this do
The basic premise is that this program will handle incoming requests from a ticketing system and spit out a valid terraform template based off of what is fed to it.
The params are sparse on purpose as where this is to be deployed has a lot of predefined environments with well-known NSGs, resource groups, subscriptions, and all that. So in a real situation 90% of the corresponding template will be filled out already with so there is only a requirement to know how large the VM needs to be, which environment (production, staging, development, training etc.), which product the vms are for, and how many VMs to provision for the request.
With that information this can be used in a pipeline to generate a (hopefully) valid tf template quickly and then move on to more important stuff like
- build an image with packer
- terraform plan
- terraform apply
- whatever else is needed
Tested this and did indeed get a valid TF template filled in with variables defined in the struct by reading into memory then
writing out to another file in the terraform
directory.