Reputation: 2600
I want to extend lambCI cloudformation template but am finding myself lost in barley human-readable json/yml it provides.
Is it possible to reverse-transform CF template to something else(sam, serverless...), edit it and then transform back?
Upvotes: 1
Views: 2358
Reputation: 1134
I use AI tools like Chatgpt. Give it the cloud formation json file and ask it to convert to SAM all the time. In my case i have to clean up some stuff, mainly env vars in CF that get converted into the SAM file because I usually create a SAM config for local testing and emulation of serverless components on my machine so I hard code those values, mostly with stub values. But if you don't need to change your vars from CF to SAM I think it's works pretty well for conversations back and forth.
Upvotes: 0
Reputation: 375
to convert json to yaml, just use this site (or one like it) https://www.json2yaml.com/
Upvotes: 0
Reputation: 8455
That template is not really complicated. Having it as a SAM-template wouldn't make it more readable at all, because the ressources it defines either can't be defined using SAM or wouldn't make it significantly shorter.
As far as I know there are also no tools available which would do conversion to SAM/Serverless automatically.
I always find such templates way more readable in YAML, than in JSON, so what you could do is to convert it from JSON to YAML using aws-cfn-template-flip, edit it and convert it back afterwards (or even use it as YAML).
Upvotes: 4