This message was deleted.
# general
s
This message was deleted.
w
Basically you cannot generate the JSON at the point in time you call your function.
But you can create an output that generates the JSON.
Copy code
const jsonOutput = unresolvedInputs.apply((resolvedInputs) => createJson(resolvedInputs))
from your snippet it's not clear which variables are outputs. if it is
role.arn
then it would be:
r
Yes - so role is created using
const role = new aws.iam.Role()
w
Copy code
policy = role.arn.apply(arn => JSON.stringify({ ... , Principal: arn }))
r
Right - thank you. But doesn’t that just flip the problem around -I now have the role, but how do I get the bucket into that? do I need a nested bucket.bucket.apply within the `role.arn.apply``?
w
yes that would be one way to do it
but you can also resolve multiple outputs at once:
pulumi.output({ bucket, arn: role.arn}).apply(({bucket, arn}) => ...));
👍 1
r
Amazin g- thanks you so much for your help - super appreciated
w
you're welcome 🙂
👍 1