This message was deleted.
s
This message was deleted.
e
What's this being passed to?
You'll probably need to use
eks_cluster.eks_cluster.name.apply(helper)
to do this, where helper is a function that takes the name as a plain string and returns that dict object your constructing
b
it is being passed to a iam policy
Full code, this should work, but it fills the role with the error shown in the second screenshot
e
You can't use 'f' strings with pulumi outputs.
you want something like:
Copy code
assume_role_policy=eks_cluster.core.oidc_provider.url.apply(lambda url: json.dumps({ ....}),
I've also raised https://github.com/pulumi/pulumi/pull/11968 to see if we can do better at handling Outputs in dict keys.
g
Nice. These would be really handy (OutputDicts) esp if they supported a lazy way to coexist with a normal dict. Could make common tagging that rely on some Outputs a bit easier in some of my pulumi codebases without having to send in the entire mutable object to a callback.
b
@echoing-dinner-19531 is it possible to simplify that? What happens if inside the
assume_role_policy
I need more than one output?
e
For now, you'd have to use the
all
method to combine multiple outputs into one. But that PR has merged and will be in the next release (due this Wednesday v3.54) which should then let you just put output values as keys or values in dicts and pass that to
Output.jsonDumps
It's just test code not a real example but https://github.com/pulumi/pulumi/blob/master/sdk/python/lib/test/test_output.py#L390-L395 shows that this works