When defining the same variable in the config.yaml in different levels, causes Sceptre to intermittently return an error:
Usually if I run again it works, but sometimes I have to run a few times. This is in the scope of creating a changeset.
e.g of structure
-config
The error is happening in Sceptre 2.1.0 and 2.1.5 (I havent' tested other versions, but I don't see this issue reported nor fixed in 2.2.0).
This problem has often occurred continuously, and rerun has been the only immediate solution but sometimes it is necessary to rerun many times until it works.
The issue was due to variables referenced in a config.yaml from a top-level config.yaml. I understand that this feature is not supported in Sceptre (which would be a useful feature), but somehow in 30% of the cases was working. I removed those references for now, and the problem got resolved.
Is the issue to make the documentation clearer about this specific issue?
We have also run into this same issue trying to specify certain variables in the config.yaml for a particular region, but then in some stack_configs lower in the directory either updating vars or adding new vars.
│ config.yaml
│
└───aws_service
│ │ stack_config.yaml
Where in this case we may define vars in the config.yaml as
central_vars:
key1: true
key2: false
And in stack_config.yaml, we may need to update or add to that base vars
stack_name: stack-name
template_path: path/to/template
{% set _ = central_vars.update({"key2" : "dummy_value"}) %}
sceptre_user_data:
input_vars: {{ central_vars }}
I think this is related to #937
When rendering config files, Sceptre caches values across stack groups.
The "undefined" you are getting is the correct response, when it "works" it is actually using a value from one of your other config files.
The inconsistency between runs comes from Sceptre using a set to process the config files.
(Sets are non-deterministic in Python).