realestate-com-au / stackup

a simple CLI and Ruby API for AWS CloudFormation
MIT License
97 stars 34 forks source link

Feature request: do not normalise to JSON before invoking Cloudformation API's #81

Closed ps-jay closed 4 years ago

ps-jay commented 4 years ago

As per https://github.com/realestate-com-au/stackup/blob/v1.4.5/README.md#yaml-support, and discussions in #31 & #74 - Stackup normalises YAML input to JSON before invoking Cloudformation API's.

This functionality is because Stackup supported YAML before Cloudformation did.

As I understand it, it also makes diff'ing templates accurate when doing stackup diff ....

I am however, still wondering if we could change Stackup to (optionally?) upload templates in their original format. In particular, because the YAML format is much easier to read - and it's nice to be able to read a stack's template within the AWS web-console.

What are the challenges in supporting this? Where can I help? Would this feature request be accepted at all?

ps-jay commented 4 years ago

Hey folks,

I've just done a little experiment to:

See: https://github.com/realestate-com-au/stackup/compare/master...ps-jay:preserve-orig-template-in-upload

What did it achieve?

I think diff continuing to normalise is good, since it's a more 'functional' diff, rather than just a text-file diff.

The diff looks different to the uploaded template however, since the upload is now the original text file. I don't mind this, since that's exactly what I want to happen. But what are others' thoughts?

Would this kind of approach be acceptable? (maybe even if it were an optional flag such as --preserve-template-format ?)

ps-jay commented 4 years ago

Ah, I also see the template subcommand also normalises.

I'm leaning towards introducing optional non-normalisation, selectable by a run-time flag.

ps-jay commented 4 years ago

Implemented as --preserve-template-formatting in #86