theonestack / cfhighlander

Cloudformation DSL and component library
MIT License
25 stars 23 forks source link

Component inlining #27

Closed toshke closed 6 years ago

toshke commented 6 years ago

Having two inner components in outer component should optionally result in producing flattened cloudformation, composited from cloudformation templates of inner components. Complexity around this task is actual input/output wiring as cloudformation model produced from cfndsl needs to be altered.

Syntax proposal


CfhighlanderTemplate do

     Name 'myapp'

     Component template:'vpc', cfinline: true
     Component template: 'asg', cfinline: true
     Component template: 'alb', cfinline: true

end
toshke commented 6 years ago

Current implementation on https://github.com/theonestack/cfhighlander/pull/65 us using following syntax

CfhighlanderTemplate do

     Name 'myapp'

     Component template:'vpc', inlined: true
     Component template: 'asg', inlined: true
     Component template: 'alb', inlined: true

end

@aaronwalker @Guslington thoughts on the keyword?

aaronwalker commented 6 years ago

what about

render: nested|inline

CfhighlanderTemplate do

     Name 'myapp'

     Component template:'vpc', render: inline
     Component template: 'asg', render: nested
     Component template: 'alb' #defaults to nested

end

my 2 cents

toshke commented 6 years ago

sounds good to me, i like inline and nested being constants rather then strings. will update #65

toshke commented 6 years ago

altered implementation with small change, constants need be upper case - render: Inline and render:Substack, details in #65

toshke commented 6 years ago

implemented in #69