Configset Helpers

Helpers allow you to extend the Configset DSL.

Example

Here’s a simple example that will add a yum keyword.

app/configsets/httpd/helpers/yum_helper.rb

module YumHelper
  def yum(*packages)
    list = packages.inject({}) { |result, p| result.merge(p => []) }
    package("yum", list)
  end
end

Now you can use like so:

yum("tree", "vim")

And it’ll generate something like this:

---
AWS::CloudFormation::Init:
  configSets:
    default:
    - main
  main:
    packages:
      yum:
        tree: []
        vim: []

Both ERB and DSL from supports adding your own custom helpers.