aws / aws-proton-public-roadmap

This is the public roadmap for AWS Proton
https://aws.amazon.com/proton
Other
199 stars 13 forks source link

[Request]: Bring-your-own template rendering #36

Open clareliguori opened 3 years ago

clareliguori commented 3 years ago

Proton currently supports only Jinja as a template rendering language for infrastructure as code templates. Jinja is used to inject values from the resource specification and from other resources (like from a service instance's environment). There are currently a few requests in this roadmap repo for adding support in Proton for more template rendering / value injection tools and languages, including CFN parameters, AWS CDK, and Terraform's HCL. The list will likely grow over time with even more tools out there for generating templates!

This request proposes adding an option for bringing-your-own template rendering logic to supplement the set of template rendering tools supported within Proton. This would enable you to use any tool (or a mix of tools) and to write custom logic for producing the CloudFormation template files that will be deployed by Proton (as well as any other infrastructure as code formats that Proton supports in the future, like Terraform tf files).

This could look something like creating a Lambda function in your account that accepts the contents of your Proton template bundle and the Proton resource specification (like the service instance inputs) and outputs the rendered infrastructure-as-code template. You would then provide that function ARN to Proton, perhaps as part of the Proton template configuration. Proton would invoke the function in your account when rendering a template prior to deployment.

clareliguori commented 3 years ago

FYI @hoegertn and @JohnPreston, I believe you both suggested this feature in other issues

hoegertn commented 3 years ago

That sounds like a wonderful idea. Happy to help on the CDK implementation for this.

JohnPreston commented 3 years ago

Thanks @clareliguori for creating this.

Back to my previous points, I am hoping to maybe be able to have then just 1 spec file to instruct Proton what to do with the files in the bundle to render the templates accordingly and indeed, with Lambda do the work, as you said.

PS: One could imagine a use-case where files in the bundle have nothing to do with CFN btw, and only post-processing do we get CFN template files.

PS2: This needs to allow for nested stacks to be created and in pipeline to allow for nested stacks recursive changesets (nice to have).

clareliguori commented 3 years ago

PS2: This needs to allow for nested stacks to be created and in pipeline to allow for nested stacks recursive changesets (nice to have).

@JohnPreston this sounds like it should be a separate discussion for support for nested stacks in Proton. Can you open a separate issue and describe more what you're looking for?