theonestack / cfhighlander

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

Ability to provide raw cloudformation #16

Open toshke opened 6 years ago

toshke commented 6 years ago

Cfhighlander templates should not necessarily rely on cfndsl templates to produce cloudformation templates. Raw YAML and JSON templates should be allowed as well with little help of cfn2dsl

benleov commented 5 years ago

I'm using build pipeline to deploy a fairly simple template but am running into issues because I wish to include SAM templates as a nested stack as they are logically grouped and required by the application to run.

The only options available are:

  1. Migrate from SAM completely and upload artifacts manually.
  2. Use something like aws-sam-translator as described in the following issue https://github.com/awslabs/serverless-application-model/issues/90
  3. Use SAM to perform the transformation, cfn2dsl to convert to cfndsl and add as a highlander component (as you described on Gitter)

None of these options are particularly elegant. If highlander could handle the transformation automatically that would simplify the build process to simply using highlander to render then pipeline to deploy the template.

toshke commented 5 years ago

Full abstraction of templating engine needs quite a few changes in the code, but if done properly it could result in ability for highlander to produce templates for Azure and Google as well. At this point to allow providing yaml , json, and sam, it could be implemented as "preprocessor" that would essentially transform given template to cfndsl one - this way no abstraction is done, only preparation phase is introduced.

CfhighlanderTemplate do
   CfFormat 'SAM'
end
CfhighlanderTemplate do
   CfFormat 'json'
end
CfhighlanderTemplate do
   CfFormat 'yaml'
end

@aaronwalker thoughts, @Guslington thoughts?