Configset ERB

Configsets can be written with ERB and YAML also. Writing configsets with YAML can be useful for very simple configsets.

Example

AWS::CloudFormation::Init:
  config:
    packages:
      yum:
        httpd: []
    files:
      "/var/www/html/index.html":
        content: |
<%= indent(@html, 10) %>
    services:
      sysvinit:
       httpd:
        enabled: true
        ensureRunning: true

The indent method is a built-in helper for ERB. It aligns the text and is useful for YAML-based configsets. The @html variable can be set by the author of the configset or overridden by you with variables.

Pro tip: Use the <- and -> arrow keys to move back and forward.

Edit this page

See a typo or an error? You can improve this page. This website is available on GitHub and contributions are encouraged and welcomed. We love pull requests from you!