Closed greg-caffeine closed 3 months ago
Hi @greg-caffeine, sorry for the delay.
Custom YAML tags are something that are going to be pretty difficult to support with gomplate. The main problem is that internally the data is parsed into an intermediate form which is a map with nested maps, and so something like the above would be parsed into (in JSON terms) {"MY_PARAMETER": "MyParameter"}
, with no ability to retain custom tags.
You may be able to accomplish this if you instead reframe the approach and build a template out of cloudfront_template.yaml
rather than using it as part of a datasource.
Hmm... There may actually be a possibility to use a different intermediate format, as hinted at by https://github.com/go-yaml/yaml/issues/191#issuecomment-376058792, but it's unclear exactly how. I'd need to find some time to dig into this deeper.
This issue is stale because it has been open for 60 days with no activity. If it is no longer relevant or necessary, please close it. Given no action, it will be closed in 14 days.
If it's still relevant, one of the following will remove the stale marking:
stale
label
I would like to use gomplate to allow overriding and merging of sections of CloudFormation YAML templates with other YAML sections defined in other files by using the gomplate
merge
datasource. Unfortunately, gomplate drops the AWS-specific YAML tags in the merged output, breaking the template.Example:
cloudfront_template.yaml:
cloudfront_overrides.yaml:
Gomplate Command
% gomplate -d 'merger=merge:cloudfront_template.yaml|cloudfront_overrides.yaml' -i '{{ include "merger" }}'
OUTPUT
Note in the output that
MY_PARAMETER: !Ref MyParameter
has not been preserved and instead has been transformed intoMY_PARAMETER: MyParameter
, losing the!Ref
tag.Is there any way to get gomplate to preserve all HTML tags in the output, or to provide a list of tags to preserve?
A list of AWS custom tags can be found here.