Replies: 5 comments
-
I believe yaml anchoring should be independent of sceptre. sceptre uses pyaml to parse yaml so as long as pyaml library supports anchoring then it should be available. In general, this request does seem like a useful feature. In this use case I believe you can move some_dict to config yaml and reference it in the template yaml multiple times. |
Beta Was this translation helpful? Give feedback.
-
yes i could, it's just that i would like to keep only global variables in config.yaml , it's not always the case, sometimes you have stack specific option that you keep reppeting thanks for the input though , i actually went with a stackgroup config yaml for now :) |
Beta Was this translation helpful? Give feedback.
-
Agreed with @aduzsardi that this would be useful for DRYing out repetitions. Using the stack config file works as a workaround but it's less than ideal to store variables for a specific stack's concerns in the global config. You have to manage possible variable name collisions across stacks and remember to expand your find/replace search path when refactoring a specific stack. |
Beta Was this translation helpful? Give feedback.
-
There's probably a couple of different ways you can work around this issue. One is using a stack group config file. Another is to use use a resolver to load variables from ENV var or from config files. Another option is to use yaml anchors which do work. All parameters in Yaml anchor Example:
|
Beta Was this translation helpful? Give feedback.
-
Sceptre loads all files as jinja templates therefore you can set variables inside of the jinja templates using variable assignments https://jinja.palletsprojects.com/en/2.11.x/templates/#assignments |
Beta Was this translation helpful? Give feedback.
-
It would be nice if we could use jinja variables in yaml files to avoid repetition
by the way , does sceptre support yaml anchoring in config files ?
Beta Was this translation helpful? Give feedback.
All reactions