Giter Site home page Giter Site logo

Comments (5)

aaronwalker avatar aaronwalker commented on August 20, 2024

Additional to this type of support would be to render multiple template from a single cfndsl call.

Originally I was thinking something a simple a file name globbing

cfndsl -o output/ templates/*.rb

where the templates directory contains multiple templates and it will generate a corresponding json file in the output directory.

With your idea it might be possible to combine this functionality will the ability to proivde overrides for a specific template but otherwise use the defaults something like

source: "templates/*.rb"
output: "stacks"
extras: "default_extras.yml"
templates:
  component_one:
    filename: "component_one/template.json"
    extras: "component_one/extras.yml"
    output: "stacks/component_one.json"

This would allow you to run something like

cfndsl -c

which would render all templates but component_one would use the overriden values or alternative if you passed name of the component it would just render that template and by default the component name could just be the file name minus extension.

@stevenjack Thoughts???

from cfndsl.

aaronwalker avatar aaronwalker commented on August 20, 2024

moved to #118

from cfndsl.

stevenjack avatar stevenjack commented on August 20, 2024

@aaronwalker in regards to the first comment, I think it might be best to split that functionality away from the config driven approach rather than mixing them up. I think what you've suggested could work quite well:

cfndsl -o output/ templates/*.rb

So we just check if the first argument handed in is a glob, if so iterate over those templates and output them to the directory specified in -o.

This raises an interesting question of it you don't pass an output param then the default is to output to STDOUT. Now with multiple templates this doesn't really make sense.. I guess the best approach would be to make -o mandatory with supplying a glob?

from cfndsl.

stevenjack avatar stevenjack commented on August 20, 2024

@aaronwalker could you move the second question into another issue and link it to this one, just easier to comment etc as they're distinct issues.

from cfndsl.

lwoggardner avatar lwoggardner commented on August 20, 2024

@gergnz - this looks like it can be closed given current capabilities of rake task and cfndsl executable.

I'm not sure it makes sense at this point to define yet another static template format to drive the dsl.

from cfndsl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.