3 ms·
One of the main strengths of something like cloudformation, is that we can use libraries in languages we're comfortable with to build a programmable DSL. A gre
by mahmoudimus 12y ago
One of the main strengths of something like cloudformation, is that we can use libraries in languages we're comfortable with to build a programmable DSL.
A great tool, at least for Python, that exposes this is: https://github.com/cloudtools/troposphere https://github.com/cloudtools/troposphere.
This gives me the full power of python, so I can build abstractions, use inheritance and encapsulation to specialize certain things.
We've done a lot of work to automate our infrastructure provisioning, but I'm interested in the abstraction layer Terraform provides -- especially for multiple providers.
How can we bridge the gap that is left by Terraform from having a fully complete programming language to define infrastructure (which has downsides but in my opinion, more upsides)?
- mitchellh 12y agoTerraform fully supports JSON as an input format as a 1st class citizen: http://www.terraform.io/docs/configuration/syntax.html http://www.terraform.io/docs/configuration/syntax.html You can use that to write higher level wrappers to generate the JSON, and was indeed one of the intentions.
- mahmoudimus 12y agoSweet, thanks Mitchell. I'm always impressed at the level of polish your products have. I'll take this for a spin and I'll report back any results. Is there a mailing list or just #hashicorp on Freenode?
- kolev 12y agoI've tried to use Troposphere, but found it a redundant layer on top of the Python dicts. I ended up building my own Macro language that compiles to raw CloudFormation JSON. What's funny is that I wanted to call this Macro language exactly Terraform. I'll definitely look into Terraform, it looks to have a lot of the features that I implement although most of mine were tailored exactly toward CFN and it may not be practical to switch. Maybe I'll finally convince my employer to open-source it.