This message was deleted.
# general
s
This message was deleted.
w
Oh this was the diff code that I copied from one of the examples. Weird how there is no kind of stack trace.
Hmmm it's actually from a
<pulumi.output.Unknown object at 0x1120840d0>
. I thought in the
diff
method that all inputs would be resolved by that point?
Ah I think it was missing an
apply
Arggg. This has come back to haunt me again. Why would a property that is being passed to
diff
be
pulumi.output.Unknown
? Shouldn't they be resolved by that point?
l
Do you have sharable code? I don't think that error message is specific enough to help diagnose.
w
I just put it up on https://gist.github.com/steinybot/ab1c9aafc2bfd230b4994d9720af136e. Sorry that it isn't simplified. The problem is in
WriteFile
. Where
connection
is something like:
Copy code
{'username': 'ec2-user', 'private_key': <pulumi.output.Unknown object at 0x109530190>, 'host': '<http://example.com|example.com>', 'private_key_passphrase': <pulumi.output.Unknown object at 0x109530100>}
It' probably that I am doing the secret properties wrong.
l
Looks like you're serializing a dictionary with Input values. I think you'll need to serialize those individually...
Sorry, my python is rudimentary.
You may need to write a ToString (or whatever the equivalent is in Python) that uses
apply
to render the string.
w
Hmmm
It seems to work find if I don't use secret values so I don't think it is just a problem of using
Input
in a dictionary.
Spoke too soon. Maybe it doesn't work without secrets.
Maybe I'll ask in the python channel
👍 1
l
Secrets would make me more confident in my idea. You have to render secrets yourself: Pulumi does its best to not render secrets in this sort of situation. You have to override it yourself.
w
Those values are coming from the
create
in the
GenerateSSHKey
resource. So if the plan is to create the
GenerateSSHKey
resource which is outputting those secrets then I'm guessing those values are not going to be available in the
diff
of the
WriteFile
resource which depends on those?
l
I'm afraid I don't know the lifecycle around
diff
. Is that a Python thing? The values won't be available synchronously, only in an
apply
block. But since they're only secrets and not dependent on a cloud resource, the
apply
shouldn't be dependent on anything and should be able to run immediately.
w
It would make sense that the outputs of one resource are not available to the other during the planning stage.
Yeah ok so treating
pulumi.output.Unknown
as a difference during
diff
seems to do the job.
That seems to match how resources from other providers work.
👍 1