stevenjack/cfndsl — pull request #58 by howech (2014-07-21 21:44:13+00:00)
Title: Add some nominal support for Openstack Heat

This pull request adds some support for openstack heat templates. Basically, it adds a completely new types.yaml file for the language that openstack accepts - which includes duplicates of the aws resources that openstack supports. Note that this is intenional, as the set of parameters that openstack accepts for these is not identical to what CloudFormation supports. In fact, in some places openstack ADDS some parameters that it will accept (eg openstack's EC2::Instance has a scheduler_hints parameter that is not present in Cloudformation).

The changes to Types.rb are fairly crude, but get the job done. At a later date I will try to go back and clean up some of the copy/paste.

Finally, in order to select whether you want to generate a CloudFormation template or a Heat template, I added a second top level function ("Heat") to indicate that you want the cloudformation grammar instead of the CF grammar.

Note that cfndsl still only generates JSON, but heat seems happy to accept it. Also, heat does not currently support conditionals, but since that part of the language has been hardcoded in somewhere else in the code (ie not in types.yaml), cfndsl will haplily try to generate conditionals in a heat template. On the other hand, heat offers a couple of functions that cloudformation does not, like FnReplace. These are not currently supported (cfndsl's FnFormat still works, as it generates a giant FnJoin, which both Heat and CF will accept...).

There are probably some places where things are still wrong. Heat seems to offer a lot more in the way of Attributes for its resources, and some of them seem to be non-trivial data types. cfndsl doesnt really seem to handle anything other than String attribute types at the moment, so I just added all of the defintitions as if they were Strings. This will undoubtably be wrong in some cases.

I should probably add something in the way of test cases. I can say though, that I have successfully launched some non-trivial heat stacks in a real openstack environment, so I do have some expectation that much of what is here is close to working.