-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
embedded resolvers - resolver ouput as entry paramter for another resolver #1258
Comments
I don't think resolvers work that way or at least I do not know of an Once a resolver is triggered for |
Hi @tbensalem-bkom, what you're trying to do isn't exactly how resolvers work (but there's a way to get it to work!). Take a look here: https://github.com/Sceptre/sceptre/blob/master/sceptre/stack.py#L108 The way resolvers work that they need to be added to ResolvableProperty (which are Python descriptors), which automates a lot of the machinery around making them work like "magic". When you pass a resolver as a custom resolver's arguments, you won't have access to the magic and instead will receive instances of the StackOutput resolver. Take a look at the base class of resolvers here, though. There's a way to make this work, but it will require changing your Custom resolver's code: https://github.com/Sceptre/sceptre/blob/master/sceptre/resolvers/__init__.py#L24 Imagine this in your custom resolver's code def setup(self):
for key, value in self.argument.items():
# You need to propagate the top-level resolver's stack to the inner resolver and then invoke setup on them
if isinstance(value, Resolver):
value.stack = self.stack
value.setup()
def resolve(self):
for key, value in self.argument.items():
if isinstance(value, Resolver):
self.argument[key] = value.resolve() That should probably work for you, though that is a bit clumsy. |
This is fixed with PR #1313 and available in sceptre v4.1.0 |
Subject of the issue
I have been trying to run embedded resolvers, to be exact I want to have a resolver output as input for another resolver.
I have described how I have implemented that below.
Your environment
Expected behavior
I'm expecting the
!stack_output stack::output1
and!stack_output stack::output2
to get resolved first than output it send to the upper-level function!CustomResolver1
Actual behavior
it does not work
The text was updated successfully, but these errors were encountered: