can't load json file in userdata to use jinja template #935
Replies: 6 comments
-
On a mobile, so just a quick reply. Have you tried using one of jinjas built in filters, e.g. tojson? Pseudo code: set test = seceptre... | tojson |
Beta Was this translation helpful? Give feedback.
-
yeah, i tried that, but it than says that the object doesn't have an attribute. i tried several variaties, but my jinja is also not the best. |
Beta Was this translation helpful? Give feedback.
-
I believe file_contents resolver passes it's content as a string. however if you pass in the json without using file_contents resolver then scepter should pass in the contents of sceptre_user_data as an object. try this..
if you still prefer keeping the json in a separate file then you will probably need to make a code change to the file_contents resolver. |
Beta Was this translation helpful? Give feedback.
-
I have created a new [1] https://github.com/Sage-Bionetworks-IT/sceptre-file-resolver |
Beta Was this translation helpful? Give feedback.
-
Hey folks, Thanks for progressing this - I think it would make sense to have this as a sceptre resolver, if you are willing to share. We could have this and Sound good? |
Beta Was this translation helpful? Give feedback.
-
The resolver has been moved to the sceptre org, https://github.com/Sceptre/sceptre-file-resolver |
Beta Was this translation helpful? Give feedback.
-
i'm trying to use a json document to use as paramters for a jinja template.
we use the following parameters:
and try to load this json:
and then use it in the following part in a j2 template:
the prolem we have with this is we get he userdata only as a String, we have not found a way to use it as a dict.
can some one help?
Beta Was this translation helpful? Give feedback.
All reactions