Open japsu opened 6 years ago
!Pragma cloudformation
)@zbyte64 in #53 suggested another use case for this: creating Emrichen templates with Emrichen.
If we were to go by approach 2, it might look like something like this:
Template:
foo: !Tag,FooTagWillBeCopiedVerbatimToOutput 5
Output:
foo: !FooTagWillBeCopiedVerbatimToOutput 5
Here I'm shamelessly reusing the ,
separator we currently are using for tag composition. tag_name.startswith("Tag,")
would have to be special-cased in emrichen.input.yaml:construct_tagged_object
.
Implementation could use a Tag
internal tag similarly to Compose
, but how would it communicate the custom tag to PyYAML? Ad-hoc class that extends YAMLObject
and sets tag = "FooTagWillBeCopiedVerbatimToOutput"
as class variable?
For my use I actually want to spit back Tags I would otherwise process with emrichen, but as a second stage. Would option 2 look something like this (adapted from my use case)?
chart:
profile: "foobar"
chartConfigUrl:
!Tag,AsDocument
filename: ./data_overview.json
content: !Tag,With
template: !Tag,Include ./atemplate.template.yaml
vars:
path: s3://...../
columns:
- application_gap_ratio
- application_gap
This tweaked my brain at first, but now it seems very satisfying.
CloudFormation has its own functions such as
!Subst
and!Join
etc. In order to be able to input and output CloudFormation templates, Emrichen needs a way to co-operate with foreign tags.(Bad) options:
{ "Fn::Join": […] }
form of CFN functions instead of the tag-based!Join
form